Skip to main content
summaryrefslogtreecommitdiffstats
blob: ecf42ca3624ce124787a271d7ddaf885e50cb3be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * 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.command.env.core.data;

public interface DataMappingRegistry
{
  /**
   * This method adds a data mapping from a source object to a target
   * object.  When the sourceObject is encountered by the framework the
   * sourceProperty will be called and the data will be passed to the
   * targetProperty in the targetObject.  If a transformer object is
   * specified the sourceObject is transformed before being passed to
   * the target object.
   * 
   * @param sourceType      The source object.
   * @param sourceProperty  The source property.
   * @param targetType      The target object.
   * @param targetProperty  The target property.
   * @param transformer     The transformer object that transforms the
   *                        the source object.
   */
  public void addMapping( Class       sourceType,
						  String      sourceProperty,
						  Class       targetType,
						  String      targetProperty,
						  Transformer transformer );
  
  /**
   * This method is equivalent to the above with targetProperty the same
   * as the sourceProperty and with the transformer set to null.
   * 
   * @param sourceType     The source object.
   * @param sourceProperty The source property.
   * @param targetType     The target object.
   */
  public void addMapping( Class       sourceType,
	                      String      sourceProperty,
	                      Class       targetType );
}

Back to the top

--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/JSPCMDocumentFactory.java72
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CMDocumentFactoryTLD.java580
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CommonXML.java87
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/DocumentProvider.java497
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP11TLDNames.java49
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP12TLDNames.java77
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/JSP20TLDNames.java31
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDAttributeDeclaration.java62
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDCMDocumentManager.java848
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDDocument.java105
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDElementDeclaration.java114
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDFunction.java36
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDInitParam.java30
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDListener.java20
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDValidator.java27
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDVariable.java45
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TaglibSupport.java61
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TaglibTracker.java45
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/URIResolverProvider.java20
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/DocumentLoaderForJSP.java550
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveAdapterFactory.java101
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveAdapterImpl.java599
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveWatcher.java23
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveWatcherFactory.java58
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveWatcherImpl.java124
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/IJSPHeadContentDetector.java22
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentHeadContentDetector.java33
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java554
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/format/FormattingStrategyJSPJava.java110
-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/tld/AbstractTaglibSupport.java142
-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/CMDocumentImpl.java437
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java450
-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/DefaultTaglibSupport.java38
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/DeferredTaglibSupport.java26
-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/contenttype/ContentDescriberForJSP.java57
-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/JSPHeadTokenizer.java1325
-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.java259
-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/SetupParticipantForJSP.java38
-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.java100
-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/JSPTranslation.java624
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.java234
-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.java297
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java119
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java1950
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.java416
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java147
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java511
-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.java217
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchParticipant.java122
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchScope.java137
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java511
-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/nls/ResourceHandler.java72
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java60
-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.java3589
-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.java544
-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.java561
-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.java46
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAssociationProvider.java28
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryCMProvider.java72
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryImpl.java136
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/ModelQueryAdapterFactoryForJSP.java237
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/TaglibModelQuery.java21
-rw-r--r--bundles/org.eclipse.wst.css.ui/.classpath7
-rw-r--r--bundles/org.eclipse.wst.css.ui/.compatibility2
-rw-r--r--bundles/org.eclipse.wst.css.ui/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.css.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.css.ui/build.properties22
-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gifbin229 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gifbin348 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gifbin338 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gifbin610 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gifbin366 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gifbin612 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gifbin164 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gifbin314 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gifbin218 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gifbin120 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gifbin374 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gifbin363 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gifbin339 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gifbin592 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gifbin600 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gifbin586 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gifbin597 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gifbin588 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gifbin162 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gifbin371 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gifbin579 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gifbin599 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gifbin346 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gifbin601 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gifbin608 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gifbin609 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/plugin.properties18
-rw-r--r--bundles/org.eclipse.wst.css.ui/plugin.xml133
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/EditingCSS.properties50
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java118
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/CSSEditorPlugin.java134
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java60
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java125
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java501
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSCACandidate.java102
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistContext.java454
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistProcessor.java273
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalArranger.java169
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGenerator.java209
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForAtmarkRule.java293
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationName.java171
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationValue.java370
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForHTMLTag.java157
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForPseudoSelector.java157
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/HTML40Namespace.java889
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ContentSettingsRegistry.java34
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ui/CSSContentSettingsPropertyPage.java101
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java40
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupDialogCSS.java292
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageHelper.java124
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageType.java235
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java154
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java51
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java42
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/nls/ResourceHandler.java66
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectCSSAction.java53
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectEnclosingCSSAction.java47
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectNextCSSAction.java60
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectPreviousCSSAction.java55
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/CSSPreferenceManager.java185
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorManager.java228
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java236
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSFilesPreferencePage.java59
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSSourcePreferencePage.java247
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/registry/AdapterFactoryProviderCSS.java55
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/CSSTextColors.java143
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/IStyleConstantsCSS.java31
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForCSS.java202
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForEmbeddedCSS.java104
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/taginfo/CSSBestMatchHoverProcessor.java33
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/text/CSSDocumentRegionEdgeMatcher.java89
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java118
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSNodeAdapter.java319
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeAdapterFactoryCSS.java42
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java263
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java231
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java66
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java53
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySource.java350
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySourceAdapterFactory.java45
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java114
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.compatibility2
-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/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.properties124
-rw-r--r--bundles/org.eclipse.wst.dtd.core/plugin.xml81
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java369
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java71
-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.java162
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java424
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMNode.java133
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java79
-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.java667
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java333
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDPlugin.java108
-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.java324
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java242
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Logger.java132
-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.java93
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Notation.java29
-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.java84
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java38
-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/ContentDescriberForDTD.java30
-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.java273
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentCharsetDetector.java61
-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/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/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.java1428
-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.java135
-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.java192
-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.dtd.ui/.classpath7
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.compatibility2
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.cvsignore6
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/.project26
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/README.txt1
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/build.properties22
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gifbin159 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gifbin336 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gifbin164 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gifbin225 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gifbin320 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gifbin114 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gifbin336 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gifbin196 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gifbin124 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gifbin318 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gifbin162 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gifbin358 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/icons/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.ui/plugin.properties350
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/plugin.xml111
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/ActionContributorDTD.java41
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/DTDEditorPlugin.java155
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextEditorDTD.java24
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java98
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DTDDragAndDropManager.java46
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragAttributeCommand.java61
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragContentModelCommand.java111
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragTopLevelNodesCommand.java64
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java155
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java42
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java36
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java180
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDFilesPreferencePage.java62
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/registry/AdapterFactoryProviderForDTD.java74
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/IStyleConstantsDTD.java41
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTD.java135
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTDSubSet.java156
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/taginfo/DTDBestMatchHoverProcessor.java34
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/text/DTDDocumentRegionEdgeMatcher.java28
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java210
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java307
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java87
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java288
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/IndexedNodeList.java86
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java64
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java63
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeAction.java54
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeListAction.java44
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddCommentAction.java32
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementAction.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementToContentModelAction.java50
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddEntityAction.java35
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddGroupToContentModelAction.java40
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddNotationAction.java34
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddParameterEntityReferenceAction.java48
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/BaseAction.java78
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/DeleteAction.java69
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapter.java131
-rw-r--r--bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapterFactory.java42
-rw-r--r--bundles/org.eclipse.wst.html.ui/.classpath7
-rw-r--r--bundles/org.eclipse.wst.html.ui/.compatibility2
-rw-r--r--bundles/org.eclipse.wst.html.ui/.cvsignore4
-rw-r--r--bundles/org.eclipse.wst.html.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.html.ui/build.properties22
-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gifbin573 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gifbin197 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gifbin343 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gifbin344 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gifbin229 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gifbin570 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gifbin577 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gifbin601 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gifbin135 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gifbin581 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gifbin82 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.properties19
-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.xml277
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/EditingHTML.properties166
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/HTMLEditorPlugin.java195
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java61
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java384
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntry.java30
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntryProvider.java29
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ContentSettingsRegistry.java174
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntry.java23
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProvider.java24
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProviderBuilder.java56
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/HTMLContentSettingsPropertyPage.java279
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ProjectContentSettingsPropertyPage.java282
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/ActionContributorHTML.java31
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java42
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupDialogHTML.java311
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java157
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java58
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java428
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java132
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java53
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java40
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java83
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java154
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java29
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java43
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/nls/ResourceHandler.java70
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java49
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java46
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java130
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLFilesPreferencePage.java191
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLSourcePreferencePage.java143
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLTemplatePreferencePage.java59
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForEmbeddedHTML.java35
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForHTML.java138
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/IStyleConstantsHTML.java22
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/LineStyleProviderForHTML.java95
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLBestMatchHoverProcessor.java34
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLInformationProvider.java53
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLTagInfoHoverProcessor.java28
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTML.java51
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttribute.java26
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttributeValue.java26
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLTag.java25
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/text/HTMLDocumentRegionEdgeMatcher.java28
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java32
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLNodeActionManager.java136
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterFactoryForHTML.java50
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterForHTML.java114
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml24
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_de.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_es.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_fr.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_it.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ja.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ko.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_pt_BR.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_CN.properties35
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_TW.properties35
-rw-r--r--bundles/org.eclipse.wst.sse.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.sse.core/.compatibility2
-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/.project37
-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/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.java1953
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex1398
-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/SedModel/HTMLTokenizer/resources/REC-xml-19980210.zipbin41514 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/resources/java1
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/resources/javac1
-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.properties25
-rw-r--r--bundles/org.eclipse.wst.sse.core/plugin.xml76
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/builderparticipant.exsd115
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd111
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/Models.properties72
-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.java476
-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.java1603
-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/FileBufferModelManager.java513
-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.java40
-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.java393
-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.java1747
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/ModelPlugin.java272
-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/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.java249
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/cleanup/AbstractStructuredCleanupProcessor.java471
-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.java142
-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/document/AbstractDocumentLoader.java385
-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.java91
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/document/StructuredDocumentLoader.java147
-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.java87
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/exceptions/SourceEditingRuntimeException.java91
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/filebuffers/BasicStructuredDocumentFactory.java52
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/format/AbstractStructuredFormatProcessor.java493
-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/IStructuredFormattingStrategy.java21
-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/format/StructuredFormattingStrategy.java93
-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.java179
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java162
-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/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.java469
-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.java278
-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.java131
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/nls/ResourceHandler.java70
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/nls/ResourceHandler1.java70
-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.java2565
-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.java423
-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/SynchronizedStructuredDocument.java1026
-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.java620
-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.java197
-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.java176
-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.java215
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/util/ResourceUtil.java70
-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.java727
-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.java74
-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.sse.ui/.classpath9
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.compatibility2
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.cvsignore5
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.options50
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.project49
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs69
-rw-r--r--bundles/org.eclipse.wst.sse.ui/DevTimeSupport/JSEditor/MakeJavaReflectFCRecs.java136
-rw-r--r--bundles/org.eclipse.wst.sse.ui/DevTimeSupport/JSEditor/build.bat4
-rw-r--r--bundles/org.eclipse.wst.sse.ui/DevTimeSupport/nl/README.2TC.RME9
-rw-r--r--bundles/org.eclipse.wst.sse.ui/DevTimeSupport/nl/preparePIIDrop.xml431
-rw-r--r--bundles/org.eclipse.wst.sse.ui/DevTimeSupport/nl/processPIIReturn.xml457
-rw-r--r--bundles/org.eclipse.wst.sse.ui/README.txt2
-rw-r--r--bundles/org.eclipse.wst.sse.ui/build.properties37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/html/maintopic.html13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/html/subtopic.html13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/html/toc.html13
-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gifbin370 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gifbin155 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gifbin221 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gifbin149 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gifbin243 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gifbin157 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gifbin233 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gifbin370 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gifbin121 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gifbin224 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gifbin344 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.ui/javadoc.xml22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/plugin.properties79
-rw-r--r--bundles/org.eclipse.wst.sse.ui/plugin.xml545
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/extendedconfiguration.exsd325
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/AbstractContentSettingsHandler.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/AbstractSubject.java50
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentPropertiesPlugin.java123
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentSettings.java666
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentSettingsChangeSubject.java59
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentSettingsCreator.java23
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentSettingsFileHandler.java144
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentSettingsSelfHandler.java90
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ContentSettingsSynchronizer.java172
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/IContentSettings.java79
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/IContentSettingsHandler.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/IContentSettingsListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/INotify.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/ISubject.java23
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/Logger.java153
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-contentproperties/org/eclipse/wst/sse/ui/contentproperties/SimpleNodeOperator.java366
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/ConfigurationPointCalculator.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/ExtensionsPlugin.java79
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/ISelfValidateEditAction.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/Logger.java153
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/breakpoint/IBreakpointConstants.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/breakpoint/IBreakpointProvider.java69
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/breakpoint/IExtendedStorageEditorInput.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/breakpoint/NodeLocation.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/breakpoint/NullSourceEditingTextTools.java72
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/breakpoint/SourceEditingTextTools.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/openon/IOpenOn.java46
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckAction.java23
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckElement.java25
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckException.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckOptionDialog.java24
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckProvider.java23
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckSelectionListener.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckSelectionManager.java24
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellCheckTarget.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/extensions/spellcheck/SpellChecker.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/Editing.properties591
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/CaretMediator.java282
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorPlugin.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FileModelProvider.java1100
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/GotoAnnotationAction.java357
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IModelProvider.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/IReleasable.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ISourceViewerActionBarContributor.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ITemporaryAnnotation.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/Logger.java155
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/NullModelProvider.java135
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ReadOnlyAwareDropTargetAdapter.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/SpellCheckActionWrapper.java203
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/SpellCheckTargetImpl.java264
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StorageModelProvider.java670
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredDocumentCommand.java500
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredDocumentToTextAdapter.java1258
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredLineChangeHover.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredMarkerAnnotation.java130
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredResourceMarkerAnnotationModel.java97
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredResourceMarkerAnnotationModelFactory.java41
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextAnnotationHover.java384
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java2714
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextLineBreakingReader.java114
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java853
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextSelectionChangedEvent.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewer.java1161
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java423
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java193
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/TextFileModelProvider.java465
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ViewerSelectionManager.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/ViewerSelectionManagerImpl.java695
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IRelevanceCompletionProposal.java28
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IResourceDependentProcessor.java25
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ComboList.java285
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ComboListOnPropertyPage.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ContentSettingsPropertyPage.java294
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java374
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionDefinitionIds.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActiveEditorActionHandler.java272
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/BasicAutoEditStrategy.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRActionDelegate.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java272
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToLFActionDelegate.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java228
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ResourceActionDelegate.java75
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/SharedEditorPluginImageHelper.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/StructuredTextEditorActionConstants.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/AbstractDropAction.java82
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/ExtendedConfigurationBuilder.java204
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/ExtendedEditorActionBuilder.java696
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/ExtendedEditorDropTargetAdapter.java301
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/FileDropAction.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/FormatProcessorsExtensionReader.java101
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IActionValidator.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IDropAction.java36
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IExtendedConfiguration.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IExtendedContributor.java30
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IExtendedEditorAction.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IExtendedMarkupEditor.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IExtendedMarkupEditorExtension.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IExtendedSimpleEditor.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/IPopupMenuContributor.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/SpellCheckProviderBuilder.java241
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/TextDropAction.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/extension/TransferBuilder.java420
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java94
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java319
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceConstants.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/ContributedProcessorDescriptor.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickAssistProcessor.java31
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/IQuickFixProcessor.java30
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/NoModificationCompletionProposal.java78
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java161
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java306
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java414
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java64
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java93
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java172
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorExecutionContext.java86
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java72
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImageHelper.java155
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorPluginImages.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/HTML2TextReader.java304
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/HTMLTextPresenter.java198
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/IHelpContextIds.java60
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/LineBreakingReader.java127
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SingleCharReader.java67
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java253
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/SubstitutionTextReader.java177
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editorviewer/StructuredTextEditorViewer.java527
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java377
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java395
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java161
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java160
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java81
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java164
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java114
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java662
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java68
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java265
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java156
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/OverlayPreferenceStore.java486
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/TabFolderLayout.java61
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java510
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java44
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileStepAdapter.java50
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java65
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java41
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java61
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java298
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java138
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java65
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java235
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java144
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java180
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java178
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicFindOccurrencesAction.java165
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchLabelProvider.java75
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/BasicSearchQuery.java210
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionProvider.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesContentProvider.java89
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchQuery.java180
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchResult.java127
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/OccurrencesSearchViewPage.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java86
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java97
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectEnclosingAction.java46
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java57
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectNextAction.java62
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectPreviousAction.java57
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java91
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java67
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/nls/ResourceHandler.java70
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/AbstractOpenOn.java238
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/OpenOnProvider.java121
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/CommonEditorPreferenceNames.java159
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/PreferenceKeyGenerator.java31
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/PreferenceManager.java366
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/AbstractColorPage.java272
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/AbstractPreferencePage.java287
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/AbstractPreferenceTab.java267
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/ColorEditor.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/ColorHelper.java147
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/ColorNames.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/EditStructuredTextEditorPreferencesAction.java235
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/FilePreferencePage.java136
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/IPreferenceTab.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/NavigationPreferenceTab.java232
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/StatusInfo.java202
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/StructuredTextEditorPreferencePage.java542
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/StyledTextColorPicker.java940
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/TaskTagPreferenceTab.java516
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/TextHoverPreferenceTab.java447
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/TranslucencyPreferenceTab.java152
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/AdapterFactoryProvider.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/AdapterFactoryRegistry.java28
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/AdapterFactoryRegistryExtension.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/AdapterFactoryRegistryImpl.java191
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/AdapterFactoryRegistryReader.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/embedded/EmbeddedAdapterFactoryProvider.java24
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/embedded/EmbeddedAdapterFactoryRegistryImpl.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/registry/embedded/EmbeddedAdapterFactoryRegistryReader.java87
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/style/AbstractLineStyleProvider.java382
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/style/Highlighter.java545
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/style/IHighlighter.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/style/LineStyleProvider.java39
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/style/LineStyleProviderForNoOp.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/style/YUV_RGBConverter.java201
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/taginfo/AbstractBestMatchHoverProcessor.java121
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/taginfo/AnnotationHoverProcessor.java212
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/taginfo/ProblemAnnotationHoverProcessor.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/taginfo/TextHoverManager.java215
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/text/DocumentRegionEdgeMatcher.java115
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/AccessibleInputDialog.java251
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/Assert.java171
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/EditorUtility.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/PlatformStatusLineUtil.java184
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/RegistryReader.java163
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/ShowViewAction.java102
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/util/Sorter.java77
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/view/events/CaretEvent.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/view/events/ICaretListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/view/events/INodeSelectionListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/view/events/ITextSelectionListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/view/events/NodeSelectionChangedEvent.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/view/events/TextSelectionChangedEvent.java40
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/BufferedOutlineUpdater.java75
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java245
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/IJFaceNodeAdapter.java44
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/IJFaceNodeAdapterFactory.java26
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/PropertyChangeUpdateAction.java79
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/PropertyChangeUpdateActionContributionItem.java84
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/RefreshOutlineJob.java326
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/SourceEditorTreeViewer.java238
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/StructuredContentOutlineConfiguration.java286
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/StructuredTextEditorContentOutlinePage.java530
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/AdapterPropertySheetEntryLabelProvider.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/AdapterPropertySourceProvider.java34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/ConfigurablePropertySheetPage.java277
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/CustomPropertyDescriptor.java89
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/EnumeratedStringPropertyDescriptor.java79
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java19
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java190
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/RemoveAction.java46
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/ShowPropertiesAction.java39
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/StringComboBoxCellEditor.java111
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/StructuredPropertySheetConfiguration.java128
-rw-r--r--bundles/org.eclipse.wst.sse.ui/testToc.xml8
-rw-r--r--bundles/org.eclipse.wst.sse.ui/toc.xml13
-rw-r--r--bundles/org.eclipse.wst.xml.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.xml.core/.compatibility2
-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/.project38
-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.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.xml115
-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.java153
-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.java118
-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.java150
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/commentelement/CommentElementAdapter.java123
-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.java226
-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/ContentDescriberForXML.java25
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/contenttype/XMLHeadTokenizer.java1226
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/contenttype/XMLHeadTokenizerConstants.java24
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/contenttype/XMLResourceEncodingDetector.java102
-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.java116
-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.java773
-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/contenttype/ByteReader.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java34
-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/XMLDeclDetector.java156
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java1222
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java22
-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.java1073
-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.java351
-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.java875
-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.java1699
-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.java95
-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.java161
-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.xml.ui/.classpath9
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.compatibility2
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.cvsignore7
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.project47
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs69
-rw-r--r--bundles/org.eclipse.wst.xml.ui/README.txt1
-rw-r--r--bundles/org.eclipse.wst.xml.ui/build.properties29
-rw-r--r--bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zipbin6748 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/XMLFile.gifbin564 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse.gifbin146 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/collapse_all.gifbin155 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainoff.gifbin216 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/constrainon.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand.gifbin153 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/expand_all.gifbin164 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/new_xml.gifbin239 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/rldgrmr.gifbin245 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/dtool16/validate.gifbin334 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse.gifbin146 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/collapse_all.gifbin157 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainoff.gifbin348 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/constrainon.gifbin333 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand.gifbin153 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/expand_all.gifbin164 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/new_xml.gifbin370 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/rldgrmr.gifbin368 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/etool16/validate.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/XSDFile.gifbin574 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/add_correction.gifbin318 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/att_req_obj.gifbin221 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/attribute_obj.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/cdatasection.gifbin359 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/choice.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/comment_obj.gifbin196 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/correction_change.gifbin197 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/doctype.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/dtdfile.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/element_obj.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity.gifbin124 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/entity_reference.gifbin316 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/enum.gifbin80 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/error-overlay.gifbin82 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/localvariable_obj.gifbin152 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/notation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/occurone_obj.gifbin139 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/proinst_obj.gifbin138 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic.gifbin98 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-macro.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/text.gifbin349 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/txtext.gifbin354 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/warning_obj.gifbin337 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/stale_error_ovr.gifbin77 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/ovr16/warn_ovr.gifbin162 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/view16/attibute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wiz.gifbin596 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/newSampleProject_wizbanner.gifbin3213 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/xmldoc.gifbin564 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/plugin.properties53
-rw-r--r--bundles/org.eclipse.wst.xml.ui/plugin.xml347
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/IDesignViewer.java26
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/IDesignViewerActionBarContributor.java19
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/SourceEditorActionBarContributor.java210
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/SourcePageActionContributor.java62
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/XMLEditorActionDefinitionIds.java32
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/XMLEditorPluginHOLD_OLD.java127
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/XMLEditorPluginImageHelper.java152
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/XMLEditorPluginImages.java27
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/XMLMultiPageEditorActionBarContributor.java89
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/internal/ui/XMLMultiPageEditorPart.java772
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java136
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java431
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java512
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java69
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java324
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java367
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java29
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java97
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java332
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java182
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/nls2/ResourceHandler.java64
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/xmleditor.properties25
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java57
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java326
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java423
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java937
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLExampleProjectCreationWizard.java38
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java203
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java67
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java67
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/icons/generatexml_wiz.gifbin3500 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/wizardResource.properties169
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/EditingXML.properties230
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/DOMObserver.java190
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/JobStatusLineHelper.java103
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/Logger.java155
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextEditorXML.java78
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java295
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/XMLEditorPlugin.java236
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/XMLSpellCheckTarget.java38
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/AbstractNodeActionManager.java657
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ActionContributorXML.java204
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/AddBlockCommentActionXML.java67
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/BaseNodeActionManager.java518
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CleanupActionXML.java45
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CleanupDialogXML.java198
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java237
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/EditAttributeAction.java84
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/EditDoctypeAction.java191
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/EditElementAction.java119
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/EditProcessingInstructionAction.java95
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/EditSchemaInfoAction.java167
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/MenuBuilder.java145
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/NodeAction.java26
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/RemoveBlockCommentActionXML.java71
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ReplacePrefixAction.java79
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ToggleCommentActionXML.java59
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/UncommentActionXML.java61
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractContentAssistProcessor.java2192
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractContentModelGenerator.java86
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractTemplateCompletionProcessor.java118
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AttributeContextInformation.java113
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AttributeContextInformationPresenter.java112
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AttributeContextInformationProvider.java208
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ContentAssistRequest.java273
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ContextInfoModelUtil.java60
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/CustomTemplateProposal.java60
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/NoRegionContentAssistProcessor.java263
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/NonValidatingModelQueryAction.java159
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ProposalComparator.java48
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/SimpleCMElementDeclaration.java170
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/SourceEditorImageHelper.java48
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/XMLContentAssistProcessor.java86
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/XMLContentAssistUtilities.java470
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/XMLContentModelGenerator.java126
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/XMLRelevanceConstants.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/XMLTemplateCompletionProcessor.java63
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditAttributeDialog.java175
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditDoctypeDialog.java241
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditElementDialog.java148
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditEntityHelper.java75
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditNamespaceInfoDialog.java255
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditProcessingInstructionDialog.java124
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/EditSchemaInfoDialog.java78
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/NamespaceInfoErrorHelper.java101
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/NamespaceInfoTable.java391
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/SelectFileOrXMLCatalogIdDialog.java87
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/SelectFileOrXMLCatalogIdPanel.java182
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/SelectXMLCatalogIdDialog.java111
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/SelectXMLCatalogIdPanel.java132
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/UpdateListener.java20
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dialogs/XMLCatalogTableViewer.java198
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dnd/DragNodeCommand.java229
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/dnd/XMLDragAndDropManager.java48
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/doubleclick/XMLDoubleClickStrategy.java292
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extension/IDesignViewerSelectionManager.java33
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extension/IExtendedDesignEditor.java34
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extensions/XMLSourceEditingTextTools.java138
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java122
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java42
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java175
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/ProblemIDsXML.java31
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickAssistProcessorXML.java169
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java148
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java157
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java183
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java108
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java43
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java155
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java53
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesAction.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/nls/ResourceHandler.java68
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/nsedit/CommonAddNamespacesControl.java267
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/nsedit/CommonAddNamespacesDialog.java188
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/nsedit/CommonEditNamespacesDialog.java320
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/nsedit/CommonEditNamespacesTargetFieldDialog.java105
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/nsedit/CommonNamespaceInfoTable.java341
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/openon/DefaultOpenOnXML.java340
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/EncodingSettings.java357
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/WorkbenchDefaultEncodingSettings.java138
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLColorPage.java230
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLFilesPreferencePage.java204
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLSourcePreferencePage.java250
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLTemplatePreferencePage.java68
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/AbstractReconcileStepAdapter.java156
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepAdapterForXML.java698
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepForContentModel.java233
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepForMarkup.java555
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcilerAdapterFactoryForXML.java94
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/StructuredTextReconcilingStrategyForContentModel.java41
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/StructuredTextReconcilingStrategyForMarkup.java34
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/registry/AdapterFactoryProviderForEmbeddedXML.java40
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/registry/AdapterFactoryProviderForXML.java143
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/style/IStyleConstantsXML.java41
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/style/LineStyleProviderForXML.java181
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/taginfo/MarkupTagInfoProvider.java177
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/taginfo/XMLBestMatchHoverProcessor.java39
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/taginfo/XMLInformationProvider.java64
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/taginfo/XMLTagInfoHoverProcessor.java334
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/templates/TemplateContextTypeIds.java24
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/templates/TemplateContextTypeXML.java56
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/templates/TemplateContextTypeXMLAttribute.java26
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/templates/TemplateContextTypeXMLAttributeValue.java26
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/templates/TemplateContextTypeXMLTag.java25
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/text/XMLDocumentRegionEdgeMatcher.java25
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/util/SharedXMLEditorPluginImageHelper.java72
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/util/XMLCommonResources.java98
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/util/XMLCommonUIContextIds.java64
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/JFaceNodeAdapter.java345
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/JFaceNodeAdapterFactory.java104
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/JFaceNodeContentProvider.java104
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/JFaceNodeLabelProvider.java136
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/RefreshOutlineJob.java90
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/RefreshPropertySheetJob.java62
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java226
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLNodeActionManager.java52
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/ProcessingInstructionPropertySourceAdapter.java156
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java88
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySourceAdapter.java671
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySourceAdapterFactory.java43
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml5
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_de.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_es.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_fr.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_it.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_ja.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_ko.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_pt_BR.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_zh_CN.properties14
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates_zh_TW.properties14
-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/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.properties1047
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/plugin.xml203
-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.java189
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDContentOutlinePage.java375
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDEditor.java1140
-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.java1975
-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.java405
-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.java51
-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.java271
-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/ISchemaEditorActionConstants.java20
-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/XSDEditNamespacesAction.java220
-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.java89
-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/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.java198
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/FigureCanvasKeyboardHandler.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/GraphContextMenuProvider.java57
-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.java574
-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.java164
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeDefinitionEditPart.java210
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/ComplexTypeInheritedContentEditPart.java145
-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.java379
-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.java196
-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/SubstitutionGroupViewerRootEditPart.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/graph/editparts/TopLevelComponentEditPart.java273
-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.java97
-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.java83
-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.java154
-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/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.java1175
-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/ComplexTypeSection.java222
-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.java345
-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.java430
-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.java183
-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.java541
-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.java722
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/properties/section/TypesSection.java326
-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.java306
-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/XSDVisitor.java217
-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.java85
-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.java142
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java300
-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/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/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/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.java762
-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.java43
-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/w3c/XMLSchema.dtd402
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/w3c/XMLSchema.xsd2534
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/w3c/datatypes.dtd203
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/w3c/xml.xsd81
1709 files changed, 0 insertions, 266981 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/.classpath b/bundles/org.eclipse.jst.jsp.core/.classpath
deleted file mode 100644
index df094ee4a7..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/.compatibility b/bundles/org.eclipse.jst.jsp.core/.compatibility
deleted file mode 100644
index 11e51a03db..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.compatibility
+++ /dev/null
@@ -1,2 +0,0 @@
-#Wed Mar 24 13:53:52 EST 2004
-.project=11530
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 a427e6b4ad..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/.options
+++ /dev/null
@@ -1,19 +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.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
-
-# BOTH org.eclipse.jst.jsp.core.internal.contentmodel.tld.AbstractTaglibSupport._debug
-# AND org.eclipse.jst.jsp.core.modelquery.ModelQueryAdapterFactoryForJSP._debug
-org.eclipse.jst.jsp.core/debug/taglibsupport=false
-
-#org.eclipse.jst.jsp.core.text.rules.StructuredTextPartitioner.debugPrefixListener
-org.eclipse.jst.jsp.core/partitioner/prefixlistener=false \ No newline at end of file
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/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 67265c6893..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/plugin.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-Structured_Source_JSP_Model.name=Structured Source JSP Model
-Structured_Source_JSP_Model_NL_Support.name=Structured Source JSP Model NL Support
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 53287d3f53..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/plugin.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.jst.jsp.core"
- name="%Structured_Source_JSP_Model.name"
- version="1.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.jst.jsp.core.JSPCorePlugin">
-
- <runtime>
- <library name="jspmodel.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <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.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">
- <factory
- contentTypeId="org.eclipse.jst.jsp.core.jspsource"
- class="org.eclipse.wst.sse.core.filebuffers.BasicStructuredDocumentFactory:org.eclipse.jst.jsp.core.jspsource"/>
- </extension>
- <extension
- point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="jsp">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jspf">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jsf">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jsv">
- </fileTypes>
- <fileTypes
- type="text"
- extension="jtpl">
- </fileTypes>
- <fileTypes
- type="text"
- extension="tld"/>
- </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"
- 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 .tld files with the XML content type -->
- <file-association
- content-type="org.eclipse.core.runtime.xml"
- file-extensions="tld"/>
- <file-association
- content-type="org.eclipse.wst.xml.core.xmlsource"
- file-extensions="tld"/>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.jst.jsp.core/src/ModelsJSP.properties b/bundles/org.eclipse.jst.jsp.core/src/ModelsJSP.properties
deleted file mode 100644
index bfa64fe7b2..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/ModelsJSP.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/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/JSPCorePlugin.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSPCorePlugin.java
deleted file mode 100644
index d2a09cbbad..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/JSPCorePlugin.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;
-
-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.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-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;
-
- /**
- * The constructor.
- */
- public JSPCorePlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.jsp.core.JspPluginResources"); //$NON-NLS-1$
- }
- catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * Returns the shared instance.
- */
- public static JSPCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = JSPCorePlugin.getDefault().getResourceBundle();
- try {
- return bundle.getString(key);
- }
- catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPreferences()
- */
- protected void initializeDefaultPluginPreferences() {
- super.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);
-
- // 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 any searching/indexing
- JSPSearchSupport.getInstance().setCanceled(true);
- // remove JSPIndexManager
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(JSPIndexManager.getInstance());
- super.stop(context);
-
- }
-} \ 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 7ff4062135..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/Logger.java
+++ /dev/null
@@ -1,141 +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 java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-
-/**
- * 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 Plugin fPlugin = JSPCorePlugin.getDefault();
- private static final String fPluginId = fPlugin.getDescriptor().getUniqueIdentifier();
-
- 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, fPluginId, severity, message, exception);
- fPlugin.getLog().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, fPluginId, IStatus.OK, message, exception);
- fPlugin.getLog().log(statusObj);
- }
- }
-
- /**
- * @return true if the plugin for this logger is debugging
- */
- public static boolean isDebugging() {
- return fPlugin.isDebugging();
- }
-
- /**
- * 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(fPluginId + 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.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/JSPCMDocumentFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/JSPCMDocumentFactory.java
deleted file mode 100644
index 0162a0e0f6..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/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.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/contentmodel/tld/CMDocumentFactoryTLD.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CMDocumentFactoryTLD.java
deleted file mode 100644
index 4db7aba318..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CMDocumentFactoryTLD.java
+++ /dev/null
@@ -1,580 +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.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMAttributeDeclarationImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMElementDeclarationImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDFunctionImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDInitParamImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDListenerImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDValidatorImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDVariableImpl;
-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.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 {
-
- public static final String KEY = "com.ibm.sse.contentmodel.tld.CMDocumentFactoryTLD"; //$NON-NLS-1$
- 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());
- }
-// File[] tagfiles = directory.listFiles();
- 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);
- return loadDocument(fileName, provider.getRootElement());
- }
-
- /**
- * 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);
- return loadDocument("jar:file://" + jarFileName + "!" + contentFileName, provider.getRootElement()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- 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 Object getKey() {
- return KEY;
- }
-
- 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;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CommonXML.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CommonXML.java
deleted file mode 100644
index 552e2a7902..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/CommonXML.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.contentmodel.tld;
-
-
-
-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.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/contentmodel/tld/DocumentProvider.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/DocumentProvider.java
deleted file mode 100644
index c047f60460..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/DocumentProvider.java
+++ /dev/null
@@ -1,497 +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.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.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 {
- /**
- *
- * @param args java.lang.String[]
- */
- public static void main(String[] args) {
- if (args.length < 2)
- return;
- DocumentProvider p = new DocumentProvider();
- p.setFileName(args[0]);
- p.setRootElementName(args[1]);
- p.getDocument();
-
- }
-
- 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 java.lang.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 java.lang.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 while reading descriptor" + exception.getMessage()); //$NON-NLS-1$
- }
-
- public void fatalError(SAXParseException exception) throws SAXException {
- Logger.log(Logger.WARNING, "SAXParseException while reading descriptor" + exception.getMessage()); //$NON-NLS-1$
- }
-
- public void warning(SAXParseException exception) throws SAXException {
- Logger.log(Logger.WARNING, "SAXParseException 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) {
- rootElement = getRootElement(document);
- }
-
- 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/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/TLDCMDocumentManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDCMDocumentManager.java
deleted file mode 100644
index 4a2b5ae733..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TLDCMDocumentManager.java
+++ /dev/null
@@ -1,848 +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.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsp.core.JSP12Namespace;
-import org.eclipse.jst.jsp.core.Logger;
-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.sse.core.util.URIResolver;
-import org.eclipse.wst.xml.core.jsp.model.parser.temp.XMLJSPRegionContexts;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-public class TLDCMDocumentManager {
- static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/tldcmdocument/manager")); //$NON-NLS-1$ //$NON-NLS-2$
- static final String XMLNS = "xmlns:"; //$NON-NLS-1$
- static final int XMLNS_LENGTH = XMLNS.length();
-
- 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));
- }
-
- 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.
- */
- protected void processInclude(IStructuredDocumentRegion includeStructuredDocumentRegion, IStructuredDocumentRegion anchorStructuredDocumentRegion, JSPSourceParser textSource) {
- ITextRegionList regions = includeStructuredDocumentRegion.getRegions();
- String file = 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) {
- file = textSource.getText(includeStructuredDocumentRegion.getStartOffset(region), region.getTextLength());
- isFilename = false;
- }
- }
- }
- catch (StringIndexOutOfBoundsException sioobExc) {
- // nothing to be done
- file = null;
- }
- if (file != null) {
- String fileLocation = null;
- if (getResolver() != null) {
- if (getIncludes().empty())
- fileLocation = getResolver().getLocationByURI(StringUtils.strip(file));
- else
- fileLocation = getResolver().getLocationByURI(StringUtils.strip(file), (String) getIncludes().peek());
- }
- else {
- fileLocation = StringUtils.strip(file);
- }
- // hopefully, a resolver is present and has returned a
- // canonical file path
- if (!getIncludes().contains(fileLocation) && getBaseLocation() != null && !fileLocation.equals(getBaseLocation())) {
- getIncludes().push(fileLocation);
- if (getParser() != null)
- new IncludeHelper(anchorStructuredDocumentRegion, getParser()).parse(fileLocation);
- 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);
- }
- }
-
- /**
- * 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));
- }
-
- 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();
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.model.parser.StructuredDocumentRegionHandlerExtension#setStructuredDocument(com.ibm.sse.model.text.IStructuredDocument)
- */
- 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;
- }
-
- protected String getContents(String fileName) {
- StringBuffer s = new StringBuffer();
- 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 s = getContents(filename);
- 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() {
- }
- }
-
- // will hold the prefixes banned by the specification; taglibs may not use
- // them
- protected static List bannedPrefixes = null;
-
- 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;
-
- 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 java.lang.String
- */
- public String getBaseLocation() {
- if (getResolver() == null)
- return null;
- return getResolver().getFileBaseLocation();
- }
-
- /**
- * 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;
- }
-
- /**
- * 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 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 java.util.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 java.util.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;
- }
-
- 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;
- }
-
- public StructuredDocumentRegionHandler getStructuredDocumentRegionHandler() {
- return getDirectiveStructuredDocumentRegionHandler();
- }
-
- /**
- * Gets the includes.
- *
- * @return Returns a Stack
- */
- protected Stack getIncludes() {
- if (fIncludes == null)
- fIncludes = new Stack();
- return fIncludes;
- }
-
- JSPSourceParser getParser() {
- return fParser;
- }
-
- /**
- * Gets the resolver
- *
- * @return Returns a URIResolver
- */
- protected URIResolver getResolver() {
- if (getResolverProvider() == null) {
- Logger.log(Logger.WARNING, "Warning: a URIResolver was requested by " + getClass().getName() + " but none was available; taglib support disabled"); //$NON-NLS-1$ //$NON-NLS-2$
- return null;
- }
- return getResolverProvider().getResolver();
- }
-
- /**
- * Gets the resolverProvider.
- *
- * @return Returns a URIResolverProvider
- */
- public URIResolverProvider getResolverProvider() {
- return fResolverProvider;
- }
-
- /**
- *
- * @return com.ibm.sed.parser.JSPSourceParser
- */
- public JSPSourceParser getSourceParser() {
- return fParser;
- }
-
- /**
- *
- * @return java.util.List
- */
- public List getTaglibTrackers() {
- if (fTaglibTrackers == null)
- fTaglibTrackers = new ArrayList();
- return fTaglibTrackers;
- }
-
- /**
- * 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) {
- String location = null;
- InputStream directStream = null;
- // see if the resolver knows of some special way to get from URI to
- // InputStream
- // (automatic discovery of URIs, web.xml mappings, etc.
- if (getResolver() != null && uri != null)
- directStream = getResolver().getURIStream(uri);
- if (directStream != null) {
- if (_debug) {
- System.out.println("TLDCMDocumentManager loading taglib " + uri + " directly"); //$NON-NLS-2$//$NON-NLS-1$
- }
- return getCMDocumentBuilder().buildCMDocument(uri, directStream);
- }
-
- if (getResolver() != null && uri != null)
- location = getResolver().getLocationByURI(uri);
-
- // String location =
- // URIResolverPlugin.createResolver().resolve(getBaseLocation(), null,
- // uri);
-
- // Couldn't be located
- if (location == null)
- return null;
- if (_debug) {
- System.out.println("TLDCMDocumentManager loading taglib " + uri + " at " + location); //$NON-NLS-2$//$NON-NLS-1$
- }
- return getCMDocumentBuilder().createCMDocument(location);
- }
-
- /**
- * Loads the tags from the specified URI. It must point to a URL of valid
- * tag files to work.
- */
- protected CMDocument loadTagDir(String uri) {
- // JSP2_TODO: implement for JSP 2.0
- String location = URIResolverPlugin.createResolver().resolve(getBaseLocation(), 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);
- }
-
- protected void resetTaglibTrackers() {
- if (_debug) {
- System.out.println("TLDCMDocumentManager cleared its taglib trackers\n"); //$NON-NLS-1$
- }
- getTaglibTrackers().clear();
- }
-
- /**
- * Sets the resolverProvider.
- *
- * @param resolverProvider
- * The resolverProvider to set
- */
- public void setResolverProvider(URIResolverProvider resolverProvider) {
- fResolverProvider = resolverProvider;
- }
-
- public void setSourceParser(JSPSourceParser parser) {
- fParser = parser;
- }
-
-} \ 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/TaglibSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TaglibSupport.java
deleted file mode 100644
index b226ac874f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TaglibSupport.java
+++ /dev/null
@@ -1,61 +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.CMElementDeclaration;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-
-public interface TaglibSupport {
-
- void clearCMDocumentCache();
-
- /**
- * Return the list of CMDocuments active after this offset.
- * Elements in the list are only required to implement
- * CMDocument.
- */
- List getCMDocuments(int offset);
-
- /**
- * Return the list of CMDocuments active after this offset
- * and possessing the given prefix. Elements in the list
- * are only required to implement CMDocument.
- */
- List getCMDocuments(String prefix, int offset);
-
- /**
- * Return the list of CMDocumentTrackers active after this offset.
- * Difference from the CMDocument method in that the objects
- * are trackers; exists as a formality.
- */
- List getCMDocumentTrackers(int offset);
-
- /**
- * Return the list of CMDocumentsTrackers active after this offset
- * and possessing the given prefix. Different in that the List is
- * expected to contain tracker objects; exists as a formality.
- */
- List getCMDocumentTrackers(String prefix, int offset);
-
- /**
- * Return the first declaration found for the qualified tag
- * name using CMDocuments enabled for the given offset.
- */
- CMElementDeclaration getDeclaration(String tagName, int offset);
-
- IStructuredDocument getStructuredDocument();
-
- void setStructuredDocument(IStructuredDocument model);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TaglibTracker.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/TaglibTracker.java
deleted file mode 100644
index c038699818..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/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.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/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 6df15aa7a7..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/tld/URIResolverProvider.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;
-
-
-
-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/document/DocumentLoaderForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/DocumentLoaderForJSP.java
deleted file mode 100644
index 1aa90d3d05..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/DocumentLoaderForJSP.java
+++ /dev/null
@@ -1,550 +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.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.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.document.DocumentFactoryForJSP;
-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.common.encoding.content.IContentTypeIdentifier;
-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(IContentTypeIdentifier.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/document/PageDirectiveAdapterFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveAdapterFactory.java
deleted file mode 100644
index 01ec793e18..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/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.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/document/PageDirectiveAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveAdapterImpl.java
deleted file mode 100644
index 7f5ebb5d1c..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveAdapterImpl.java
+++ /dev/null
@@ -1,599 +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.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.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.util.Debug;
-import org.eclipse.wst.sse.core.util.ResourceUtil;
-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 String firstLanguageValue;
- private int firstContentTypePosition = -1;
- private String firstContentTypeValue;
-
- 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)) {
- firstContentTypeValue = 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)) {
- firstLanguageValue = 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 = model.getStructuredDocument().getDocumentPartitioner();
- 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 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 = ResourceUtil.getFileFor(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/document/PageDirectiveWatcher.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveWatcher.java
deleted file mode 100644
index 1900873690..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/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.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/document/PageDirectiveWatcherFactory.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveWatcherFactory.java
deleted file mode 100644
index e4282711e9..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/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.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/document/PageDirectiveWatcherImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/document/PageDirectiveWatcherImpl.java
deleted file mode 100644
index 4af98e810a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/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.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/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 b70a641c6a..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.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.common.encoding.content.IContentTypeIdentifier;
-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(IContentTypeIdentifier.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/format/FormattingStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/format/FormattingStrategyJSPJava.java
deleted file mode 100644
index 4e3da78389..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/format/FormattingStrategyJSPJava.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.jst.jsp.core.format;
-
-import java.util.LinkedList;
-import java.util.Map;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.ToolFactory;
-import org.eclipse.jdt.core.formatter.CodeFormatter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedPosition;
-import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy;
-import org.eclipse.jface.text.formatter.FormattingContextProperties;
-import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.jst.jsp.core.Logger;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationUtil;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-
-public class FormattingStrategyJSPJava extends ContextBasedFormattingStrategy {
-
- /** Documents to be formatted by this strategy */
- private final LinkedList fDocuments = new LinkedList();
- /** Partitions to be formatted by this strategy */
- private final LinkedList fPartitions = new LinkedList();
- JSPTranslation translation = null;
-
- /**
- * Creates a new java formatting strategy.
- */
- public FormattingStrategyJSPJava() {
- super();
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
- */
- public void format() {
- super.format();
-
- final IDocument document = (IDocument) fDocuments.removeFirst();
- final TypedPosition partition = (TypedPosition) fPartitions.removeFirst();
-
- if (document != null && partition != null) {
- try {
-
- JSPTranslationUtil translationUtil = new JSPTranslationUtil(document);
- ICompilationUnit cu = translationUtil.getCompilationUnit();
- if (cu != null) {
- String cuSource = cu.getSource();
- TextEdit textEdit = formatString(CodeFormatter.K_COMPILATION_UNIT, cuSource, 0, TextUtilities.getDefaultLineDelimiter(document), getPreferences());
-
- TextEdit jspEdit = translationUtil.getTranslation().getJspEdit(textEdit);
- if (jspEdit != null && jspEdit.hasChildren())
- jspEdit.apply(document);
- }
-
- }
- catch (MalformedTreeException exception) {
- Logger.logException(exception);
- }
- catch (BadLocationException exception) {
- // Can only happen on concurrent document modification - log
- // and bail out
- Logger.logException(exception);
- }
- catch (JavaModelException exception) {
- Logger.logException(exception);
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext)
- */
- public void formatterStarts(final IFormattingContext context) {
- super.formatterStarts(context);
-
- fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION));
- fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM));
- }
-
- /*
- * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
- */
- public void formatterStops() {
- super.formatterStops();
-
- fPartitions.clear();
- fDocuments.clear();
- }
-
- public TextEdit formatString(int kind, String string, int indentationLevel, String lineSeparator, Map options) {
- return ToolFactory.createCodeFormatter(options).format(kind, string, 0, string.length(), indentationLevel, lineSeparator);
- }
-} \ No newline at end of file
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/tld/AbstractTaglibSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/AbstractTaglibSupport.java
deleted file mode 100644
index 8bceac2b26..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/AbstractTaglibSupport.java
+++ /dev/null
@@ -1,142 +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.core.runtime.Platform;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TaglibSupport;
-import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
-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.CMNode;
-import org.eclipse.wst.sse.core.contentmodel.CMDocumentTracker;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Assert;
-
-public abstract class AbstractTaglibSupport implements TaglibSupport {
- protected IStructuredDocument fm = null;
- static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibsupport")); //$NON-NLS-1$ //$NON-NLS-2$
-
-
- protected TLDCMDocumentManager fTaglibMgr = null;
-
- public AbstractTaglibSupport() {
- super();
- }
-
- public void clearCMDocumentCache() {
- getTaglibManager().clearCache();
- }
-
- public List getCMDocuments(int offset) {
- return getCMDocumentTrackers(offset);
- }
-
- protected List getCMDocuments(List cmDocumentTrackers) {
- List newList = new ArrayList();
- if (cmDocumentTrackers != null)
- for (int i = 0; i < cmDocumentTrackers.size(); i++)
- newList.add(((CMDocumentTracker) cmDocumentTrackers.get(i)).getDocument());
- return newList;
- }
-
- public List getCMDocuments(String prefix, int offset) {
- return getCMDocumentTrackers(prefix, offset);
- }
-
- public List getCMDocumentTrackers(int offset) {
- return getTaglibManager().getCMDocumentTrackers(offset);
- }
-
- public List getCMDocumentTrackers(String prefix, int offset) {
- return getTaglibManager().getCMDocumentTrackers(prefix, offset);
- }
-
- /**
- * Helper method for accessing the content model
- */
- public CMElementDeclaration getDeclaration(String tagName, int offset) {
- // skip tagnames lacking a or starting with a ':'
- if (tagName.indexOf(':') <= 0)
- return null;
- // determine the prefix
- String prefix = tagName.substring(0, tagName.indexOf(':'));
- // find the eligible CMDocuments (when valid, only one exists)
- List docs = getCMDocuments(prefix, offset);
- for (int i = 0; i < docs.size(); i++) {
- CMDocument doc = (CMDocument) docs.get(i);
- CMNamedNodeMap elementMap = doc.getElements();
- if (elementMap == null)
- continue;
- CMNode decl = elementMap.getNamedItem(tagName);
- if (decl != null)
- return (CMElementDeclaration) decl;
- }
- return null;
- }
-
- public IStructuredDocument getStructuredDocument() {
- return fm;
- }
-
- /**
- * Gets the taglibMgr.
- * @return Returns a TLDCMDocumentManager
- */
- protected TLDCMDocumentManager getTaglibManager() {
- if (fTaglibMgr == null)
- fTaglibMgr = new TLDCMDocumentManager();
- return fTaglibMgr;
- }
-
- protected List getTrackers() {
- return getTaglibManager().getTaglibTrackers();
- }
-
- protected void hookParser() {
- if (fm == null) {
- getTaglibManager().setSourceParser(null);
- return;
- }
- RegionParser parser = fm.getParser();
- // support not possible without this parser; it supports getText() apart from the IStructuredDocument
- Assert.isTrue(parser instanceof JSPSourceParser, "IStructuredDocument.getParser() must be a JSPSourceParser"); //$NON-NLS-1$
- JSPSourceParser jspParser = (JSPSourceParser) parser;
- getTaglibManager().setSourceParser(jspParser);
- jspParser.addStructuredDocumentRegionHandler(getTaglibManager().getStructuredDocumentRegionHandler());
- }
-
- public void setStructuredDocument(IStructuredDocument m) {
- if (_debug && !(m == null || fm == null)) {
- System.out.println("AbstractTaglibSupport updated its IStructuredDocument instance");
- }
- unhookParser();
- fm = m;
- hookParser();
- }
-
- protected void unhookParser() {
- if (fm == null)
- return;
- RegionParser parser = fm.getParser();
- // support not possible without this parser; it supports getText() apart from the IStructuredDocument
- Assert.isTrue(parser instanceof JSPSourceParser, "IStructuredDocument.getParser() must be a JSPSourceParser"); //$NON-NLS-1$
- JSPSourceParser jspParser = (JSPSourceParser) parser;
- getTaglibManager().setSourceParser(null);
- jspParser.removeStructuredDocumentRegionHandler(getTaglibManager().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/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/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 4c47b50306..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMDocumentImpl.java
+++ /dev/null
@@ -1,437 +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.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.Logger;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDDocument;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDValidator;
-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;
-
- /**
- * 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 null;
- }
-
- /**
- *
- * @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;
- }
-
- /**
- *
- * @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 false;
- }
-
- 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 fd8184ad27..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/CMElementDeclarationImpl.java
+++ /dev/null
@@ -1,450 +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.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;
- }
- 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/DefaultTaglibSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/DefaultTaglibSupport.java
deleted file mode 100644
index 1b42c833eb..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/DefaultTaglibSupport.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.jst.jsp.core.internal.contentmodel.tld;
-
-
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.URIResolverProvider;
-import org.eclipse.wst.sse.core.util.URIResolver;
-
-public class DefaultTaglibSupport extends AbstractTaglibSupport {
-
- public DefaultTaglibSupport() {
- super();
- }
-
- public URIResolver getResolver() {
- if (getTaglibManager().getResolverProvider() == null)
- return null;
- return getTaglibManager().getResolverProvider().getResolver();
- }
-
- public void setResolver(URIResolver resolver) {
- final URIResolver tldResolver = resolver;
- getTaglibManager().setResolverProvider(new URIResolverProvider() {
- public URIResolver getResolver() {
- return tldResolver;
- }
- });
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/DeferredTaglibSupport.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/DeferredTaglibSupport.java
deleted file mode 100644
index ae0d42f9db..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contentmodel/tld/DeferredTaglibSupport.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.internal.contentmodel.tld;
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.URIResolverProvider;
-
-
-
-public class DeferredTaglibSupport extends AbstractTaglibSupport {
-
- public URIResolverProvider getResolverProvider() {
- return getTaglibManager().getResolverProvider();
- }
-
- public void setResolverProvider(URIResolverProvider provider) {
- getTaglibManager().setResolverProvider(provider);
- }
-} \ 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/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 f49bde4b15..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/ContentDescriberForJSP.java
+++ /dev/null
@@ -1,57 +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.AbstractContentDescriber;
-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/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/JSPHeadTokenizer.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
deleted file mode 100644
index e331d2b2c6..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPHeadTokenizer.java
+++ /dev/null
@@ -1,1325 +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.common.encoding.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.HeadParserToken;
-import org.eclipse.wst.common.encoding.IntStack;
-import org.eclipse.wst.xml.core.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 */
- 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 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 */
- 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
- */
- 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 064f6efccf..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.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 42c840feeb..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/contenttype/JSPResourceEncodingDetector.java
+++ /dev/null
@@ -1,259 +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.AbstractResourceEncodingDetector;
-import org.eclipse.wst.common.encoding.EncodingMemento;
-import org.eclipse.wst.common.encoding.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.HeadParserToken;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.xml.core.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/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/SetupParticipantForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java
deleted file mode 100644
index 1cc07951b6..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.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.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;
-
-
-
-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/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 ecfc9a3206..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSP2ServletNameUtil.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.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) {
- StringBuffer buf = new StringBuffer();
-
- // 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 {
- unmangled = (char)Integer.decode("0x" + qualifiedTypeName.substring(i+1, endIndex)).intValue();//$NON-NLS-1$
- i = endIndex;
-
- } catch(NumberFormatException e) {
- unmangled = c;
- }
- buf.append(unmangled);
- }
- } else {
- buf.append(c);
- }
- }
- return buf.toString();
- }
-
- /**
- * 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/JSPTranslation.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
deleted file mode 100644
index a980f18741..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslation.java
+++ /dev/null
@@ -1,624 +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.IProblemRequestor;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.WorkingCopyOwner;
-import org.eclipse.jdt.core.compiler.IProblem;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.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;
-
- private JSPTranslator fTranslator = null;
-
- private WorkingCopyOwner fTemporaryWorkingCopyOwner = null;
- private IProblemRequestor fProblemRequestor = null;
- 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) {
- 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$
- }
-
- public String getJspText() {
- return (fTranslator != null) ? fTranslator.getJspText() : ""; //$NON-NLS-1$
- }
-
- 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 give 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
- */
- protected boolean isIndirect(int javaOffset) {
- return isInRanges(javaOffset, fJava2JspIndirectMap);
- }
-
- private boolean isInRanges(int javaOffset, HashMap ranges) {
-
- Iterator it = ranges.keySet().iterator();
- while(it.hasNext()) {
- Position javaPos = (Position)it.next();
- // also include the start and end offset
- if(javaPos.includes(javaOffset) || javaPos.offset+javaPos.length == javaOffset)
- return true;
- }
- return false;
- }
-
- /**
- * Handles problem collection (during reconcile of the CompilationUnit)
- */
- private class ProblemRequestor implements IProblemRequestor {
-
- private List fCollectedProblems;
- private boolean fIsActive = false;
- private boolean fIsRunning = false;
-
- 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;
- }
- }
-
- // end of ProblemRequestor class
-
- /**
- * 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 IProblemRequestor getProblemRequestor() {
- if (fProblemRequestor == null)
- fProblemRequestor = new ProblemRequestor();
- return fProblemRequestor;
- }
-
- /**
- *
- * @return the IWorkingCopyOwner for this CompilationUnit in this JSPTranslation
- */
- public WorkingCopyOwner getWorkingCopyOwner() {
-
- if (fTemporaryWorkingCopyOwner == null) {
- fTemporaryWorkingCopyOwner = new WorkingCopyOwner() {
- public String toString() {
- return "JSP Temporary WorkingCopy owner"; //$NON-NLS-1$
- }
- };
- }
- return fTemporaryWorkingCopyOwner;
- }
-
- /**
- *
- * @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 = ((ProblemRequestor) 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) {
- ((ProblemRequestor) 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 e0234bf3ca..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationAdapter.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.jst.jsp.core.internal.java;
-
-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.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.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();
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(baseLocation));
- IProject project = null;
- 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 08d4a338da..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
+++ /dev/null
@@ -1,297 +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.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);
- 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 16135a8729..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
+++ /dev/null
@@ -1,119 +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.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.IModelManagerPlugin;
-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);
- XMLDocument xmlDoc = xmlModel.getDocument();
- xmlModel.releaseFromRead();
-
- JSPTranslationAdapter translationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (translationAdapter != null)
- fTranslation = translationAdapter.getJSPTranslation();
- }
-
- return fTranslation;
- }
-
- public ICompilationUnit getCompilationUnit() {
- return getTranslation().getCompilationUnit();
- }
-
- protected IModelManager getModelManager() {
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- return plugin.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 19fe852922..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
+++ /dev/null
@@ -1,1950 +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.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.Logger;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TLDVariable;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TaglibSupport;
-import org.eclipse.jst.jsp.core.modelquery.TaglibModelQuery;
-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.document.DocumentReader;
-import org.eclipse.wst.sse.core.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.modelhandler.ModelHandlerRegistry;
-import org.eclipse.wst.sse.core.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.parser.BlockMarker;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandler;
-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.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 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 fSession, fThreadSafe, 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;
-
- /** parse type*/
- public static final int S_MODEL_BASED_PARSE = 2>>1;
- public static final int S_FILE_BASED_PARSE = 2>>2;
-
- /** last XML tag encountered was... **/
- public static final int S_XML_USEBEAN = 2>>3;
- public static final int S_XML_SCRIPTLET = 2>>4;
- public static final int S_XML_EXPRESSION = 2>>5;
- public static final int S_XML_DECLARATION = 2>>6;
-
- private int stateMask = S_NONE;
-
- /**
- * configure using an XMLNode
- * @param node
- * @param monitor
- */
- private void configure(XMLNode node, IProgressMonitor monitor) {
-
- setState(S_MODEL_BASED_PARSE);
-
- 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
-
- setState(S_FILE_BASED_PARSE);
-
- 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;
-
- fSession = fThreadSafe = 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;
- }
-
- /**
- /* 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) {
- 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, true, 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 && fModelQuery instanceof TaglibModelQuery) {
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5159
- Iterator taglibs = ((TaglibModelQuery) fModelQuery).getTaglibSupport().getCMDocuments(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();
- setState(S_NONE);
- }
- /**
- * Saves memory if a model isn't already available.
- * @param file
- * @param monitor
- */
- public void translateFromFile(IFile file, IProgressMonitor monitor) {
-
- try {
- IModelHandler handler = ModelHandlerRegistry.getInstance().getHandlerFor(file);
-
- final IProgressMonitor progressMonitor = monitor;
- final IEncodedDocument defaultDocument = handler.getDocumentLoader().createNewStructuredDocument();
- if (defaultDocument instanceof IStructuredDocument) {
- RegionParser parser = ((IStructuredDocument) defaultDocument).getParser();
- if (parser instanceof StructuredDocumentRegionParser) {
-
- String charset = detectCharset(file);
- StructuredDocumentRegionParser documentParser = (StructuredDocumentRegionParser) parser;
- final IDocument textDocument = new Document();
- setDocumentContent(textDocument, file.getContents(true), charset);
- documentParser.reset(new DocumentReader(textDocument));
- documentParser.addStructuredDocumentRegionHandler(new StructuredDocumentRegionHandler() {
- /**
- * @see com.ibm.sse.model.parser.StructuredDocumentRegionHandler#nodeParsed(com.ibm.sse.model.text.IStructuredDocumentRegion)
- */
- public void nodeParsed(IStructuredDocumentRegion documentRegion) {
-
- // handle the document region (as with regular translation)
- translateDocumentRegion(documentRegion);
-
- // this is the memory saver
- // disconnect the document regions
- if (documentRegion.getPrevious() != null) {
- documentRegion.getPrevious().setPrevious(null);
- // some parts of code in translator call advanceNextNode()
- //documentRegion.getPrevious().setNext(null);
- }
- if (progressMonitor.isCanceled()) {
- textDocument.set(""); //$NON-NLS-1$
- }
- }
-
- /**
- * @see com.ibm.sse.model.parser.StructuredDocumentRegionHandler#resetNodes()
- */
- public void resetNodes() {
- //
- }
- });
- // kicks off the parsing
- documentParser.getDocumentRegions();
- // build the translation
- buildResult();
- }
- }
- setState(S_NONE);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * called from file based translation (no StructuredModel or StructuredDocument)
- * @param sdRegion
- */
- void translateDocumentRegion(IStructuredDocumentRegion sdRegion) {
- if(!isCanceled()) {
-
- setCurrentNode(sdRegion);
- if(sdRegion != null)
- setSourceReferencePoint();
-
- // check the last state here
- if(hasState(S_XML_USEBEAN)) {
- translateUseBean(sdRegion);
- unsetState(S_XML_USEBEAN);
- }
- else if(hasState(S_XML_SCRIPTLET)) {
- translateScriptletString(sdRegion.getText(), sdRegion, sdRegion.getStartOffset(), sdRegion.getEndOffset());
- unsetState(S_XML_SCRIPTLET);
- }
- else if(hasState(S_XML_EXPRESSION)) {
- translateExpressionString(sdRegion.getText(), sdRegion, sdRegion.getStartOffset(), sdRegion.getEndOffset());
- unsetState(S_XML_EXPRESSION);
- }
- else if(hasState(S_XML_DECLARATION)) {
- translateDeclarationString(sdRegion.getText(), sdRegion, sdRegion.getStartOffset(), sdRegion.getEndOffset());
- unsetState(S_XML_DECLARATION);
- }
- else {
- // normal case
-
- // 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 structured document region
- translateRegionContainer(getCurrentNode(), STANDARD_JSP);
- }
- }
- }
- }
-
- 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
- }
- }
- }
- }
- /*
- * from TaskTagSeeker
- */
- 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) {
- // don't care
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- finally {
- if(contents != null) {
- try {
- contents.close();
- } catch (IOException e1) {
- // not sure how to recover at this point
- }
- }
- }
- }
- return ResourcesPlugin.getEncoding();
- }
-
- /**
- *
- * @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
- }
- setState(S_XML_USEBEAN);
- }
- 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());
- }
- setState(S_XML_SCRIPTLET);
- 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());
- }
- setState(S_XML_EXPRESSION);
- 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());
-
- }
- setState(S_XML_DECLARATION);
- 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$
- // 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(attrValue);
- }
- 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
- TaglibSupport tls = getTaglibSupport();
- if (tls != null) {
- List trackers = tls.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;
- }
-
- /*
- * ** for workaround only
- */
- 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);
- }
-
- 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;
-
- 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)
- javaClassRange = new Position(fOffsetInUserCode + type.length() + 1 + id.length() + 7, className.length()-4);
-
- //---------------------
- // 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);
- }
- }
-
- protected TaglibSupport getTaglibSupport() {
- return (fModelQuery != null && fModelQuery instanceof TaglibModelQuery) ? ((TaglibModelQuery) fModelQuery).getTaglibSupport() : null;
- }
-
- 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 void setRelativeOffset(int fRelativeOffset) {
- this.fRelativeOffset = fRelativeOffset;
- }
-
- final public int getRelativeOffset() {
- return fRelativeOffset;
- }
-
- private void setCursorOwner(StringBuffer fCursorOwner) {
- this.fCursorOwner = fCursorOwner;
- }
-
- final public StringBuffer getCursorOwner() {
- return fCursorOwner;
- }
-
- private IStructuredDocumentRegion setCurrentNode(IStructuredDocumentRegion fCurrentNode) {
- return this.fCurrentNode = fCurrentNode;
- }
-
- final public IStructuredDocumentRegion getCurrentNode() {
- return fCurrentNode;
- }
-
- private void setState(int state) {
- this.stateMask = this.stateMask | state;
- }
- private void unsetState(int state) {
- if(hasState(state))
- this.stateMask = this.stateMask -= state;
- }
- public final boolean hasState(int state) {
- return (this.stateMask & state) == state;
- }
-} \ 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 bf51392d47..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/XMLJSPRegionHelper.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.jst.jsp.core.internal.java;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.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();
- 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 (Exception e) {
- // logging this exception that I've seen a couple of times...
- Logger.logException("XMLJSPRegionHelper: exception in node parsing", e); //$NON-NLS-1$
- }
- }
-
- 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 (beanClass != "") //$NON-NLS-1$
- beanDecl = beanClass + " " + beanId + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$
- else
- beanDecl = beanType + " " + beanId + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$
- 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.getTaglibSupport().getCMDocuments(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$
- this.fTranslator.addImports(importValue);
- }
- }
-
- /*
- * 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 length = 0;
- int count = 0;
- File file = null;
- InputStream is = null;
- try {
- file = new File(fileName);
- length = (int) file.length();
- //is = WorkspaceFileHelper.getFileInputStream(fileName);
- is = new FileInputStream(fileName);
- while (((c = is.read()) >= 0) && (count < length)) {
- 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 7004dfe7c2..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/IndexWorkspaceJob.java
+++ /dev/null
@@ -1,147 +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.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.internal.nls.ResourceHandler;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-
-/**
- * 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 {
- // 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.fInnerMonitor.subTask(proxy.getName());
-
- // don't search deeper for files
- return false;
- }
- }
- }
- return true;
- }
- }
-
- 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(ResourceHandler.getString("JSPIndexManager.0"));
- setPriority(Job.LONG);
- setSystem(true);
- }
-
- IContentType getJspContentType() {
- if(this.fContentTypeJSP == null)
- this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(IContentTypeIdentifier.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 {
- ResourcesPlugin.getWorkspace().getRoot().accept(new JSPFileVisitor(monitor), IResource.DEPTH_INFINITE);
- }
- 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 fb8b9fe13e..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPIndexManager.java
+++ /dev/null
@@ -1,511 +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.text.MessageFormat;
-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.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.Logger;
-import org.eclipse.jst.jsp.core.internal.nls.ResourceHandler;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-
-/**
- * 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;
-
- /**
- * 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()) {
- 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;
-
- // how many files to feed indexmanager at a time
- int BATCH_SIZE = 15;
- // ms delay before checking if it's ok to schedule more docs for indexing
- long DELAY = 200;
-
- ProcessFilesJob(String taskName, IFile[] files) {
- super(taskName);
- this.jspFiles = files;
- }
-
- protected IStatus run(IProgressMonitor monitor) {
-
- if(isCanceled(monitor)) {
- 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$
- IndexManager indexManager = JavaModelManager.getJavaModelManager().getIndexManager();
-
- // either 10 or however many files ther are
- int nextEnd = this.jspFiles.length < BATCH_SIZE ? this.jspFiles.length : BATCH_SIZE;
- int remaining = this.jspFiles.length;
- int i = 0;
-
- while(i<this.jspFiles.length) {
- // if IndexManager can handle more files
- if(indexManager.awaitingJobsCount() == 0) {
- // process a batch of JSP files
- for(; i<nextEnd; i++) {
- if(isCanceled(monitor)) {
- setCanceledState();
- return Status.CANCEL_STATUS;
- }
- try {
- ss.addJspFile(this.jspFiles [i]);
- // JSP Indexer processing n files
- processingNFiles = MessageFormat.format(ResourceHandler.getString("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 (CoreException e) {
- String filename = this.jspFiles[i] != null ? this.jspFiles[i].getFullPath().toString() : ""; //$NON-NLS-1$
- Logger.logException("JSPIndexer problem indexing:" + filename, e); //$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.
- 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 inner for
- remaining = this.jspFiles.length - nextEnd;
- // either add 10 or whatever # of files left
- nextEnd += (remaining < BATCH_SIZE) ? remaining : BATCH_SIZE;
- }
- else {
- try {
- // wait for indexmanager to process the last batch...
- Thread.sleep(DELAY);
- } catch (InterruptedException e) {
- if(DEBUG)
- e.printStackTrace();
- }
- }
- }// end outer while
- }
- 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);
- 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.
- * @param files
- */
- private void processFiles(IFile[] files) {
- // updating JSP Index
- String taskName = ResourceHandler.getString("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(IContentTypeIdentifier.ContentTypeID_JSP);
- return this.fContentTypeJSP;
- }
-} \ 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 20b50782a0..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.wst.common.encoding.content.IContentTypeIdentifier;
-
-/**
- * pa_TODO Still need to take into consideration:
- * - focus in workspace
- * - search pattern
- *
- * @author pavery
- */
-public class JSPPathIndexer {
-
- // 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$
- }
-
- // 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(IContentTypeIdentifier.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 (IContentTypeIdentifier.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 bd13f6d30f..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
+++ /dev/null
@@ -1,217 +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 org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jst.jsp.core.Logger;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-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.IModelManagerPlugin;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.osgi.framework.Bundle;
-
-/**
- * Created with a .jsp file, but should appear to be a .java file for indexing
- * and searching purposes
- *
- * @author pavery
- */
-public class JSPSearchDocument {
-
- private String UNKNOWN_PATH = "**path unknown**"; //$NON-NLS-1$
- private String jspPath = UNKNOWN_PATH; //for debugging
- private IFile fJSPFile = null;
- private JSPTranslationExtension fJSPTranslation = null;
- private SearchParticipant fParticipant = null;
- private String fCUText = null;
- private String fCUPath = UNKNOWN_PATH;
-
- /**
- * @param file
- * @param participant
- * @throws CoreException
- */
- public JSPSearchDocument(IFile file, SearchParticipant participant) throws CoreException {
-
- this.fJSPFile = file;
- this.jspPath = file.getFullPath().toString();
-
- updateJavaInfo(file);
-
- this.fParticipant = participant;
- }
-
- public SearchParticipant getParticipant() {
- return this.fParticipant;
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchDocument#getCharContents()
- */
- public char[] getCharContents() {
- return this.fCUText.toCharArray();
- }
-
- public String getJavaText() {
- return new String(getCharContents());
- }
-
- private IModelManager getModelManager() {
- IModelManager modelManager = null;
- IModelManagerPlugin plugin = null;
- Bundle mmBundle = Platform.getBundle(IModelManagerPlugin.ID);
- int state = mmBundle.getState();
- // I put in check to active bundle to avoid so many
- // exceptions during unit tests ... apparently the search
- // indexing continues, even when being shutdown. We should
- // fix that "root" problem, but I'm not sure where right now.
- // Note: the "active" state assume's we're never called early
- // before already active once.
- if (state == Bundle.ACTIVE) {
- //System.out.println("state: " + state);
- plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- }
- // occassionally, during unit tests, I've seen this return null, I
- // suspect because
- // the workbench is shutting down. So, if we get 'null' back,
- // we'll though relatively CoreException, just to get it logged.
- // and cease processing.
-
- if (plugin == null) {
- Logger.log(Logger.INFO, "ModelManager not available, probably due to shutting down"); //$NON-NLS-1$
- modelManager = new NullModelManager();
- }
- else {
- modelManager = plugin.getModelManager();
- }
- return modelManager;
- }
-
- /**
- * @param file
- * @throws CoreException
- */
- private void updateJavaInfo(IFile file) throws CoreException {
-
- if(!JSPSearchSupport.isJsp(file))
- return;
-
- XMLModel xmlModel = null;
- try {
- // get existing model for read, then get document from it
- xmlModel = (XMLModel) getModelManager().getModelForRead(file);
- // handle unsupported
- if (xmlModel != null) {
- setupAdapterFactory(xmlModel);
- XMLDocument doc = xmlModel.getDocument();
- JSPTranslationAdapter adapter = (JSPTranslationAdapter) doc.getAdapterFor(IJSPTranslation.class);
- this.fJSPTranslation = adapter.getJSPTranslation();
-
- if (this.fJSPTranslation != null) {
- this.fCUText = this.fJSPTranslation.getJavaText();
- this.fCUPath = this.fJSPTranslation.getJavaPath();
- }
- }
- }
- 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();
- }
- }
-
- /**
- * 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() {
- return this.fCUPath != null ? this.fCUPath : UNKNOWN_PATH;
- }
-
- public int getJspOffset(int javaOffset) {
- return this.fJSPTranslation != null ? this.fJSPTranslation.getJspOffset(javaOffset) : 0;
- }
-
- public IFile getFile() {
- return this.fJSPFile;
- }
-
- public void release() {
-
- if (this.fJSPTranslation != null) {
- this.fJSPTranslation.release();
- }
- this.fJSPTranslation = null;
- }
-
- public JSPTranslationExtension getJspTranslation() {
- return this.fJSPTranslation;
- }
-
- /**
- * for debugging
- */
- public String toString() {
- return "[JSPSearchDocument:" + this.jspPath + "(CU:" + this.fCUPath + ")]"; //$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 7531b82ac8..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchParticipant.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.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 = null;
- // ignore anything but .java matches (like .class binary matches)
- if(documentPath.endsWith(".java")) { //$-NON-NLS-1$
- sDoc = JSPSearchSupport.getInstance().getSearchDocument(documentPath);
- // can be null if there was a bad index entry (the .jsp file referenced doesn't exist anymore)
- }
- else {
- // we only care about .java
- // 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 30a78ca07b..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchScope.java
+++ /dev/null
@@ -1,137 +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;
- }
-
- private boolean enclosesElement(IJavaElement possible) {
-
- IJavaElement[] elements = (IJavaElement[]) fJavaElements.toArray(new IJavaElement[fJavaElements.size()]);
- for (int i = 0; i < elements.length; i++) {
- // pa_TODO need logic here to check if element here encloses possible...
- 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 134c4134c7..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchSupport.java
+++ /dev/null
@@ -1,511 +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.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.Logger;
-import org.eclipse.jst.jsp.core.internal.java.JSP2ServletNameUtil;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-
-/**
- * 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("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
- DEBUG= value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private static JSPSearchSupport fSingleton = null;
- private JSPSearchParticipant fParticipant = null;
-
- private IPath fJSPPluginLocation = null;
- // future_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 (fSingleton == null)
- fSingleton = new JSPSearchSupport();
- return fSingleton;
- }
-
- /**
- * 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(IContentTypeIdentifier.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 && IContentTypeIdentifier.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) throws CoreException {
-
- 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)) {
- try {
- delegate = new JavaSearchDocumentDelegate(new JSPSearchDocument(jspFile, getSearchParticipant()));
- } catch (CoreException e) {
- if(DEBUG)
- Logger.logException(e);
- }
- }
- 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];
-
- String filePath = JSP2ServletNameUtil.unmangle(classname);
-
- IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(filePath));
- 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 50402a296b..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/nls/ResourceHandler.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/nls/ResourceHandler.java
deleted file mode 100644
index 817d96ffab..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/nls/ResourceHandler.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.nls;
-
-
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ResourceHandler {
-
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("ModelsJSP");//$NON-NLS-1$
- }
- catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- }
- catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
- else {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- }
- catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-
- public static String getString(String key, Object[] args, int x) {
-
- return getString(key);
- }
-} \ No newline at end of file
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 cf8acf7518..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.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.jst.jsp.core.internal.parser;
-
-
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-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) {
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- if (plugin != null) {
- IModelManager mmanager = plugin.getModelManager();
- fBlockNodeChecker = mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_JSP).getParser();
- }
- else
- fBlockNodeChecker = new JSPSourceParser();
- }
- 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 f668c689f5..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/internal/JSPTokenizer.java
+++ /dev/null
@@ -1,3589 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 9/27/04 1:09 AM */
-
-/*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.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 9/27/04 1:09 AM from the specification file
- * <tt>file:/D:/eclipse.rad/workspace.rad/com.ibm.sse.model/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.1 2004/11/23 19:11:04 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()!
- */
- private 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 e3d9ea4c38..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java
+++ /dev/null
@@ -1,544 +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 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 {
-
- public final static String ST_DEFAULT_JSP = "org.eclipse.jst.jsp.DEFAULT_JSP"; //$NON-NLS-1$
- public final static String ST_JSP_DEFAULT_EL = "org.eclipse.jst.jsp.JSP_DEFAULT_EL"; //$NON-NLS-1$
- public final static String ST_JSP_DIRECTIVE = "org.eclipse.jst.jsp.JSP_DIRECTIVE"; //$NON-NLS-1$
- public final static String ST_JSP_CONTENT_DELIMITER = "org.eclipse.jst.jsp.JSP_CONTENT_DELIMITER"; //$NON-NLS-1$
- public final static String ST_JSP_CONTENT_JAVA = "org.eclipse.jst.jsp.JSP_CONTENT_JAVA"; //$NON-NLS-1$
- public final static String ST_JSP_CONTENT_JAVASCRIPT = "org.eclipse.jst.jsp.JSP_CONTENT_JAVASCRIPT"; //$NON-NLS-1$
- public final static String ST_JSP_COMMENT = "org.eclipse.jst.jsp.JSP_COMMENT"; //$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};
-
- static final boolean debugPrefixListener = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/partitioner/prefixlistener"));
-
-
- /**
- * 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 IStructuredTextPartitioner fEmbeddedPartitioner = null;
-
- // 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 PrefixListener fPrefixParseListener;
- private static final String HTML_CONTENT_TYPE = "text/html"; //$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$
-
- /**
- * @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);
- }
-
- 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 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;
- }
-
- 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);
- }
- }
- }
-
- /**
- * 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);
- }
- }
-
- 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);
- }
-
- private List getLocalLegalContentTypes() {
- List types = new ArrayList();
- Object[] configuredTypes = getConfiguredContentTypes();
- for (int i = 0; i < configuredTypes.length; i++)
- types.add(configuredTypes[i]);
- return types;
- }
-
- /**
- * @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;
- }
-
- /**
- * @return
- */
- private String getPartitionTypeForDocumentLanguage() {
- String result;
- // nsd_TODO: make more dynamic
- if (fLanguage == null) {
- result = ST_JSP_CONTENT_JAVA;
- }
- else if (fLanguage.equalsIgnoreCase("javascript")) { //$NON-NLS-1$
- result = ST_JSP_CONTENT_JAVASCRIPT;
- }
- else if (fLanguage.equalsIgnoreCase("java")) { //$NON-NLS-1$
- result = ST_JSP_CONTENT_JAVA;
- }
- else {
- result = getUnknown();
- }
- return result;
- }
-
- 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;
- }
-
- /**
- * @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;
- }
-
- /**
- * @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);
- }
-
- public String getDefault() {
- return getEmbeddedPartitioner().getDefault();
- }
-
- 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;
-
- }
-
- /**
- * Returns the language.
- *
- * @return String
- */
- public String getLanguage() {
- return fLanguage;
- }
-
- /**
- * Sets the language.
- *
- * @param language
- * The language to set
- */
- public void setLanguage(String language) {
- this.fLanguage = language;
- }
-
- /**
- * @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);
- }
- }
-
- /**
- * @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);
-
- }
-
- /**
- * @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();
- }
-
- /**
- * Returns the embeddedPartitioner.
- *
- * @return IStructuredTextPartitioner
- */
- public IStructuredTextPartitioner getEmbeddedPartitioner() {
- if (fEmbeddedPartitioner == null) {
- fEmbeddedPartitioner = createStructuredTextPartitioner(structuredDocument);
- fEmbeddedPartitioner.connect(structuredDocument);
- }
-
- return fEmbeddedPartitioner;
- }
-
- protected String getPartitionType(ForeignRegion region, int offset) {
- return getEmbeddedPartitioner().getPartitionType(region, offset);
- }
-
- /**
- * 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);
- }
- }
-
- public IDocumentPartitioner newInstance() {
- StructuredTextPartitionerForJSP instance = new StructuredTextPartitionerForJSP();
- instance.setEmbeddedPartitioner(createStructuredTextPartitioner(structuredDocument));
- instance.setLanguage(fLanguage);
- return instance;
- }
-
- /**
- * @return
- */
- public static String[] getConfiguredContentTypes() {
- return fConfiguredContentTypes;
- }
-
-} \ 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 48ed72846a..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.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.modelhandler;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.document.PageDirectiveAdapterFactory;
-import org.eclipse.jst.jsp.core.document.PageDirectiveWatcherFactory;
-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.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.common.encoding.content.IContentTypeIdentifier;
-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.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
- if (newEmbeddedContentType.getFamilyId().equals(IContentTypeIdentifier.ContentTypeID_SSEXML)) {
- ((StructuredTextPartitionerForJSP) structuredDocument.getDocumentPartitioner()).setEmbeddedPartitioner(new StructuredTextPartitionerForXML());
- }
- else if (newEmbeddedContentType.getFamilyId().equals(IContentTypeIdentifier.ContentTypeID_HTML)) {
- ((StructuredTextPartitionerForJSP) structuredDocument.getDocumentPartitioner()).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 8065d042ed..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.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.document.DocumentLoaderForJSP;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector;
-import org.eclipse.jst.jsp.core.encoding.JSPDocumentLoader;
-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 adf551c218..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAdapterImpl.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.jst.jsp.core.modelquery;
-
-
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TaglibSupport;
-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 {
-
- TaglibSupport support = null;
-
- public JSPModelQueryAdapterImpl(CMDocumentCache cmDocumentCache, ModelQuery modelQuery, TaglibSupport support, IdResolver idResolver) {
- super(cmDocumentCache, modelQuery, idResolver);
- this.support = support;
- }
-
- public void release() {
- super.release();
- if (support != null)
- support.setStructuredDocument(null);
- }
-
- /**
- * @see com.ibm.sse.model.modelquery.ModelQueryAdapter#setIdResolver(IdResolver)
- */
- public void setIdResolver(IdResolver newIdResolver) {
- super.setIdResolver(newIdResolver);
- // new location, everything's stale unless the model's been rebuilt
- support.clearCMDocumentCache();
- }
-
-} \ 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 2b62aaad87..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryAssociationProvider.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.modelquery;
-
-
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TaglibSupport;
-import org.eclipse.wst.common.contentmodel.modelqueryimpl.SimpleAssociationProvider;
-
-/**
- */
-public class JSPModelQueryAssociationProvider extends SimpleAssociationProvider {
-
- /**
- * @param modelQueryCMProvider org.eclipse.wst.common.contentmodel.modelquery.ModelQueryCMProvider
- */
- public JSPModelQueryAssociationProvider(TaglibSupport support) {
- super(new JSPModelQueryCMProvider(support));
- }
-} \ 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 a14d84cf6d..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryCMProvider.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.modelquery;
-
-
-
-import java.util.List;
-
-import org.eclipse.jst.jsp.core.contentmodel.JSPCMDocumentFactory;
-import org.eclipse.jst.jsp.core.contentmodel.tld.TaglibSupport;
-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.sse.core.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * CMDocument provider for HTML and JSP documents.
- */
-public class JSPModelQueryCMProvider implements ModelQueryCMProvider {
-
- protected TaglibSupport fTaglibSupport = null;
-
- protected JSPModelQueryCMProvider() {
- super();
- }
-
- public JSPModelQueryCMProvider(TaglibSupport taglibSupport) {
- fTaglibSupport = taglibSupport;
- }
-
- /**
- * 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;
- }
- }
-
- if (result == null && fTaglibSupport != null && node instanceof IndexedRegion) {
- // check position dependent
- IndexedRegion indexedNode = (IndexedRegion) node;
- List documents = fTaglibSupport.getCMDocuments(node.getPrefix(), indexedNode.getStartOffset());
- 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 4cdf4e5f3c..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/JSPModelQueryImpl.java
+++ /dev/null
@@ -1,136 +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.jst.jsp.core.contentmodel.tld.TaglibSupport;
-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.sse.core.modelquery.MovableModelQuery;
-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 implements MovableModelQuery, TaglibModelQuery {
-
- protected IStructuredModel jspModel = null;
- protected ModelQuery embeddedModelQuery = null;
- protected TaglibSupport fTaglibSupport = null;
-
- public JSPModelQueryImpl(IStructuredModel model, TaglibSupport support, IdResolver resolver) {
- super(new JSPModelQueryAssociationProvider(support));
- fTaglibSupport = support;
- 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;
- }
-
- public TaglibSupport getTaglibSupport() {
- return fTaglibSupport;
- }
-
- /**
- * @see MovableModelQuery#setIdResolver(IdResolver)
- */
- public void setIdResolver(IdResolver newIdResolver) {
- getTaglibSupport().clearCMDocumentCache();
- }
-
- /* (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 d381b702cf..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/ModelQueryAdapterFactoryForJSP.java
+++ /dev/null
@@ -1,237 +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.core.runtime.Platform;
-import org.eclipse.jst.jsp.core.contentmodel.tld.URIResolverProvider;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.DeferredTaglibSupport;
-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.IModelLifecycleListener;
-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.ModelLifecycleEvent;
-import org.eclipse.wst.sse.core.modelquery.ModelQueryAdapter;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.util.Debug;
-import org.eclipse.wst.sse.core.util.URIResolver;
-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 {
-
- /**
- * This class ensures that the tabligSupport field is always connected to
- * the correct IDocument, should the IDocument in the Structured Model
- * change.
- */
- protected class TaglibSupportModelLifecycleListener implements IModelLifecycleListener {
- // had to change to 'false' when implicit job support added.
- // somehow, during document.set("") the wrong rule was in effect.
- // of course, we shouldn't being doing document set anyway, so
- // would like to re-consider. (may not need for V6, with other
- // workarounds in place?)
- private static final boolean doForceReloadOnDocumentChange = false;
-
- public TaglibSupportModelLifecycleListener() {
- if (stateNotifier != null) {
- setDocument(stateNotifier.getStructuredDocument());
- }
- }
-
- private void clearDocumentInformation() {
- if (taglibSupport != null) {
- taglibSupport.setStructuredDocument(null);
- taglibSupport.clearCMDocumentCache();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelLifecycleListener#processPostModelEvent(com.ibm.sse.model.ModelLifecycleEvent)
- */
- public void processPostModelEvent(ModelLifecycleEvent event) {
- if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
-// DocumentChanged documentChangedEvent = (DocumentChanged) event;
-// IDocument oldDoc = documentChangedEvent.getOldDocument();
-// IDocument newDoc = documentChangedEvent.getNewDocument();
-// IDocument debugDoc = event.getModel().getStructuredDocument();
- setDocument(event.getModel().getStructuredDocument());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.model.IModelLifecycleListener#processPreModelEvent(com.ibm.sse.model.ModelLifecycleEvent)
- */
- public void processPreModelEvent(ModelLifecycleEvent event) {
- if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) {
- clearDocumentInformation();
- }
- }
-
- /**
- * @param event
- */
- private void setDocument(IStructuredDocument document) {
- if (taglibSupport != null) {
- taglibSupport.setStructuredDocument(document);
- // force the reparsing of the IDocument so that taglibs
- // can be recorded and enabled; while this is expensive,
- // the lack of control over document and model creation
- // makes it necessary
- if (doForceReloadOnDocumentChange && document.getLength() > 0) {
- String contents = document.get();
- // don't allow any optimizations to be used
- document.set(""); //$NON-NLS-1$
- document.set(contents);
- }
- }
- }
- }
-
- protected TaglibSupportModelLifecycleListener fTaglibSupportModelLifecycleListener = null;
-
- protected JSPModelQueryAdapterImpl modelQueryAdapterImpl;
-
- // delay providing a URIResolver to the taglib support
- protected URIResolverProvider resolverProvider = new URIResolverProvider() {
- public URIResolver getResolver() {
- if (stateNotifier != null)
- return stateNotifier.getResolver();
- return null;
- }
- };
- protected IStructuredModel stateNotifier = null;
- protected DeferredTaglibSupport taglibSupport = null;
-
- static final boolean _debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/taglibsupport")); //$NON-NLS-1$ //$NON-NLS-2$
-
- public ModelQueryAdapterFactoryForJSP() {
- this(ModelQueryAdapter.class, true);
- }
-
- /**
- * ModelQueryAdapterFactoryForJSP constructor comment.
- *
- * @param adapterKey
- * java.lang.Object
- * @param registerAdapters
- * boolean
- */
- public ModelQueryAdapterFactoryForJSP(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, 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();
- stateNotifier.addModelStateListener(this);
- CMDocumentCache cmDocumentCache = new CMDocumentCache();
- IdResolver resolver = new XMLCatalogIdResolver(model.getBaseLocation(), model.getResolver());
-
- // connect the taglib support package to this model, deferring
- // the URIResolver requirement
- taglibSupport = new DeferredTaglibSupport();
- taglibSupport.setStructuredDocument(model.getStructuredDocument());
- taglibSupport.setResolverProvider(resolverProvider);
- fTaglibSupportModelLifecycleListener = new TaglibSupportModelLifecycleListener();
- model.addModelLifecycleListener(fTaglibSupportModelLifecycleListener);
-
- ModelQuery modelQuery = new JSPModelQueryImpl(model, taglibSupport, resolver);
- modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
- modelQueryAdapterImpl = new JSPModelQueryAdapterImpl(cmDocumentCache, modelQuery, taglibSupport, resolver);
- if(_debug) {
- System.out.println("ModelQueryAdapterFactoryForJSP.createAdapter registered Taglib Support for model with ID " + model.getId() + " at " + model.getBaseLocation()); //$NON-NLS-2$ //$NON-NLS-1$
- }
- }
- }
- 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) {
- /**
- * The taglib support will automatically use the new one, so trigger a
- * reparse
- */
- modelQueryAdapterImpl.setIdResolver(new XMLCatalogIdResolver(model.getBaseLocation(), model.getResolver()));
- fTaglibSupportModelLifecycleListener.setDocument(model.getStructuredDocument());
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/TaglibModelQuery.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/TaglibModelQuery.java
deleted file mode 100644
index 6793869f60..0000000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelquery/TaglibModelQuery.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.modelquery;
-
-
-
-import org.eclipse.jst.jsp.core.contentmodel.tld.TaglibSupport;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-
-public interface TaglibModelQuery extends ModelQuery {
-
- TaglibSupport getTaglibSupport();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/.classpath b/bundles/org.eclipse.wst.css.ui/.classpath
deleted file mode 100644
index df094ee4a7..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.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.ui/.compatibility b/bundles/org.eclipse.wst.css.ui/.compatibility
deleted file mode 100644
index 6fcfaf32fb..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.compatibility
+++ /dev/null
@@ -1,2 +0,0 @@
-#Wed Mar 24 13:53:52 EST 2004
-.project=3769
diff --git a/bundles/org.eclipse.wst.css.ui/.cvsignore b/bundles/org.eclipse.wst.css.ui/.cvsignore
deleted file mode 100644
index 4295133bac..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-csseditor.jar
-temp.folder
-build.xml
-dev.properties
-bin
diff --git a/bundles/org.eclipse.wst.css.ui/.project b/bundles/org.eclipse.wst.css.ui/.project
deleted file mode 100644
index d42035fc37..0000000000
--- a/bundles/org.eclipse.wst.css.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.css.ui</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.ui/build.properties b/bundles/org.eclipse.wst.css.ui/build.properties
deleted file mode 100644
index 07de39b935..0000000000
--- a/bundles/org.eclipse.wst.css.ui/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,\
- icons/,\
- plugin.properties
-src.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- build.xml,\
- build.properties,\
- README.txt
-source.csseditor.jar = src/
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif
deleted file mode 100644
index df1704e435..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif
deleted file mode 100644
index 7c050f5090..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif
deleted file mode 100644
index 0e93844d92..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif
deleted file mode 100644
index f924d7a684..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif
deleted file mode 100644
index 5ca230b289..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif
deleted file mode 100644
index 2133ded0bd..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif
deleted file mode 100644
index ede58abb89..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif
deleted file mode 100644
index 6cd12dada0..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif
deleted file mode 100644
index 2adbdd83b2..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif
deleted file mode 100644
index 308a3ae841..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif
deleted file mode 100644
index aca5f8920b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif
deleted file mode 100644
index 71f59e8b7a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif
deleted file mode 100644
index f0857d284f..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif
deleted file mode 100644
index 94d89cd59e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif
deleted file mode 100644
index d85b78f29d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif
deleted file mode 100644
index 3391f19bee..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif
deleted file mode 100644
index 920c228d4a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif
deleted file mode 100644
index 525f64bc57..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif
deleted file mode 100644
index 6b635b03d8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif
deleted file mode 100644
index 1b6a6dc6aa..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b11c..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif
deleted file mode 100644
index 3176ff8c5c..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif
deleted file mode 100644
index d8fde00545..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif
deleted file mode 100644
index bcc76cd635..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif
deleted file mode 100644
index 69850faf9a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif
deleted file mode 100644
index abf63f8568..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif
deleted file mode 100644
index 99a8b96f98..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif
deleted file mode 100644
index 857e4e50ee..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif b/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif
deleted file mode 100644
index c1a8b34ed8..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.css.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.css.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.properties b/bundles/org.eclipse.wst.css.ui/plugin.properties
deleted file mode 100644
index 93720fea0a..0000000000
--- a/bundles/org.eclipse.wst.css.ui/plugin.properties
+++ /dev/null
@@ -1,18 +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
-###############################################################################
-SSE_CSS_Source_Editor.name=SSE CSS Source Editor
-SSE_CSS_Source_Editor_NL_Support.name=SSE CSS Source Editor NL Support
-CSS_Source_Page_Editor.name=CSS Source Page Editor
-CSS_Files.name=CSS Files
-CSS_Source.name=CSS Source
-CSS_Styles.name=CSS Styles
-CSS_Annotations.name=CSS Annotations
-WebContentSettings.name=Web Content Settings
diff --git a/bundles/org.eclipse.wst.css.ui/plugin.xml b/bundles/org.eclipse.wst.css.ui/plugin.xml
deleted file mode 100644
index 1320352b51..0000000000
--- a/bundles/org.eclipse.wst.css.ui/plugin.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.css.ui"
- name="%SSE_CSS_Source_Editor.name"
- version="1.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.wst.css.ui.CSSEditorPlugin">
-
- <runtime>
- <library name="csseditor.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.views"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.ui.editors"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.wst.xml.ui"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.css.core"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- <import plugin="org.eclipse.wst.common.contentmodel"/>
- <import plugin="org.eclipse.wst.html.core"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.common.encoding"/>
- </requires>
-
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%CSS_Source_Page_Editor.name"
- icon="icons/sourceEditor.gif"
- extensions="css"
- contributorClass="org.eclipse.wst.css.ui.ActionContributorCSS"
- class="org.eclipse.wst.css.ui.StructuredTextEditorCSS"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.css.ui.StructuredTextEditorCSS">
- </editor>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.extendedconfiguration">
- <contentoutlineconfiguration
- class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
- target="org.eclipse.wst.css.core.csssource">
- </contentoutlineconfiguration>
- <textviewerconfiguration
- class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
- target="org.eclipse.wst.css.core.csssource">
- </textviewerconfiguration>
- <propertysheetconfiguration
- class="org.eclipse.wst.css.ui.views.properties.CSSPropertySheetConfiguration"
- target="org.eclipse.wst.css.core.csssource">
- </propertysheetconfiguration>
- <characterpairmatcher
- class="org.eclipse.wst.css.ui.text.CSSDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.css.core.csssource">
- </characterpairmatcher>
- <preferencepages
- preferenceids="org.eclipse.wst.sse.ui.preferences/org.eclipse.wst.sse.ui.preferences.css"
- target="org.eclipse.wst.css.core.csssource">
- </preferencepages>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.css.ui.registry.AdapterFactoryProviderCSS">
- <contentType id="org.eclipse.wst.css.core.csssource"/>
- </adapterFactoryDescription>
- </extension>
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.css.core.csssource"
- class="org.eclipse.wst.sse.ui.StructuredResourceMarkerAnnotationModelFactory"/>
- </extension>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- name="%CSS_Files.name"
- category="org.eclipse.wst.sse.ui.preferences"
- class="org.eclipse.wst.css.ui.preferences.ui.CSSFilesPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.css">
- </page>
- <page
- name="%CSS_Source.name"
- category="org.eclipse.wst.sse.ui.preferences.css"
- class="org.eclipse.wst.css.ui.preferences.ui.CSSSourcePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.css.source">
- </page>
- <page
- name="%CSS_Styles.name"
- category="org.eclipse.wst.sse.ui.preferences.css"
- class="org.eclipse.wst.css.ui.preferences.ui.CSSColorPage"
- id="org.eclipse.wst.sse.ui.preferences.css.styles">
- </page>
- </extension>
- <extension
- point="org.eclipse.ui.propertyPages">
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.css"
- class="org.eclipse.wst.css.ui.contentproperties.ui.CSSContentSettingsPropertyPage"
- id="org.eclipse.wst.css.ui.csspropertypage">
- </page>
- </extension>
-<!-- Editor actionsets -->
- <extension
- point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part
- id="org.eclipse.wst.css.ui.StructuredTextEditorCSS">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part
- id="org.eclipse.wst.css.ui.StructuredTextEditorCSS">
- </part>
- </actionSetPartAssociation>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.css.ui/src/EditingCSS.properties b/bundles/org.eclipse.wst.css.ui/src/EditingCSS.properties
deleted file mode 100644
index 2fa1626e12..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/EditingCSS.properties
+++ /dev/null
@@ -1,50 +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
-###############################################################################
-
-INFO_Not_Categorized_1=Not Categorized
-
-## CSS Preferences -- source ##
-PrefsLabel.WrappingWithoutAttr=Disable wrapping in style &attribute of HTML
-PrefsLabel.WrappingInsertLineBreak=Insert &line break between properties
-
-PrefsLabel.CaseGroup=Capitalization style
-PrefsLabel.CaseIdent=Identifier:
-PrefsLabel.CasePropName=Property name:
-PrefsLabel.CasePropValue=Property value:
-
-PrefsLabel.CaseIdentUpper=&Uppercase
-PrefsLabel.CaseIdentLower=L&owercase
-PrefsLabel.CasePropNameUpper=U&ppercase
-PrefsLabel.CasePropNameLower=Lo&wercase
-PrefsLabel.CasePropValueUpper=Upp&ercase
-PrefsLabel.CasePropValueLower=Lowe&rcase
-
-## CSS Preferences -- color ##
-
-## The following line is a sample CSS document. Please translate only the following parts:
-## Sample Styles
-PrefsLabel.ColorSample=@import url("../sample2.css");\n\n/* Sample Styles */\n\nBODY {\n\tcolor : black;\n\tbackground-color : rgb(181, 253, 211);\n\ttext-align : center;\n\tfont-family : "Heisei Mincho W3", serif\n}\n\n@page :left { margin-left : 4cm }\n\n@media aural {\n\tP.heidi {\n\t\tazimuth : center-left;\n\t\televation : 12.3deg;\n\t\tpause : 30ms 1.6s\n\t}\n}\n
-
-PrefsLabel.ColorNormal=Default
-PrefsLabel.ColorAtmarkRule=At-Rule
-PrefsLabel.ColorSelector=Selector
-PrefsLabel.ColorMedia=Media Name
-PrefsLabel.ColorComment=Comment
-PrefsLabel.ColorPropertyName=Property Name
-PrefsLabel.ColorPropertyValue=Property Value
-PrefsLabel.ColorUri=URI
-PrefsLabel.ColorString=Quoted String
-PrefsLabel.ColorColon=Property Delimiter
-PrefsLabel.ColorSemiColon=SemiColon
-PrefsLabel.ColorCurlyBrace=Curly Brace
-PrefsLabel.ColorError=Error
-#
-SortAction.0=Sort
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java
deleted file mode 100644
index 3f6861c093..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java
+++ /dev/null
@@ -1,118 +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.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.sse.ui.edit.util.ActionContributor;
-import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-
-/**
- * ActionContributorCSS
- *
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- *
- * Instead, use SourcePageActionContributor for source page contributor of
- * multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorCSS extends ActionContributor {
- private static final String[] EDITOR_IDS = {"org.eclipse.wst.css.ui.StructuredTextEditorCSS", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- protected RetargetTextEditorAction fContentAssist = null;
- protected RetargetTextEditorAction fCleanupDocument = null;
- protected MenuManager fFormatMenu = null;
- protected RetargetTextEditorAction fFormatDocument = null;
- protected RetargetTextEditorAction fFormatActiveElements = null;
-
- public ActionContributorCSS() {
- super();
-
- ResourceBundle resourceBundle = ResourceHandler.getResourceBundle();
-
- // edit commands
- fContentAssist = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
-
- // source commands
- fCleanupDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fCleanupDocument.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
-
- fFormatDocument = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFormatDocument.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
-
- fFormatActiveElements = new RetargetTextEditorAction(resourceBundle, ""); //$NON-NLS-1$
- fFormatActiveElements.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
-
- fFormatMenu = new MenuManager(ResourceHandler.getString("FormatMenu.label")); //$NON-NLS-1$
- fFormatMenu.add(fFormatDocument);
- fFormatMenu.add(fFormatActiveElements);
- }
-
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-
- protected void addToMenu(IMenuManager menu) {
- // edit commands
- IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- editMenu.add(fCommandsSeparator);
- editMenu.add(fToggleInsertModeAction);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fExpandSelectionToMenu);
- editMenu.add(fCommandsSeparator);
- editMenu.add(fContentAssist);
- editMenu.add(fMenuAdditionsGroupMarker);
- }
-
- // source commands
- String sourceMenuLabel = ResourceHandler.getString("SourceMenu.label"); //$NON-NLS-1$
- String sourceMenuId = "sourceMenuId"; // This is just a menu id. No
- // need to translate.
- // //$NON-NLS-1$
- IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, sourceMenu);
- if (sourceMenu != null) {
- sourceMenu.add(fCommandsSeparator);
- sourceMenu.add(fShiftRight);
- sourceMenu.add(fShiftLeft);
- sourceMenu.add(fCleanupDocument);
- sourceMenu.add(fFormatMenu);
- sourceMenu.add(fCommandsSeparator);
- }
- }
-
- public void setActiveEditor(IEditorPart activeEditor) {
- super.setActiveEditor(activeEditor);
-
- ITextEditor textEditor = getTextEditor(activeEditor);
-
- fContentAssist.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS));
-
- fCleanupDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT));
- fFormatDocument.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT));
- fFormatActiveElements.setAction(getAction(textEditor, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/CSSEditorPlugin.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/CSSEditorPlugin.java
deleted file mode 100644
index fba4083373..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/CSSEditorPlugin.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.wst.css.ui;
-
-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.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.css.ui.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.ColorHelper;
-
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CSSEditorPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.css.ui"; //$NON-NLS-1$
- //The shared instance.
- private static CSSEditorPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public CSSEditorPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.css.ui.CSSEditorPluginResources"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- // reference the preference store so
- // initializeDefaultPreferences(IPreferenceStore preferenceStore) is
- // called
- getPreferenceStore();
- }
-
- /**
- * Returns the shared instance.
- */
- public static CSSEditorPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns the string from the plugin's resource bundle, or 'key' if not
- * found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = CSSEditorPlugin.getDefault().getResourceBundle();
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- protected void initializeDefaultPreferences(IPreferenceStore store) {
-
- // ignore this preference store
- // use EditorPlugin preference store
- IPreferenceStore editorStore = ((AbstractUIPlugin) Platform.getPlugin(EditorPlugin.ID)).getPreferenceStore();
- EditorPlugin.initializeDefaultEditorPreferences(editorStore);
-
- initializeDefaultCSSPreferences(editorStore);
- }
-
- private void initializeDefaultCSSPreferences(IPreferenceStore store) {
- String ctId = IContentTypeIdentifier.ContentTypeID_CSS;
-
- // CSS Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.NORMAL, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.ATMARK_RULE, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.SELECTOR, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(42, 0, 225) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.MEDIA, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.COMMENT, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.PROPERTY_NAME, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(42, 0, 225) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.PROPERTY_VALUE, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.URI, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.STRING, ctId), styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.COLON, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.SEMI_COLON, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.CURLY_BRACE, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(191, 63, 63) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsCSS.ERROR, ctId), styleValue);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java
deleted file mode 100644
index a929d5376d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java
+++ /dev/null
@@ -1,60 +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.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.css.ui.edit.ui.CleanupActionCSS;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.css.ui.internal.selection.StructureSelectEnclosingCSSAction;
-import org.eclipse.wst.css.ui.internal.selection.StructureSelectNextCSSAction;
-import org.eclipse.wst.css.ui.internal.selection.StructureSelectPreviousCSSAction;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.internal.selection.StructureSelectHistoryAction;
-
-
-public class StructuredTextEditorCSS extends StructuredTextEditor {
- protected void createActions() {
- super.createActions();
-
- ResourceBundle resourceBundle = ResourceHandler.getResourceBundle();
-
- Action action = new CleanupActionCSS(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT + DOT, this);
- action.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT, action);
-
- SelectionHistory selectionHistory = new SelectionHistory(this);
- action = new StructureSelectEnclosingCSSAction(this, selectionHistory);
- action.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_ENCLOSING);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_ENCLOSING, action);
-
- action = new StructureSelectNextCSSAction(this, selectionHistory);
- action.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_NEXT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_NEXT, action);
-
- action = new StructureSelectPreviousCSSAction(this, selectionHistory);
- action.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_PREVIOUS);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_PREVIOUS, action);
-
- action = new StructureSelectHistoryAction(this, selectionHistory);
- action.setActionDefinitionId(ActionDefinitionIds.STRUCTURE_SELECT_HISTORY);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_STRUCTURE_SELECT_HISTORY, action);
- selectionHistory.setHistoryAction((StructureSelectHistoryAction) action);
- }
-
- protected void initializeEditor() {
- super.initializeEditor();
- setHelpContextId(IHelpContextIds.CSS_SOURCEVIEW_HELPID);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
deleted file mode 100644
index dbc1089cc4..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
+++ /dev/null
@@ -1,125 +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.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.css.core.format.FormatProcessorCSS;
-import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS;
-import org.eclipse.wst.css.ui.autoedit.StructuredAutoEditStrategyCSS;
-import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.css.ui.style.LineStyleProviderForCSS;
-import org.eclipse.wst.css.ui.taginfo.CSSBestMatchHoverProcessor;
-import org.eclipse.wst.sse.core.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.style.IHighlighter;
-import org.eclipse.wst.sse.ui.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.taginfo.ProblemAnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.util.EditorUtility;
-
-public class StructuredTextViewerConfigurationCSS extends StructuredTextViewerConfiguration {
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.StructuredTextViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer)
- */
- public Map getAutoEditStrategies(ISourceViewer sourceViewer) {
- Map result = super.getAutoEditStrategies(sourceViewer);
-
- if (result.get(StructuredTextPartitionerForCSS.ST_STYLE) == null)
- result.put(StructuredTextPartitionerForCSS.ST_STYLE, new ArrayList(1));
-
- IAutoEditStrategy autoEditStrategy = new StructuredAutoEditStrategyCSS();
- List strategies = (List) result.get(StructuredTextPartitionerForCSS.ST_STYLE);
- strategies.add(autoEditStrategy);
-
- return result;
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (configuredContentTypes == null) {
- configuredContentTypes = new String[]{StructuredTextPartitionerForCSS.ST_STYLE, StructuredTextPartitioner.ST_DEFAULT_PARTITION, StructuredTextPartitioner.ST_UNKNOWN_PARTITION};
- }
- return configuredContentTypes;
- }
-
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- IContentAssistant contentAssistant = super.getContentAssistant(sourceViewer);
-
- if (contentAssistant != null && contentAssistant instanceof ContentAssistant) {
- //((ContentAssistant)
- // contentAssistant).setContentAssistProcessor(new
- // CSSContentAssistProcessor(),
- // StructuredTextPartitionerForCSS.ST_STYLE);
- IContentAssistProcessor cssProcessor = new CSSContentAssistProcessor();
- addContentAssistProcessor((ContentAssistant) contentAssistant, cssProcessor, StructuredTextPartitionerForCSS.ST_STYLE);
- addContentAssistProcessor((ContentAssistant) contentAssistant, cssProcessor, StructuredTextPartitioner.ST_UNKNOWN_PARTITION);
- }
-
- return contentAssistant;
- }
-
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), StructuredTextPartitionerForCSS.ST_STYLE);
-
- formatter.setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorCSS()));
-
- return formatter;
- }
-
- public IHighlighter getHighlighter(ISourceViewer sourceViewer) {
- IHighlighter highlighter = super.getHighlighter(sourceViewer);
-
- if (highlighter != null) {
- highlighter.addProvider(StructuredTextPartitionerForCSS.ST_STYLE, new LineStyleProviderForCSS());
- }
-
- return highlighter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTextHover(org.eclipse.jface.text.source.ISourceViewer,
- * java.lang.String, int)
- */
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- // content type does not really matter since only combo, problem,
- // annotation hover is available
- TextHoverManager.TextHoverDescriptor[] hoverDescs = EditorPlugin.getDefault().getTextHoverManager().getTextHovers();
- int i = 0;
- while (i < hoverDescs.length) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
- return new CSSBestMatchHoverProcessor();
- else if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
- return new ProblemAnnotationHoverProcessor();
- else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
- return new AnnotationHoverProcessor();
- }
- i++;
- }
- return super.getTextHover(sourceViewer, contentType, stateMask);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java
deleted file mode 100644
index de3b80885d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.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.wst.css.ui.autoedit;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.core.util.RegionIterator;
-import org.eclipse.wst.css.ui.internal.Logger;
-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.ui.edit.util.BasicAutoEditStrategy;
-
-public class StructuredAutoEditStrategyCSS extends BasicAutoEditStrategy {
- protected IStructuredDocument structuredDocument = null;
-
- class CompoundRegion {
-
- CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) {
- super();
- this.documentRegion = documentRegion;
- this.textRegion = textRegion;
- }
-
- IStructuredDocumentRegion getDocumentRegion() {
- return documentRegion;
- }
-
- ITextRegion getTextRegion() {
- return textRegion;
- }
-
- int getStart() {
- return textRegion.getStart();
- }
-
- int getEnd() {
- return textRegion.getEnd();
- }
-
- String getType() {
- return textRegion.getType();
- }
-
- String getText() {
- return documentRegion.getText(textRegion);
- }
-
- int getStartOffset() {
- return documentRegion.getStartOffset(textRegion);
- }
-
- int getEndOffset() {
- return documentRegion.getEndOffset(textRegion);
- }
-
- private IStructuredDocumentRegion documentRegion;
- private ITextRegion textRegion;
-
- }
-
- /**
- */
- protected void autoIndentAfterClose(DocumentCommand command, String regionType) {
- if (!setRangeForClose(command))
- return;
-
- int position = command.offset + command.length;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return;
- }
-
- // get open brace region
- CompoundRegion region = prevCorrespondence(position, regionType);
-
- // get indentation
- String str = getIndentFor(region, false);
-
- // append to input
- if (str != null)
- command.text = str + command.text;
- }
-
- /**
- * Copies the indentation of the previous line.
- */
- protected void autoIndentAfterNewLine(DocumentCommand command) {
- // select nearest white spaces to replace with new-line
- setRangeForNewLine(command);
-
- // get position
- int position = command.offset;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return;
- }
-
- // get current region
- CompoundRegion currentRegion = getRegion(command.offset + command.length);
-
- // get key region
- CompoundRegion keyRegion = getPrevKeyRegion(position, currentRegion);
-
- // get indent string
- String str = getIndentFor(keyRegion, true);
-
- // check another indentation
- int shift = needShift(keyRegion, command.offset + command.length);
-
- // create text to replace
- StringBuffer buf = new StringBuffer(command.text);
- if (str != null)
- buf.append(str);
- while (shift-- != 0)
- buf.append(CSSPreferenceHelper.getInstance().getIndentString());
- command.text = buf.toString();
-
- }
-
- /**
- */
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- Object textEditor = getActiveTextEditor();
- if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
- return;
-
- //return;
- ///*
- structuredDocument = (IStructuredDocument) document;
-
- if (command.length == 0 && command.text != null) {
- if (endsWith(document.getLegalLineDelimiters(), command.text) != -1) {
- autoIndentAfterNewLine(command);
- } else if (command.text.equals("}")) {//$NON-NLS-1$
- autoIndentAfterClose(command, CSSRegionContexts.CSS_RBRACE);
- } else if (command.text.equals("]")) {//$NON-NLS-1$
- autoIndentAfterClose(command, CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END);
- } else if (command.text.equals(")")) {//$NON-NLS-1$
- autoIndentAfterClose(command, CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE);
- }
- }
- //*/
- }
-
- /**
- */
- protected String getIndentFor(CompoundRegion region, boolean indentForNextRegion) {
- if (region == null)
- return null;
- IStructuredDocumentRegion flatNode = region.getDocumentRegion();
- if (flatNode == null)
- return null;
-
- try {
- if (region.getType() == CSSRegionContexts.CSS_LBRACE || region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // get meanful flat node
- RegionIterator it = new RegionIterator(flatNode, region.getTextRegion());
- it.prev();
- while (it.hasPrev()) {
- ITextRegion r = it.prev();
- region = new CompoundRegion(it.getStructuredDocumentRegion(), r);
- if (region.getType() != CSSRegionContexts.CSS_S)
- break;
- }
- flatNode = region.getDocumentRegion();
- // get indent string
- int position = flatNode.getStart();
- int line = structuredDocument.getLineOfOffset(position);
- int start = structuredDocument.getLineOffset(line);
- int end = findEndOfWhiteSpace(structuredDocument, start, position);
- return structuredDocument.get(start, end - start);
- } else if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START ||
- //region.getType() == CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
- region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION || region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- int position = flatNode.getStart() + region.getStart();
- int line = structuredDocument.getLineOfOffset(position);
- int start = structuredDocument.getLineOffset(line);
- int end = findEndOfWhiteSpace(structuredDocument, start, position);
- StringBuffer buf = new StringBuffer(structuredDocument.get(start, end - start));
- position += region.getText().length();
- if (indentForNextRegion) {
- int tokenStart = findEndOfWhiteSpace(structuredDocument, position, structuredDocument.getLineOffset(line) + structuredDocument.getLineLength(line) - 1);
- if (tokenStart < structuredDocument.getLineOffset(line) + structuredDocument.getLineLength(line) - 1) {
- position = tokenStart;
- }
- }
- while (position - end > 0) {
- buf.append(" ");//$NON-NLS-1$
- end++;
- }
- return buf.toString();
- } else
- return "";//$NON-NLS-1$
- } catch (BadLocationException excp) {
- Logger.logException(excp);
- }
- return null;
- }
-
- /**
- */
- protected CompoundRegion getPrevKeyRegion(int position, CompoundRegion currentRegion) {
- if (currentRegion == null) {
- if (structuredDocument.getLastStructuredDocumentRegion() == null)
- return null;
- }
-
- if (currentRegion != null && (currentRegion.getType() == CSSRegionContexts.CSS_RBRACE || currentRegion.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || currentRegion.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)) {
- return prevCorrespondence(currentRegion);
- }
-
- RegionIterator it = new RegionIterator(structuredDocument, position - 1);
- while (it.hasPrev()) {
- ITextRegion r = it.prev();
- CompoundRegion region = new CompoundRegion(it.getStructuredDocumentRegion(), r);
- if (region.getType() == CSSRegionContexts.CSS_LBRACE ||
- // region.getType() == CSSRegionContexts.CSS_RBRACE ||
- region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START ||
- // region.getType() ==
- // CSSRegionContexts.CSS_BRACKET_CLOSE ||
- //// region.getType() ==
- // CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
- // region.getType() ==
- // CSSRegionContexts.CSS_PARENTHESIS_CLOSE ||
- region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER ||
- // region.getType() == CSSRegionContexts.CSS_COLON ||
- // region.getType() == CSSRegionContexts.CSS_COMMENT
- // ||
- region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- return region;
- } else if (region.getType() == CSSRegionContexts.CSS_RBRACE || region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- // skip to LBRACE
- CompoundRegion pc = prevCorrespondence(region);
- it.reset(pc.getDocumentRegion(), pc.getTextRegion());
- it.prev();
- } else if (region.getType() == CSSRegionContexts.CSS_STRING) {
- RegionIterator itTmp = new RegionIterator(structuredDocument, position);
- if (region == itTmp.prev())
- return region; // position is inside of string
- } else if (region.getType() == CSSRegionContexts.CSS_COMMENT) {
- RegionIterator itTmp = new RegionIterator(structuredDocument, position);
- if (region == itTmp.prev())
- return region; // position is inside of comment
- } else if (region.getType() == CSSRegionContexts.CSS_UNKNOWN) {
- String str = region.getText();
- if (str.charAt(str.length() - 1) == '\\')
- return region;
- } else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- RegionIterator itPrev = new RegionIterator(region.getDocumentRegion(), region.getTextRegion());
- while (itPrev.hasPrev()) {
- ITextRegion regionPrev = itPrev.prev();
- if (regionPrev.getType() == CSSRegionContexts.CSS_RBRACE) {
- break;
- } else if (regionPrev.getType() == CSSRegionContexts.CSS_DELIMITER || regionPrev.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- return region;
- } else if (regionPrev.getType() == CSSRegionContexts.CSS_LBRACE) {
- while (itPrev.hasPrev()) {
- regionPrev = itPrev.prev();
- if (regionPrev.getType() == CSSRegionContexts.CSS_MEDIA)
- break;
- if (regionPrev.getType() == CSSRegionContexts.CSS_LBRACE || regionPrev.getType() == CSSRegionContexts.CSS_RBRACE || regionPrev.getType() == CSSRegionContexts.CSS_DELIMITER || regionPrev.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
- return region;
- }
- if (regionPrev.getType() == CSSRegionContexts.CSS_MEDIA)
- break;
- else
- return region;
- }
- }
- }
- }
- return null;
- }
-
- /**
- */
- protected CompoundRegion getRegion(int position) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position);
- if (flatNode != null)
- return new CompoundRegion(flatNode, flatNode.getRegionAtCharacterOffset(position));
- return null;
- }
-
- /**
- */
- protected int needShift(CompoundRegion region, int position) {
- int shift = 0;
- if (region == null || region.getType() == CSSRegionContexts.CSS_DELIMITER || region.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER || region.getType() == CSSRegionContexts.CSS_LBRACE) {
- // get non space region
- CompoundRegion cr = getRegion(position - 1);
- RegionIterator it = new RegionIterator(cr.getDocumentRegion(), cr.getTextRegion());
- ITextRegion nearestRegion = null;
- while (it.hasPrev()) {
- nearestRegion = it.prev();
- if (nearestRegion.getType() != CSSRegionContexts.CSS_S && nearestRegion.getType() != CSSRegionContexts.CSS_COMMENT)
- break;
- }
- if (nearestRegion != null && (nearestRegion.getType() == CSSRegionContexts.CSS_LBRACE || nearestRegion.getType() == CSSRegionContexts.CSS_RBRACE || nearestRegion.getType() == CSSRegionContexts.CSS_DELIMITER || nearestRegion.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER))
- shift--;
- else if (region == null)
- shift--;
- shift++;
- }
- if (region != null && region.getType() == CSSRegionContexts.CSS_LBRACE) {
- RegionIterator it = new RegionIterator(structuredDocument, position);
- if (!it.hasPrev() || it.prev().getType() != CSSRegionContexts.CSS_RBRACE)
- shift++;
- else
- shift = 0;
- }
- return shift;
- }
-
- /**
- */
- protected CompoundRegion prevCorrespondence(int position, String regionType) {
- RegionIterator it = new RegionIterator(structuredDocument, position - 1);
- ITextRegion region = null;
- int nest = 1;
- if (regionType == CSSRegionContexts.CSS_RBRACE) {
- // skip to LBRACE
- while (it.hasPrev()) {
- region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_LBRACE)
- nest--;
- else if (region.getType() == CSSRegionContexts.CSS_RBRACE)
- nest++;
- if (nest <= 0)
- break;
- }
- if (nest == 0)
- return new CompoundRegion(it.getStructuredDocumentRegion(), region);
- }
- if (regionType == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END) {
- // skip to BRACKET_OPEN
- while (it.hasPrev()) {
- region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)
- nest--;
- else if (region.getType() == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END)
- nest++;
- if (nest <= 0)
- break;
- }
- if (nest == 0)
- return new CompoundRegion(it.getStructuredDocumentRegion(), region);
- }
- if (regionType == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- // skip to PARENTHESIS_OPEN
- while (it.hasPrev()) {
- region = it.prev();
- if (//region.getType() ==
- // CSSRegionContexts.CSS_PARENTHESIS_OPEN ||
- region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- nest--;
- else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- nest++;
- if (nest <= 0)
- break;
- }
- if (nest == 0)
- return new CompoundRegion(it.getStructuredDocumentRegion(), region);
- }
- return null;
- }
-
- /**
- */
- protected CompoundRegion prevCorrespondence(CompoundRegion region) {
- if (region == null)
- return null;
-
- IStructuredDocumentRegion flatNode = region.getDocumentRegion();
- int position = flatNode.getStart() + region.getStart();
- return prevCorrespondence(position, region.getType());
- }
-
- /**
- * Insert the method's description here.
- *
- * @return boolean
- * @param command
- * org.eclipse.jface.text.DocumentCommand
- */
- protected boolean setRangeForClose(DocumentCommand command) {
- int position = command.offset;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return false;
- }
-
- try {
- // find start of line
- int p = (position == structuredDocument.getLength() ? position - 1 : position);
-
- int line = structuredDocument.getLineOfOffset(p);
- int start = structuredDocument.getLineOffset(line);
- RegionIterator it = new RegionIterator(structuredDocument, start);
- boolean allWhiteSpace = false;
- // check whether the text from lStart to position is white space
- // or not
- while (it.hasNext()) {
- ITextRegion region = it.next();
- if (region.getType() != CSSRegionContexts.CSS_S)
- break;
- if (it.getStructuredDocumentRegion().getEndOffset(region) > p) {
- allWhiteSpace = true;
- break;
- }
- }
- if (allWhiteSpace) {
- command.length = command.length - (start - command.offset);
- command.offset = start;
- return true;
- }
- } catch (BadLocationException excp) {
- Logger.logException(excp);
- }
- return false;
- }
-
- /**
- */
- protected void setRangeForNewLine(DocumentCommand command) {
- int position = command.offset;
-
- if (position == -1 || structuredDocument.getLength() == 0) {
- return;
- }
-
- try {
- // add pre-nearest white spaces to replace target
- if (position > 0) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position - 1);
- if (flatNode != null) {
- ITextRegion region = flatNode.getRegionAtCharacterOffset(position - 1);
- if (region.getType() == CSSRegionContexts.CSS_S) {
- int end = command.offset + command.length;
- int nLine = structuredDocument.getLineOfOffset(position);
- int nStartPos = structuredDocument.getLineOffset(nLine);
- if (nStartPos < flatNode.getStartOffset(region))
- nStartPos = flatNode.getStartOffset(region);
- command.offset = nStartPos;
- command.length = end - command.offset;
- }
- }
- }
-
- // add post-nearest white spaces to replace target
- if (position < structuredDocument.getLength()) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(position);
- if (flatNode != null) {
- ITextRegion region = flatNode.getRegionAtCharacterOffset(position);
- if (region.getType() == CSSRegionContexts.CSS_S) {
- int nLine = structuredDocument.getLineOfOffset(position);
- String currentLineDelim = structuredDocument.getLineDelimiter(nLine);
- int nEndPos = structuredDocument.getLineOffset(nLine) + structuredDocument.getLineLength(nLine) - ((currentLineDelim != null) ? currentLineDelim.length() : 0);
- if (nEndPos > flatNode.getEndOffset(region))
- nEndPos = flatNode.getEndOffset(region);
- command.length = nEndPos - command.offset;
- }
- }
- }
- } catch (BadLocationException e) {
- // do not customize command
- }
-
- }
-
- private static int endsWith(String[] searchStrings, String text) {
- for (int i = 0; i < searchStrings.length; i++) {
- if (text.endsWith(searchStrings[i]))
- return i;
- }
- return -1;
- }
-
- private static int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
- while (offset < end) {
- char c = document.getChar(offset);
- if (c != ' ' && c != '\t') {
- return offset;
- }
- offset++;
- }
- return end;
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSCACandidate.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSCACandidate.java
deleted file mode 100644
index 2987933e44..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSCACandidate.java
+++ /dev/null
@@ -1,102 +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.ui.contentassist;
-
-
-
-import org.eclipse.wst.css.ui.image.CSSImageType;
-
-class CSSCACandidate {
-
- private String fReplacementString = null;
- private int fCursorPosition = 0;
- private String fDisplayString = null;
- private CSSImageType fImageType = null;
-
- /**
- * CSSCACandidate constructor comment.
- */
- CSSCACandidate() {
- super();
- }
-
- /**
- *
- */
- int getCursorPosition() {
- return fCursorPosition;
- }
-
- /**
- *
- */
- String getDisplayString() {
- return fDisplayString;
- }
-
- /**
- *
- */
- CSSImageType getImageType() {
- return fImageType;
- }
-
- /**
- *
- */
- String getReplacementString() {
- return fReplacementString;
- }
-
- /**
- *
- */
- void setCursorPosition(int cursorPosition) {
- fCursorPosition = cursorPosition;
- }
-
- /**
- *
- */
- void setDisplayString(String displayString) {
- fDisplayString = displayString;
- }
-
- /**
- *
- */
- void setImageType(CSSImageType imageType) {
- fImageType = imageType;
- }
-
- /**
- *
- */
- void setReplacementString(String replacementString) {
- fReplacementString = replacementString;
- }
-
- /**
- * Returns a String that represents the value of this object.
- *
- * @return a string representation of the receiver
- */
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(getReplacementString());
- buf.append("\"");//$NON-NLS-1$
- buf.append(getDisplayString());
- buf.append("\"");//$NON-NLS-1$
- buf.append("(");//$NON-NLS-1$
- buf.append(getCursorPosition());
- buf.append(")");//$NON-NLS-1$
-
- return buf.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistContext.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistContext.java
deleted file mode 100644
index 3d1baeda6e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistContext.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.wst.css.ui.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-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.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.css.core.util.RegionIterator;
-import org.eclipse.wst.sse.core.IndexedRegion;
-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 CSSContentAssistContext {
-
- private int fReplaceBegin = -1;
- private String fTextToReplace = null;
- private String fTextToCompare = null;
- private int fTargetPos = -1;
- private ICSSNode fTargetNode = null;
- private int fCursorPos = -1;
- private IStructuredDocument fStructuredDocument = null;
- private int fDocumentOffset = 0;
- private char fQuote = 0;
- private ICSSModel fModel = null;
-
- /**
- *
- */
- private CSSContentAssistContext() {
- super();
- }
-
- /**
- *
- */
- CSSContentAssistContext(int documentPosition, ICSSNode node, int documentOffset, char quote) {
- super();
- fCursorPos = documentPosition;
- fDocumentOffset = documentOffset;
- fQuote = quote;
- initialize(node.getOwnerDocument());
- }
-
- /**
- * @return int
- */
- int getCursorPos() {
- return fCursorPos;
- }
-
- /**
- * @return int
- */
- int getDocumentOffset() {
- return fDocumentOffset;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.IStructuredDocument
- */
- IStructuredDocument getStructuredDocument() {
- return fStructuredDocument;
- }
-
- /**
- * @return com.ibm.sse.model.css.model.ICSSModel
- */
- ICSSModel getModel() {
- return fModel;
- }
-
- private ICSSNode getNodeAt(int offset) {
- return (ICSSNode) ((fModel != null) ? fModel.getIndexedRegion(offset) : null);
- }
-
- /**
- *
- * @return char
- */
- char getQuoteOfStyleAttribute() {
- return fQuote;
- }
-
- /**
- *
- */
- ITextRegion getRegionByOffset(int offset) {
- ITextRegion region = null;
- if (fStructuredDocument != null) {
- IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(offset);
- if (flatNode != null) {
- region = flatNode.getRegionAtCharacterOffset(offset);
- }
- }
- return region;
- }
-
- /**
- *
- */
- // String getRegionText() {
- // ITextRegion targetRegion = getTargetRegion();
- // if (targetRegion != null) {
- // return targetRegion.getText();
- // } else {
- // return ""; //$NON-NLS-1$
- // }
- // }
- /**
- *
- */
- int getReplaceBegin() {
- return fReplaceBegin;
- }
-
- /**
- *
- * @return com.ibm.sed.structuredDocument.ITextRegion
- */
- // ITextRegion getSignificantTargetRegion() {
- // ITextRegion targetRegion = getTargetRegion();
- // RegionIterator iterator = null;
- // if (targetRegion == null) {
- // if (0 < fCursorPos) {
- // iterator = new RegionIterator(fStructuredDocument, fCursorPos - 1);
- // }
- // } else {
- // iterator = getRegionIterator();
- // }
- // if (iterator != null) {
- // while (iterator.hasPrev()) {
- // ITextRegion region = iterator.prev();
- // String type = region.getType();
- // if (type != CSSRegionContexts.CSS_S && type !=
- // CSSRegionContexts.CSS_COMMENT &&
- // type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC)
- // {
- // targetRegion = region;
- // break;
- // }
- // }
- // }
- //
- // return targetRegion;
- // }
- /**
- *
- */
- ICSSNode getTargetNode() {
- return fTargetNode;
- }
-
- /**
- *
- */
- private int getTargetPos() {
- return fTargetPos;
- }
-
- /**
- * @return com.ibm.sed.structuredDocument.ITextRegion
- */
- ITextRegion getTargetRegion() {
- return getRegionByOffset(getTargetPos());
- }
-
- private IStructuredDocumentRegion getTargetDocumentRegion() {
- return getDocumentRegionByOffset(getTargetPos());
- }
-
- private IStructuredDocumentRegion getDocumentRegionByOffset(int offset) {
- return (fStructuredDocument != null) ? fStructuredDocument.getRegionAtCharacterOffset(offset) : null;
- }
-
- /**
- *
- * @return com.ibm.sed.structuredDocument.ITextRegion
- */
- ITextRegion getTargetRegionPrevious() {
- ITextRegion previousRegion = null;
- ITextRegion targetRegion = getTargetRegion();
- RegionIterator iterator = null;
- if (targetRegion == null) {
- if (0 < fCursorPos) {
- iterator = new RegionIterator(fStructuredDocument, fCursorPos - 1);
- }
- } else {
- iterator = getRegionIterator();
- if (iterator.hasPrev()) {
- iterator.prev();
- } else {
- iterator = null;
- }
- }
- if (iterator != null) {
- while (iterator.hasPrev()) {
- ITextRegion region = iterator.prev();
- String type = region.getType();
- if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
- previousRegion = region;
- break;
- }
- }
- }
-
- return previousRegion;
- }
-
- /**
- * @return java.lang.String
- */
- String getTextToCompare() {
- return fTextToCompare;
- }
-
- /**
- *
- */
- String getTextToReplace() {
- return fTextToReplace;
- }
-
- /**
- *
- */
- private void initialize(ICSSDocument doc) {
- if (doc == null) {
- return;
- }
- ICSSModel model = doc.getModel();
- fModel = model;
- fStructuredDocument = model.getStructuredDocument();
-
- initializeTargetPos();
- initializeTargetText();
- initializeTargetNode();
- }
-
- /**
- *
- */
- private void initializeTargetNode() {
- if (fCursorPos == 0) {
- fTargetNode = fModel.getDocument();
- return;
- }
-
- // find edge of tree node
- ICSSNode cursorNode = getNodeAt(fCursorPos);
- if (cursorNode == null) { // end of document
- cursorNode = fModel.getDocument();
- }
- ICSSNode node = null;
- IStructuredDocumentRegion flatNode = fStructuredDocument.getRegionAtCharacterOffset(fCursorPos - 1);
- while (flatNode != null && (node = getNodeAt(flatNode.getStartOffset())) == cursorNode && ((IndexedRegion) node).getStartOffset() != flatNode.getStartOffset()) {
- flatNode = flatNode.getPrevious();
- }
- if (flatNode == null) { // top of document
- fTargetNode = (node == null) ? fModel.getDocument() : node;
- return;
- }
- // v<--|
- // AAAAAA
- // BBBBBBBBBB cursorNode:A , node:B -> target is A
- if (cursorNode != null) {
- for (ICSSNode parent = cursorNode.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent == cursorNode) {
- fTargetNode = cursorNode;
- return;
- }
- }
- }
- // 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) {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- fTargetNode = node.getParentNode();
- } else {
- fTargetNode = node;
- }
- // fTargetNode = (bOverSemiColon) ? node.getParentNode() : node;
- } else if (CSSUtil.getStructuredDocumentRegionType(flatNode) == CSSRegionContexts.CSS_RBRACE) {
- fTargetNode = node.getParentNode();
- } else {
- fTargetNode = node;
- }
-
- return;
- }
-
- /**
- *
- */
- private void initializeTargetPos() {
- if (fCursorPos == 0 || isSpecialDelimiterRegion(fCursorPos - 1)) {
- fTargetPos = fCursorPos;
- } else {
- fTargetPos = fCursorPos - 1;
- }
- }
-
- /**
- *
- */
- private void initializeTargetText() {
- ITextRegion targetRegion = getTargetRegion();
- IStructuredDocumentRegion documentRegion = getTargetDocumentRegion();
- if (targetRegion == null) {
- fReplaceBegin = fCursorPos;
- fTextToReplace = ""; //$NON-NLS-1$
- fTextToCompare = ""; //$NON-NLS-1$
- } else {
- String regionText = documentRegion.getText(targetRegion);
- int regionStart = documentRegion.getStartOffset(targetRegion);
- if (regionStart == fCursorPos || regionText.trim().length() == 0 || regionStart + regionText.length() - 1 < fTargetPos) {
- // to insertion
- fReplaceBegin = fCursorPos;
- fTextToReplace = ""; //$NON-NLS-1$
- fTextToCompare = ""; //$NON-NLS-1$
- } else {
- // to replace
- fReplaceBegin = regionStart;
- fTextToReplace = regionText;
- fTextToCompare = regionText.substring(0, fCursorPos - fReplaceBegin);
- }
- }
- }
-
- /**
- *
- */
- private boolean isSpecialDelimiterRegion(int pos) {
- ITextRegion region = getRegionByOffset(pos);
- String type = region.getType();
- return (type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR);
- }
-
- /**
- *
- */
- boolean isTargetPosAfterOf(String regionType) {
- int start = ((IndexedRegion) fTargetNode).getStartOffset();
- if (start < 0 || ((IndexedRegion) fTargetNode).getEndOffset() <= 0) {
- return false;
- }
-
- RegionIterator iRegion = new RegionIterator(fStructuredDocument, start);
- while (iRegion.hasNext()) {
- ITextRegion region = iRegion.next();
- if (fTargetPos < iRegion.getStructuredDocumentRegion().getTextEndOffset(region)) {
- break;
- }
- if (region.getType() == regionType) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- boolean isTargetPosBeforeOf(String regionType) {
- return !isTargetPosAfterOf(regionType);
- }
-
- /**
- * @return boolean
- * @param regionType
- * java.lang.String
- */
- boolean targetFollows(String regionType) {
- RegionIterator iRegion;
- ITextRegion region = null;
- if (fStructuredDocument.getLength() <= fTargetPos) {
- iRegion = new RegionIterator(fStructuredDocument, fStructuredDocument.getLength() - 1);
- } else {
- iRegion = new RegionIterator(fStructuredDocument, fTargetPos);
- try {
- if (!Character.isWhitespace(fStructuredDocument.getChar(fTargetPos)) && iRegion.hasPrev()) {
- region = iRegion.prev();
- }
- } catch (BadLocationException e) {
- iRegion = new RegionIterator(fStructuredDocument, fStructuredDocument.getLength() - 1);
- }
- }
- while (iRegion.hasPrev()) {
- region = iRegion.prev();
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- continue;
- } else {
- break;
- }
- }
- if (region != null && region.getType() == regionType) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- *
- */
- boolean targetHas(String regionType) {
- int start = ((IndexedRegion) fTargetNode).getStartOffset();
- int end = ((IndexedRegion) fTargetNode).getEndOffset();
- if (start < 0 || end <= 0) {
- return false;
- }
- RegionIterator iRegion = new RegionIterator(fStructuredDocument, start);
- while (iRegion.hasNext()) {
- ITextRegion region = iRegion.next();
- if (end <= iRegion.getStructuredDocumentRegion().getStartOffset(region)) {
- break;
- }
- if (region.getType() == regionType) {
- return true;
- }
- }
- return false;
- }
-
- RegionIterator getRegionIterator() {
- return new RegionIterator(getStructuredDocument(), getTargetPos());
- }
-
- /**
- *
- */
- CSSMetaModel getMetaModel() {
- CSSMetaModelFinder finder = CSSMetaModelFinder.getInstance();
- return finder.findMetaModelFor(getModel());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistProcessor.java
deleted file mode 100644
index 50f1d6ddec..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSContentAssistProcessor.java
+++ /dev/null
@@ -1,273 +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.ui.contentassist;
-
-
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.adapters.ICSSModelAdapter;
-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.html.core.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.ui.contentassist.XMLContentAssistUtilities;
-import org.eclipse.wst.xml.ui.util.SharedXMLEditorPluginImageHelper;
-
-public class CSSContentAssistProcessor implements IContentAssistProcessor {
-
- private int fDocumentOffset = 0;
- private char fQuote = 0;
-
- /**
- * Return a list of proposed code completions based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text-editor control.
- *
- * @param documentPosition
- * a location within the document
- * @return an array of code-assist items
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
-
- IndexedRegion indexedNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition + fDocumentOffset);
- IndexedRegion keyIndexedNode = null;
- XMLNode xNode = null;
- XMLNode parent = null;
- IStructuredModel cssModel = null;
- CSSProposalArranger arranger = null;
-
- // bail if we couldn't get an indexed node
- //if(indexedNode == null) return new ICompletionProposal[0];
- if (indexedNode instanceof XMLNode) {
- xNode = (XMLNode) indexedNode;
- parent = (XMLNode) xNode.getParentNode();
- }
- // need to get in here if there in the no 0 region <style>|</style>
- // case
- if (xNode != null && xNode.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- // now we know the cursor is in a <style> tag w/out region
- cssModel = getCSSModel(xNode);
- if (cssModel == null)
- return new ICompletionProposal[0];
-
- // adjust offsets for embedded style
- int offset = documentPosition;
- int pos = 0;
- keyIndexedNode = cssModel.getIndexedRegion(pos);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0);
-
- } else if (parent != null && parent.getNodeName().equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- // now we know the cursor is in a <style> tag with a region
- // use the parent because that will be the <style> tag
- cssModel = getCSSModel(parent);
- if (cssModel == null)
- return new ICompletionProposal[0];
-
- // adjust offsets for embedded style
- int offset = indexedNode.getStartOffset();
- int pos = documentPosition - offset;
- keyIndexedNode = cssModel.getIndexedRegion(pos);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
- arranger = new CSSProposalArranger(pos, (ICSSNode) keyIndexedNode, offset, (char) 0);
- } else if (indexedNode instanceof XMLNode) {
- // get model for node w/ style attribute
- cssModel = getCSSModel((XMLNode) indexedNode);
- } else if (indexedNode instanceof ICSSNode) {
- // when editing external CSS using CSS Designer, ICSSNode is
- // passed.
- ICSSDocument cssdoc = ((ICSSNode) indexedNode).getOwnerDocument();
- if (cssdoc != null) {
- cssModel = cssdoc.getModel();
- }
- } else if (indexedNode == null && isViewerEmpty(viewer) && viewer instanceof StructuredTextViewer) {
- // the top of empty CSS Document
- IStructuredModel model = ((StructuredTextViewer) viewer).getModel();
- if (model instanceof ICSSModel) {
- cssModel = (ICSSModel) model;
- }
- }
-
- if (cssModel == null)
- return new ICompletionProposal[0];
-
- keyIndexedNode = cssModel.getIndexedRegion(documentPosition - fDocumentOffset);
- if (keyIndexedNode == null) {
- keyIndexedNode = (IndexedRegion) ((ICSSModel) cssModel).getDocument();
- }
-
- if (!(keyIndexedNode instanceof ICSSNode)) {
- return new ICompletionProposal[0];
- }
-
- if (arranger == null) {
- // if it's null at this point, it must be inline style for a tag,
- // not embedded
- arranger = new CSSProposalArranger(documentPosition, (ICSSNode) keyIndexedNode, fDocumentOffset, fQuote);
- }
- fDocumentOffset = 0;
- ICompletionProposal[] temp = arranger.getProposals();
-
- // add end tag if parent is not closed
- ICompletionProposal endTag = XMLContentAssistUtilities.computeXMLEndTagProposal(viewer, documentPosition, indexedNode, HTML40Namespace.ElementName.STYLE, SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC); //$NON-NLS-1$
- if (endTag == null)
- return temp;
- else {
- ICompletionProposal[] plusOne = new ICompletionProposal[temp.length + 1];
- System.arraycopy(temp, 0, plusOne, 1, temp.length);
- plusOne[0] = endTag;
- return plusOne;
- }
- }
-
- /**
- * Returns true if there is no text or it's all white space, otherwise
- * returns false
- *
- * @param treeNode
- * @param textViewer
- * @return boolean
- */
- private boolean isViewerEmpty(ITextViewer textViewer) {
- boolean isEmpty = false;
- String text = textViewer.getTextWidget().getText();
- if (text == null || (text != null && text.trim().equals(""))) //$NON-NLS-1$
- isEmpty = true;
- return isEmpty;
- }
-
- /**
- * Get CSSModel for an indexed node
- *
- * @param indexedNode
- * @return IStructuredModel
- */
- // private IStructuredModel getCSSModel(IndexedRegion indexedNode) {
- // if (indexedNode == null) return null;
- // Node node = (Node)indexedNode;
- // INodeNotifier notifier = (INodeNotifier)node.getParentNode();
- // if (notifier == null) return null;
- // INodeAdapter adapter =
- // StyleAdapterFactory.getInstance().adapt(notifier);
- // if (adapter == null || !(adapter instanceof CSSModelAdapter)) return
- // null;
- // CSSModelAdapter modelAdapter = (CSSModelAdapter)adapter;
- // return modelAdapter.getModel();
- // }
- /**
- * Returns the CSSmodel for a given XML node.
- *
- * @param element
- * @return IStructuredModel
- */
- private IStructuredModel getCSSModel(XMLNode element) {
- if (element == null)
- return null;
- INodeAdapter adapter = StyleAdapterFactory.getInstance().adapt(element);
- if (adapter == null || !(adapter instanceof ICSSModelAdapter))
- return null;
- ICSSModelAdapter modelAdapter = (ICSSModelAdapter) adapter;
- return modelAdapter.getModel();
- }
-
- /**
- * Returns information about possible contexts based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text viewer.
- *
- * @param viewer
- * the viewer whose document is used to compute the possible
- * contexts
- * @param documentPosition
- * an offset within the document for which context information
- * should be computed
- * @return an array of context information objects or <code>null</code>
- * if no context could be found
- */
- public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int documentOffset) {
- return null;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of possible completions.
- *
- * @return the auto activation characters for completion proposal or
- * <code>null</code> if no auto activation is desired
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return null;
- }
-
- /**
- * Returns the characters which when entered by the user should
- * automatically trigger the presentation of context information.
- *
- * @return the auto activation characters for presenting context
- * information or <code>null</code> if no auto activation is
- * desired
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- /**
- * Returns a validator used to determine when displayed context
- * information should be dismissed. May only return <code>null</code> if
- * the processor is incapable of computing context information.
- *
- * @return a context information validator, or <code>null</code> if the
- * processor is incapable of computing context information
- */
- public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator() {
- return null;
- }
-
- /**
- * Return the reason why computeProposals was not able to find any
- * completions.
- *
- * @return an error message or null if no error occurred
- */
- public String getErrorMessage() {
- return null;
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/05/22
- * 10:37:05)
- *
- * @param offset
- * int
- */
- public void setDocumentOffset(int offset) {
- fDocumentOffset = offset;
- }
-
- /**
- *
- * @param quote
- * char
- */
- public void setQuoteCharOfStyleAttribute(char quote) {
- fQuote = quote;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalArranger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalArranger.java
deleted file mode 100644
index 854e87d1ca..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalArranger.java
+++ /dev/null
@@ -1,169 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.css.core.document.ICSSMediaRule;
-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.eclipse.wst.css.core.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-class CSSProposalArranger {
-
- private List fProposals = new ArrayList();
- private CSSContentAssistContext fContext = null;
-
- /**
- * CSSProposalArranger constructor comment.
- */
- private CSSProposalArranger() {
- super();
- }
-
- /**
- * CSSProposalArranger constructor comment.
- */
- CSSProposalArranger(int documentPosition, ICSSNode node, int documentOffset, char quote) {
- super();
- fContext = new CSSContentAssistContext(documentPosition, node, documentOffset, quote);
- }
-
- /**
- *
- */
- void buildProposals() {
- fProposals.clear();
-
- /*
- * String text; ICompletionProposal item; text = "---- Test
- * Information ----"; item = new CompletionProposal("",
- * fContext.getReplaceBegin(), 0, 0, null, text, null, null);
- * fProposals.add(item);
- *
- * text = "Target: \"" + fContext.getRegionText() + "\"";
- *
- * item = new CompletionProposal("", fContext.getReplaceBegin(), 0, 0,
- * null, text, null, null); fProposals.add(item);
- *
- * text = fContext.getTargetNode().getClass().toString(); int
- * lastPeriodPos = text.lastIndexOf('.'); text = "Node: " +
- * text.substring(lastPeriodPos + 1); item = new
- * CompletionProposal("", fContext.getReplaceBegin(), 0, 0, null,
- * text, null, null); fProposals.add(item);
- */
-
- ICSSNode targetNode = fContext.getTargetNode();
- //int targetPos = fContext.getTargetPos();
- if (targetNode instanceof ICSSStyleSheet) {
- buildProposalsForAnyRule();
- } else if ((targetNode instanceof ICSSMediaRule && fContext.isTargetPosAfterOf(CSSRegionContexts.CSS_LBRACE)) || (targetNode instanceof ICSSStyleRule && fContext.isTargetPosBeforeOf(CSSRegionContexts.CSS_LBRACE))) {
- buildProposalsForAnyRule();
- // buildProposalsForStyleRule();
- } else if ((targetNode instanceof ICSSPageRule && fContext.isTargetPosBeforeOf(CSSRegionContexts.CSS_LBRACE))) {
- buildProposalsForPageRulePseudoClass();
- } else if ((targetNode instanceof ICSSStyleRule || targetNode instanceof CSSFontFaceRule || targetNode instanceof ICSSPageRule || targetNode instanceof ICSSStyleDeclaration) && (targetNode.getOwnerDocument() instanceof ICSSStyleDeclaration || fContext.targetFollows(CSSRegionContexts.CSS_DECLARATION_DELIMITER) || fContext.targetFollows(CSSRegionContexts.CSS_LBRACE))) {
- buildProposalsForDeclarationName();
- } else if (targetNode instanceof ICSSStyleDeclItem) {
- if (fContext.isTargetPosAfterOf(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
- buildProposalsForDeclarationValue();
- } else {
- buildProposalsForDeclarationName();
- }
- } else if (targetNode instanceof ICSSPrimitiveValue) {
- buildProposalsForDeclarationValue();
- }
- /*
- * else if (targetNode instanceof ICSSPrimitiveValue || ((targetNode
- * instanceof ICSSStyleRule || targetNode instanceof CSSFontFaceRule ||
- * targetNode instanceof ICSSStyleDeclaration || targetNode instanceof
- * ICSSStyleDeclItem) &&
- * fContext.isTargetPosAfterOf(CSSRegionContexts.COLON))) {
- * buildProposalsForDeclarationValue(); }
- */
-
- // for Test
- }
-
- /**
- *
- */
- void buildProposalsForAnyRule() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForAtmarkRule(fContext);
- fProposals.addAll(generator.getProposals());
- generator = new CSSProposalGeneratorForHTMLTag(fContext);
- fProposals.addAll(generator.getProposals());
- generator = new CSSProposalGeneratorForPseudoSelector(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForDeclarationName() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForDeclarationName(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForDeclarationValue() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForDeclarationValue(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForPageRulePseudoClass() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForPseudoSelector(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- void buildProposalsForStyleRule() {
- CSSProposalGenerator generator;
- generator = new CSSProposalGeneratorForHTMLTag(fContext);
- fProposals.addAll(generator.getProposals());
- generator = new CSSProposalGeneratorForPseudoSelector(fContext);
- fProposals.addAll(generator.getProposals());
- }
-
- /**
- *
- */
- ICompletionProposal[] getProposals() {
- buildProposals();
- ICompletionProposal[] proposalArray = new CompletionProposal[fProposals.size()];
- Iterator iItem = fProposals.iterator();
- for (int i = 0; iItem.hasNext(); i++) {
- proposalArray[i] = (ICompletionProposal) iItem.next();
- }
- return proposalArray;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGenerator.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGenerator.java
deleted file mode 100644
index 483645adfe..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGenerator.java
+++ /dev/null
@@ -1,209 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.core.util.RegionIterator;
-import org.eclipse.wst.css.ui.image.CSSImageHelper;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-abstract class CSSProposalGenerator {
-
-
- protected class StringAndOffset {
- StringAndOffset(String string, int offset) {
- this.fString = string;
- this.fOffset = offset;
- }
-
- String fString;
- int fOffset;
- }
-
- protected CSSContentAssistContext fContext = null;
-
- /**
- * CSSProposalGenerator constructor comment.
- */
- private CSSProposalGenerator() {
- super();
- }
-
- CSSProposalGenerator(CSSContentAssistContext context) {
- super();
- fContext = context;
- }
-
- /**
- *
- */
- protected boolean checkLeadingColon() {
- boolean hasLeadingColon = false;
- ITextRegion targetRegion = fContext.getTargetRegion();
- if (targetRegion == null && 0 < fContext.getCursorPos()) {
- targetRegion = fContext.getRegionByOffset(fContext.getCursorPos() - 1);
- if (targetRegion != null && targetRegion.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- hasLeadingColon = true;
- }
- } else if (targetRegion != null) {
- RegionIterator iterator = fContext.getRegionIterator();
- if (iterator.hasPrev()) {
- iterator.prev();
- if (iterator.hasPrev() && iterator.prev().getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- hasLeadingColon = true;
- }
- }
- }
- return hasLeadingColon;
- }
-
- /**
- *
- */
- protected StringAndOffset generateBraces() {
- StringBuffer buf = new StringBuffer();
- String lineDelimiter = fContext.getStructuredDocument().getLineDelimiter();
- CSSPreferenceHelper prefs = CSSPreferenceHelper.getInstance();
- String indentStr = prefs.getIndentString();
- if (prefs.isNewLineOnOpenBrace()) {
- buf.append(lineDelimiter);
- }
- buf.append("{");//$NON-NLS-1$
- if (prefs.isOnePropertyPerLine()) {
- buf.append(lineDelimiter);
- buf.append(indentStr);
- } else {
- buf.append(" ");//$NON-NLS-1$
- }
- int offset = buf.length();
- if (prefs.isOnePropertyPerLine()) {
- buf.append(lineDelimiter);
- } else {
- buf.append(" ");//$NON-NLS-1$
- }
- buf.append("}");//$NON-NLS-1$
- return new StringAndOffset(buf.toString(), offset);
- }
-
- /**
- *
- */
- protected StringAndOffset generateParenthesis() {
- StringBuffer buf = new StringBuffer();
- int offset;
- buf.append("(");//$NON-NLS-1$
- offset = 1;
- buf.append(")");//$NON-NLS-1$
- return new StringAndOffset(buf.toString(), offset);
- }
-
- /**
- *
- */
- protected StringAndOffset generateQuotes() {
- StringBuffer buf = new StringBuffer();
- char quoteChar = getQuoteChar();
- buf.append(quoteChar);
- buf.append(quoteChar);
- return new StringAndOffset(buf.toString(), 1);
- }
-
- /**
- *
- */
- protected StringAndOffset generateSemicolon() {
- StringBuffer buf = new StringBuffer();
- int offset;
- buf.append(";");//$NON-NLS-1$
- offset = 0;
- return new StringAndOffset(buf.toString(), offset);
- }
-
- /**
- *
- */
- protected StringAndOffset generateURI() {
- StringBuffer buf = new StringBuffer();
- CSSPreferenceHelper prefs = CSSPreferenceHelper.getInstance();
- char quoteChar = getQuoteChar();
- buf.append("url(");//$NON-NLS-1$
- if (prefs.isQuoteInURI()) {
- buf.append(quoteChar);
- }
- int offset = buf.length();
- if (prefs.isQuoteInURI()) {
- buf.append(quoteChar);
- }
- buf.append(")");//$NON-NLS-1$
- return new StringAndOffset(buf.toString(), offset);
- }
-
- abstract protected Iterator getCandidates();
-
- List getProposals() {
- List proposals = new ArrayList();
-
- CSSImageHelper imageHelper = CSSImageHelper.getInstance();
- Iterator i = getCandidates();
- while (i.hasNext()) {
- CSSCACandidate candidate = (CSSCACandidate) i.next();
- Image image = imageHelper.getImage(candidate.getImageType());
- ICompletionProposal item = new CompletionProposal(candidate.getReplacementString(), fContext.getReplaceBegin() + fContext.getDocumentOffset(), fContext.getTextToReplace().length(), candidate.getCursorPosition(), image, candidate.getDisplayString(), null, null);
- proposals.add(item);
- }
-
- return proposals;
- }
-
- /**
- *
- * @return char
- */
- private char getQuoteChar() {
- CSSPreferenceHelper prefs = CSSPreferenceHelper.getInstance();
- String quoteStr = prefs.getQuoteString(fContext.getModel());
- char quoteChar = (quoteStr != null && 0 < quoteStr.length()) ? quoteStr.charAt(0) : '"';
- char attrQuote = fContext.getQuoteOfStyleAttribute();
- if (attrQuote != 0) {
- if (attrQuote == '"' && quoteChar == '"') {
- quoteChar = '\'';
- } else if (attrQuote == '\'' && quoteChar == '\'') {
- quoteChar = '"';
- }
- }
- return quoteChar;
- }
-
- /**
- *
- */
- protected boolean isMatch(String text) {
- String textToCompare = fContext.getTextToCompare();
- if (textToCompare.length() == 0) {
- return true;
- } else {
- return (text.toUpperCase().indexOf(textToCompare.toUpperCase()) == 0);
- }
- /*
- * String textToReplace = fContext.getTextToReplace(); if
- * (textToReplace.length() == 0) { return true; } else { return
- * (text.toUpperCase().indexOf(textToReplace.toUpperCase()) == 0); }
- */
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForAtmarkRule.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForAtmarkRule.java
deleted file mode 100644
index 1539037d77..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForAtmarkRule.java
+++ /dev/null
@@ -1,293 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-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.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.core.util.SelectionCollector;
-import org.eclipse.wst.css.ui.image.CSSImageType;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-class CSSProposalGeneratorForAtmarkRule extends CSSProposalGenerator {
-
- private boolean fUseUpperCase = false;
- private static final String CHARSET = "@charset";//$NON-NLS-1$
- private static final String FONT_FACE = "@font-face";//$NON-NLS-1$
- private static final String IMPORT = "@import";//$NON-NLS-1$
- private static final String MEDIA = "@media";//$NON-NLS-1$
- private static final String PAGE = "@page";//$NON-NLS-1$
-
- /**
- * CSSAtmarkRuleProposalGenerator constructor comment.
- *
- * @param context
- * com.ibm.sed.contentassist.old.css.CSSContentAssistContext
- */
- CSSProposalGeneratorForAtmarkRule(CSSContentAssistContext context) {
- super(context);
- fUseUpperCase = CSSPreferenceHelper.getInstance().isIdentUpperCase();
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateCharsetRule() {
- // check content model
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_CHARSET_RULE).hasNext()) {
- return null;
- }
-
- // check if embedded or not
- if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
- return null;
- }
-
- // check if caret precede all other rules.
- int offset = fContext.getCursorPos();
- if (0 < offset) {
- SelectionCollector trav = new SelectionCollector();
- trav.setRegion(0, offset - 1);
- trav.apply(fContext.getModel().getDocument());
- Iterator i = trav.getSelectedNodes().iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof ICSSNode && !(obj instanceof ICSSDocument)) {
- return null;
- }
- }
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? CHARSET.toUpperCase() : CHARSET.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateQuotes();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- sao = generateSemicolon();
- buf.append(sao.fString);
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_CHARSET);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateFontFaceRule() {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_FONT_FACE_RULE).hasNext()) {
- return null;
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? FONT_FACE.toUpperCase() : FONT_FACE.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_FONTFACE);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateImportRule() {
- // check content model
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_IMPORT_RULE).hasNext()) {
- return null;
- }
-
- // charset and import can precede import rule.
- int offset = fContext.getCursorPos();
- if (0 < offset) {
- SelectionCollector trav = new SelectionCollector();
- trav.setRegion(0, offset - 1);
- trav.apply(fContext.getModel().getDocument());
- Iterator i = trav.getSelectedNodes().iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof ICSSNode && !(obj instanceof ICSSDocument || obj instanceof ICSSCharsetRule || obj instanceof ICSSImportRule)) {
- return null;
- }
- }
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? IMPORT.toUpperCase() : IMPORT.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateURI();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- sao = generateSemicolon();
- buf.append(sao.fString);
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_IMPORT);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidateMediaRule() {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_MEDIA_RULE).hasNext()) {
- return null;
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? MEDIA.toUpperCase() : MEDIA.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length() - 1;
- StringAndOffset sao;
- sao = generateBraces();
- buf.append(sao.fString);
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_MEDIA);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSCACandidate getCandidatePageRule() {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- if (!util.collectNodesByType(CSSMMNode.TYPE_PAGE_RULE).hasNext()) {
- return null;
- }
-
- int cursorPos = 0;
- String ident = (fUseUpperCase) ? PAGE.toUpperCase() : PAGE.toLowerCase();
- StringBuffer buf = new StringBuffer();
- buf.append(ident);
- buf.append(" ");//$NON-NLS-1$
- cursorPos = buf.length();
- StringAndOffset sao;
- sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
-
- String text = buf.toString();
-
- if (isMatch(text)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(ident);
- item.setImageType(CSSImageType.RULE_PAGE);
- return item;
- } else {
- return null;
- }
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- ITextRegion region = fContext.getTargetRegionPrevious();
- // ITextRegion region = fContext.getSignificantTargetRegion();
- if (region != null) {
- String type = region.getType();
- if (type != CSSRegionContexts.CSS_RBRACE && type != CSSRegionContexts.CSS_DELIMITER) {
- return candidates.iterator();
- }
- }
-
- CSSCACandidate item;
- if ((item = getCandidateImportRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidateCharsetRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidateMediaRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidatePageRule()) != null) {
- candidates.add(item);
- }
- if ((item = getCandidateFontFaceRule()) != null) {
- candidates.add(item);
- }
- return candidates.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationName.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationName.java
deleted file mode 100644
index 6bf20406c4..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationName.java
+++ /dev/null
@@ -1,171 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.ui.image.CSSImageType;
-import org.eclipse.wst.css.ui.preferences.CSSPreferenceManager;
-
-class CSSProposalGeneratorForDeclarationName extends CSSProposalGenerator {
-
- /**
- * CSSProposalGeneratorForDeclaration constructor comment.
- *
- * @param context
- * com.ibm.sed.contentassist.old.css.CSSContentAssistContext
- */
- CSSProposalGeneratorForDeclarationName(CSSContentAssistContext context) {
- super(context);
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- CSSPreferenceHelper prefs = CSSPreferenceHelper.getInstance();
- String preDelim = "";//$NON-NLS-1$
- for (int i = 0; i < prefs.getSpacesPreDelimiter(); i++) {
- preDelim += ' ';//$NON-NLS-1$
- }
- String postDelim = "";//$NON-NLS-1$
- for (int i = 0; i < prefs.getSpacesPostDelimiter(); i++) {
- postDelim += ' ';//$NON-NLS-1$
- }
-
- ICSSNode targetNode = fContext.getTargetNode();
- boolean bFontRule = false;
- for (ICSSNode node = targetNode; node != null; node = node.getParentNode()) {
- if (node instanceof org.w3c.dom.css.CSSFontFaceRule) {
- bFontRule = true;
- break;
- }
- }
-
- List names = new ArrayList();
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- Iterator iNames = util.collectNodesByType((bFontRule) ? CSSMMNode.TYPE_DESCRIPTOR : CSSMMNode.TYPE_PROPERTY);
- while (iNames.hasNext()) {
- CSSMMNode node = (CSSMMNode) iNames.next();
- names.add(node);
- }
- sortNames(names);
- //Collections.sort(names);
-
- boolean bAddColon = true;
- if (targetNode instanceof ICSSStyleDeclItem && fContext.targetHas(CSSRegionContexts.CSS_DECLARATION_SEPARATOR)) {
- bAddColon = false;
- }
-
- Iterator i = names.iterator();
- while (i.hasNext()) {
- CSSMMNode node = (CSSMMNode) i.next();
- String text = node.getName();
- text = (prefs.isPropNameUpperCase()) ? text.toUpperCase() : text.toLowerCase();
- if (!isMatch(text)) {
- continue;
- }
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- buf.append(text);
- buf.append(preDelim);
- cursorPos = buf.length();
- if (bAddColon) {
- buf.append(':');//$NON-NLS-1$
- buf.append(postDelim);
- cursorPos += 1 + postDelim.length();
- }
- // if (! (targetNode instanceof ICSSStyleDeclItem)) {
- // buf.append(';');//$NON-NLS-1$
- // }
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(text);
- item.setImageType(getCategoryImageType(node));
- candidates.add(item);
- }
-
- return candidates.iterator();
- }
-
- void sortNames(List names) {
- CSSPreferenceManager prefMan = CSSPreferenceManager.getInstance();
- final boolean categorize = prefMan.getContentAssistCategorize();
-
- Collections.sort(names, new Comparator() {
- public int compare(Object o1, Object o2) {
- CSSMMNode node1 = (CSSMMNode) o1;
- CSSMMNode node2 = (CSSMMNode) o2;
- if (node1 == null) {
- return 1;
- } else if (node2 == null) {
- return -1;
- }
- int diff = 0;
- if (categorize) {
- String category1 = node1.getAttribute("category"); //$NON-NLS-1$
- String category2 = node2.getAttribute("category"); //$NON-NLS-1$
- if (category1 == null) {
- if (category2 == null) {
- diff = 0;
- } else {
- return 1;
- }
- } else if (category2 == null) {
- return -1;
- } else {
- diff = category1.compareTo(category2);
- }
- }
- if (diff == 0) {
- String name = node1.getName();
- if (name == null) {
- return 1;
- } else {
- return name.compareTo(node2.getName());
- }
- } else {
- return diff;
- }
- }
- });
- }
-
- /*
- * retrieve default category icon name TODO: if node has "icon"(?), use
- * it.
- */
- CSSImageType getCategoryImageType(CSSMMNode node) {
- CSSImageType imageType = null;
- if (node != null) {
- String category = node.getAttribute("category"); //$NON-NLS-1$
- if (category != null) {
- imageType = CSSImageType.getImageType(category);
- }
- }
- return (imageType == null) ? CSSImageType.CATEGORY_DEFAULT : imageType;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationValue.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationValue.java
deleted file mode 100644
index f80c0f9575..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForDeclarationValue.java
+++ /dev/null
@@ -1,370 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-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.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.metamodel.CSSMMFunction;
-import org.eclipse.wst.css.core.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.metamodel.CSSMMNumber;
-import org.eclipse.wst.css.core.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.metamodel.CSSMMUnit;
-import org.eclipse.wst.css.core.metamodel.util.CSSFunctionID;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.core.util.CSSUtil;
-import org.eclipse.wst.css.core.util.RegionIterator;
-import org.eclipse.wst.css.ui.image.CSSImageType;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-class CSSProposalGeneratorForDeclarationValue extends CSSProposalGenerator {
-
- private static final String IMPORTANT = "!important"; //$NON-NLS-1$
- private boolean fUseUpperCase;
- private boolean fAppendSemiColon;
-
- /**
- * CSSProposalGeneratorForDeclarationValue constructor comment.
- *
- * @param context
- * com.ibm.sed.contentassist.old.css.CSSContentAssistContext
- */
- CSSProposalGeneratorForDeclarationValue(CSSContentAssistContext context) {
- super(context);
- fUseUpperCase = CSSPreferenceHelper.getInstance().isPropValueUpperCase();
- }
-
- /**
- *
- */
- private void addFunction(List candidates, CSSMMFunction prop) {
- String text = prop.toString();
- if (!isMatch(text)) {
- return;
- }
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- if (prop.getName().equals(CSSFunctionID.F_URI)) {
- StringAndOffset sao = generateURI();
- buf.append(sao.fString);
- cursorPos = sao.fOffset;
- } else {
- buf.append(prop.toString());
- cursorPos = buf.length();
- StringAndOffset sao = generateParenthesis();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- }
-
- text = buf.toString();
- text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- item.setCursorPosition(cursorPos);
- item.setDisplayString(text);
- item.setImageType(CSSImageType.VALUE_FUNCTION);
- appendSemiColon(item);
- candidates.add(item);
- }
-
- /**
- *
- */
- private void addNumber(List candidates, CSSMMNumber prop) {
- String fullText = fContext.getTextToReplace();
- // skip number
- int unitIndex = -1;
- for (int i = 0; i < fullText.length(); i++) {
- if (Character.isDigit(fullText.charAt(i))) {
- unitIndex = i + 1;
- } else {
- break;
- }
- }
-
- String unitSubText = ""; //$NON-NLS-1$
- String numSubText = ""; //$NON-NLS-1$
- if (0 <= unitIndex) {
- numSubText = fullText.substring(0, unitIndex);
- if (unitIndex < fullText.length()) {
- unitSubText = fullText.substring(unitIndex);
- }
- } else {
- unitSubText = fullText;
- }
-
- Iterator i = prop.getDescendants();
- while (i.hasNext()) {
- CSSMMUnit unit = (CSSMMUnit) i.next();
- String unitString = unit.getUnitString();
- if ((0 < unitSubText.length() && unitString.indexOf(unitSubText) != 0) || (0 < numSubText.length() && unitString.equals("#"))) { //$NON-NLS-1$
- continue;
- }
-
- String text = numSubText + unitString;
- text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- if (0 < numSubText.length() || text.equals("#")) { //$NON-NLS-1$
- item.setCursorPosition(text.length());
- } else {
- item.setCursorPosition(0);
- }
- item.setDisplayString(text);
- item.setImageType(CSSImageType.VALUE_NUMBER);
- appendSemiColon(item);
- candidates.add(item);
- }
- }
-
- /**
- *
- */
- private void checkSemiColon() {
- fAppendSemiColon = false;
-
- ITextRegion targetRegion = fContext.getTargetRegion();
- if (targetRegion != null && targetRegion.getType() != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // find trailing ":" or ";"
- // if ":" before ";" is found, add ";"
- RegionIterator iterator = fContext.getRegionIterator();
- IStructuredDocumentRegion container = iterator.getStructuredDocumentRegion();
- while (iterator.hasNext()) {
- ITextRegion region = iterator.next();
- if (iterator.getStructuredDocumentRegion() != container) {
- break;
- }
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- fAppendSemiColon = true;
- break;
- }
- }
- if (!fAppendSemiColon) {
- // second chance:
- // leading IStructuredDocumentRegion is not ";"
- IStructuredDocumentRegion nextStructuredDocumentRegion = CSSUtil.findNextSignificantNode(container);
- if (CSSUtil.getStructuredDocumentRegionType(nextStructuredDocumentRegion) != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- fAppendSemiColon = true;
- }
- }
- }
- }
-
- /**
- *
- */
- private void appendSemiColon(CSSCACandidate item) {
- if (fAppendSemiColon) {
- String replacementString = item.getReplacementString();
- item.setReplacementString(replacementString + ";"); //$NON-NLS-1$
- int cursorPosition = item.getCursorPosition();
- if (replacementString.length() <= cursorPosition) {
- // cursorpos is tail of string
- cursorPosition++;
- item.setCursorPosition(cursorPosition);
- }
- }
- }
-
- /**
- *
- */
- private void addSemiColon(List candidates) {
- ICSSNode targetNode = fContext.getTargetNode();
- if (targetNode instanceof ICSSStyleDeclItem) {
- ICSSNode firstChild = targetNode.getFirstChild();
- if (firstChild == null) {
- return;
- }
- if (firstChild instanceof IndexedRegion) {
- int startOffset = ((IndexedRegion) firstChild).getStartOffset();
- if (fContext.getCursorPos() <= startOffset) {
- return;
- }
- }
- }
-
- boolean bAddCloser = false;
-
- ITextRegion targetRegion = fContext.getTargetRegion();
- if (targetRegion != null && targetRegion.getType() != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // find trailing ":" or ";"
- // if ":" before ";" is found, add ";"
- RegionIterator iterator = fContext.getRegionIterator();
- IStructuredDocumentRegion container = iterator.getStructuredDocumentRegion();
- while (iterator.hasNext()) {
- ITextRegion region = iterator.next();
- if (iterator.getStructuredDocumentRegion() != container) {
- break;
- }
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- bAddCloser = true;
- break;
- }
- }
- if (!bAddCloser) {
- // second chance:
- // leading IStructuredDocumentRegion is not ";"
- IStructuredDocumentRegion nextStructuredDocumentRegion = CSSUtil.findNextSignificantNode(container);
- if (CSSUtil.getStructuredDocumentRegionType(nextStructuredDocumentRegion) != CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- bAddCloser = true;
- }
- }
- }
-
- if (bAddCloser) {
- CSSCACandidate item = new CSSCACandidate();
- String text = fContext.getTextToReplace() + ";";//$NON-NLS-1$
- item.setReplacementString(text);
- item.setCursorPosition(text.length());
- item.setDisplayString(";");//$NON-NLS-1$
- item.setImageType(null);
- candidates.add(item);
- }
- }
-
- /**
- *
- */
- private void addString(List candidates, String text) {
- if (!isMatch(text)) {
- return;
- }
-
- text = (fUseUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(text);
- item.setCursorPosition(text.length());
- item.setDisplayString(text);
- item.setImageType(CSSImageType.VALUE_STRING);
- appendSemiColon(item);
- candidates.add(item);
- }
-
- private void addImportant(List candidates) {
- ICSSNode targetNode = fContext.getTargetNode();
- while (targetNode instanceof ICSSPrimitiveValue) {
- targetNode = targetNode.getParentNode();
- }
- if (!(targetNode instanceof ICSSStyleDeclItem)) {
- return;
- }
- // 1. has no priority region
- // 2. cursor position is after of last child
- // 3. normal isMatch method
- String priority = ((ICSSStyleDeclItem) targetNode).getPriority();
- if (priority == null || priority.length() == 0) {
- ICSSNode lastChild = targetNode.getLastChild();
- if (lastChild instanceof IndexedRegion) {
- int startOffset = ((IndexedRegion) lastChild).getStartOffset();
- // int endOffset = ((IndexedRegion)lastChild).getEndOffset();
- if (startOffset < fContext.getCursorPos() && isMatch(IMPORTANT)) {
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(IMPORTANT);
- item.setCursorPosition(IMPORTANT.length());
- item.setDisplayString(IMPORTANT);
- item.setImageType(CSSImageType.VALUE_STRING);
- appendSemiColon(item);
- candidates.add(item);
- }
- }
- }
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- checkSemiColon(); // check should add semi-colon or not
-
- String name = getPropertyName();
- if (name != null) {
- CSSMetaModelUtil util = new CSSMetaModelUtil(fContext.getMetaModel());
- Iterator i = Collections.EMPTY_LIST.iterator();
- if (isFontFaceRule()) {
- CSSMMDescriptor desc = util.getDescriptor(name);
- if (desc != null) {
- i = desc.getValues();
- }
- } else {
- CSSMMProperty prop = util.getProperty(name);
- if (prop != null) {
- i = prop.getValues();
- }
- }
- while (i.hasNext()) {
- CSSMMNode val = (CSSMMNode) i.next();
- String valueType = val.getType();
- if (valueType == CSSMMNode.TYPE_KEYWORD) {
- addString(candidates, val.toString());
- } else if (valueType == CSSMMNode.TYPE_NUMBER) {
- addNumber(candidates, (CSSMMNumber) val);
- } else if (valueType == CSSMMNode.TYPE_FUNCTION) {
- addFunction(candidates, (CSSMMFunction) val);
- }
- }
- }
-
- addImportant(candidates);
- addSemiColon(candidates);
-
- return candidates.iterator();
- }
-
- /**
- * @return java.lang.String
- */
- private String getPropertyName() {
- ICSSNode targetNode = fContext.getTargetNode();
- while (targetNode instanceof ICSSPrimitiveValue) {
- targetNode = targetNode.getParentNode();
- }
- if (targetNode instanceof ICSSStyleDeclItem) {
- return ((ICSSStyleDeclItem) targetNode).getPropertyName();
- } else {
- return null;
- }
- }
-
- /**
- *
- */
- private boolean isFontFaceRule() {
- ICSSNode targetNode = fContext.getTargetNode();
- while (targetNode instanceof ICSSPrimitiveValue) {
- targetNode = targetNode.getParentNode();
- }
- if (targetNode instanceof ICSSStyleDeclItem) {
- targetNode = targetNode.getParentNode(); // get Declaration
- if (targetNode != null) {
- // inline style has no rule node
- targetNode = targetNode.getParentNode(); // get rule
- }
- }
- return (targetNode instanceof CSSFontFaceRule);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForHTMLTag.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForHTMLTag.java
deleted file mode 100644
index 02f250123c..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForHTMLTag.java
+++ /dev/null
@@ -1,157 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-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.CMNamedNodeMap;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.eclipse.wst.css.ui.image.CSSImageType;
-import org.eclipse.wst.html.core.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.sse.core.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-class CSSProposalGeneratorForHTMLTag extends CSSProposalGenerator {
-
- /**
- * CSSStyleRuleProposalGenerator constructor comment.
- *
- * @param context
- * com.ibm.sed.contentassist.old.css.CSSContentAssistContext
- */
- CSSProposalGeneratorForHTMLTag(CSSContentAssistContext context) {
- super(context);
-
- if (fHTMLTags == null) {
- fHTMLTags = setupHTMLTags();
- }
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- if (checkLeadingColon()) {
- return candidates.iterator();
- }
-
- // XHTML requires lower case
- boolean bLowerCase = false;
- if (fContext.getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
- Node domNode = fContext.getModel().getOwnerDOMNode();
- if (domNode != null && !(domNode instanceof Document)) {
- domNode = domNode.getOwnerDocument();
- if (domNode instanceof XMLDocument) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((XMLDocument) domNode).getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null)
- bLowerCase = (adapter.getTagNameCase() == DocumentTypeAdapter.LOWER_CASE);
- }
- }
- }
-
-
- int length = fHTMLTags.length;
- for (int i = 0; i < length; i++) {
- String tagText = fHTMLTags[i];
- if (bLowerCase) {
- tagText = tagText.toLowerCase();
- }
- if (!isMatch(tagText)) {
- continue;
- }
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- buf.append(tagText);
- cursorPos += tagText.length();
- boolean inRule = (fContext.getTargetNode() instanceof ICSSStyleRule);
- if (!inRule || fContext.getTextToReplace().length() == 0) {
- buf.append(" ");//$NON-NLS-1$
- cursorPos += 1;
- }
- if (!inRule) {
- StringAndOffset sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- }
-
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(tagText);
- item.setImageType(CSSImageType.SELECTOR_TAG);
- candidates.add(item);
- }
-
- return candidates.iterator();
- }
-
- /**
- *
- */
- private static String[] setupHTMLTags() {
- CMDocument cmdoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- CMNamedNodeMap elements = cmdoc.getElements();
- Vector names = new Vector();
- int nElements = elements.getLength();
- for (int i = 0; i < nElements; i++) {
- CMElementDeclaration edec = (CMElementDeclaration) elements.item(i);
- if (isAttrDefined(edec, HTML40Namespace.ATTR_NAME_STYLE)) {
- names.add(edec.getElementName());
- }
- }
- Collections.sort(names);
- String[] tags = new String[names.size()];
- Iterator iNames = names.iterator();
- for (int i = 0; iNames.hasNext(); i++) {
- tags[i] = (String) iNames.next();
- }
- return tags;
- }
-
- /**
- *
- */
- private static boolean isAttrDefined(CMElementDeclaration edec, String attrName) {
- if (edec == null) {
- return false;
- }
- CMNamedNodeMap attrs = edec.getAttributes();
- if (attrs == null) {
- return false;
- }
- for (int i = 0; i < attrs.getLength(); i++) {
- CMAttributeDeclaration attr = (CMAttributeDeclaration) attrs.item(i);
- if (attr == null) {
- continue;
- }
- if (attr.getAttrName().equalsIgnoreCase(attrName)) {
- return true;
- }
- }
- return false;
- }
-
- private static String[] fHTMLTags = null;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForPseudoSelector.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForPseudoSelector.java
deleted file mode 100644
index a9c92a5851..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/CSSProposalGeneratorForPseudoSelector.java
+++ /dev/null
@@ -1,157 +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.ui.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSPageRule;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.metamodel.CSSMMSelector;
-import org.eclipse.wst.css.core.metamodel.util.CSSMMTypeCollector;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.core.preferences.CSSPreferenceHelper;
-import org.eclipse.wst.css.ui.image.CSSImageType;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-/**
- *
- */
-class CSSProposalGeneratorForPseudoSelector extends CSSProposalGenerator {
-
- /**
- * CSSProposalGeneratorForPseudoSelector constructor comment.
- *
- * @param context
- * com.ibm.sed.contentassist.old.css.CSSContentAssistContext
- */
- CSSProposalGeneratorForPseudoSelector(CSSContentAssistContext context) {
- super(context);
- }
-
- /**
- * getCandidates method comment.
- */
- protected Iterator getCandidates() {
- List candidates = new ArrayList();
-
- boolean hasLeadingColon = checkLeadingColon();
- String textToReplace = fContext.getTextToReplace();
- if (!hasLeadingColon && 0 < textToReplace.length() && !textToReplace.equals(fContext.getTextToCompare())) {
- // cursor placed midpoint of the region
- return candidates.iterator();
- }
- ITextRegion region = fContext.getTargetRegion();
- if (region != null) {
- String type = region.getType();
- if (type != CSSRegionContexts.CSS_S && !CSSRegionUtil.isSelectorBegginingType(type)) {
- return candidates.iterator();
- }
- }
-
- boolean useUpperCase = CSSPreferenceHelper.getInstance().isIdentUpperCase();
-
- List tags = getSelectorTags();
- Collections.sort(tags);
- Iterator i = tags.iterator();
- while (i.hasNext()) {
- String text = (String) i.next();
- if (hasLeadingColon && !isMatch(text)) {
- continue;
- }
- text = (useUpperCase) ? text.toUpperCase() : text.toLowerCase();
-
- int cursorPos = 0;
- StringBuffer buf = new StringBuffer();
- if (hasLeadingColon) {
- buf.append(text.substring(1));
- } else {
- buf.append(textToReplace);
- buf.append(text);
- }
- cursorPos += buf.length();
-
- if (0 < buf.length()) {
- boolean inRule = (fContext.getTargetNode() instanceof ICSSStyleRule || fContext.getTargetNode() instanceof ICSSPageRule);
- if (!inRule || (textToReplace.length() == 0 && !hasLeadingColon)) {
- buf.append(" ");//$NON-NLS-1$
- cursorPos += 1;
- }
- if (!inRule) {
- StringAndOffset sao = generateBraces();
- buf.append(sao.fString);
- cursorPos += sao.fOffset;
- }
- CSSCACandidate item = new CSSCACandidate();
- item.setReplacementString(buf.toString());
- item.setCursorPosition(cursorPos);
- item.setDisplayString(text);
- item.setImageType(CSSImageType.SELECTOR_PSEUDO);
- candidates.add(item);
- }
- }
-
- return candidates.iterator();
- }
-
- /**
- *
- */
- List getSelectorTags() {
- List tagList = new ArrayList();
- ICSSNode targetNode = fContext.getTargetNode();
- String rootType = (targetNode instanceof ICSSPageRule) ? CSSMMNode.TYPE_PAGE_RULE : CSSMMNode.TYPE_STYLE_RULE;
-
- CSSMMTypeCollector collector = new CSSMMTypeCollector();
- collector.collectNestedType(false);
- collector.apply(fContext.getMetaModel(), rootType);
- Iterator i;
- i = collector.getNodes();
- if (!i.hasNext()) {
- return tagList;
- }
- CSSMMNode node = (CSSMMNode) i.next();
- i = node.getChildNodes();
- while (i.hasNext()) {
- CSSMMNode child = (CSSMMNode) i.next();
- if (child.getType() == CSSMMNode.TYPE_SELECTOR) {
- String selType = ((CSSMMSelector) child).getSelectorType();
- if (selType == CSSMMSelector.TYPE_PSEUDO_CLASS || selType == CSSMMSelector.TYPE_PSEUDO_ELEMENT) {
- tagList.add(((CSSMMSelector) child).getSelectorString());
- }
- }
- }
- return tagList;
- }
-
- /**
- *
- */
- protected boolean isMatch(String text) {
- if (!super.isMatch(text)) {
- ITextRegion region = fContext.getTargetRegion();
- if (region != null && region.getType() == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/HTML40Namespace.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/HTML40Namespace.java
deleted file mode 100644
index 2d4ce3253b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentassist/HTML40Namespace.java
+++ /dev/null
@@ -1,889 +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.ui.contentassist;
-
-
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface HTML40Namespace {
-
- // Element names
- public static interface ElementName {
- public static final String A = "A"; //$NON-NLS-1$
- public static final String ABBR = "ABBR"; //$NON-NLS-1$
- public static final String ACRONYM = "ACRONYM"; //$NON-NLS-1$
- public static final String ADDRESS = "ADDRESS"; //$NON-NLS-1$
- public static final String APPLET = "APPLET"; //$NON-NLS-1$
- public static final String AREA = "AREA"; //$NON-NLS-1$
- public static final String B = "B"; //$NON-NLS-1$
- public static final String BASE = "BASE"; //$NON-NLS-1$
- public static final String BASEFONT = "BASEFONT"; //$NON-NLS-1$
- public static final String BDO = "BDO"; //$NON-NLS-1$
- public static final String BGSOUND = "BGSOUND"; // D205513
- // //$NON-NLS-1$
- public static final String BIG = "BIG"; //$NON-NLS-1$
- public static final String BLINK = "BLINK"; //$NON-NLS-1$
- public static final String BLOCKQUOTE = "BLOCKQUOTE"; //$NON-NLS-1$
- public static final String BODY = "BODY"; //$NON-NLS-1$
- public static final String BR = "BR"; //$NON-NLS-1$
- public static final String BUTTON = "BUTTON"; //$NON-NLS-1$
- public static final String CAPTION = "CAPTION"; //$NON-NLS-1$
- public static final String CENTER = "CENTER"; //$NON-NLS-1$
- public static final String CITE = "CITE"; //$NON-NLS-1$
- public static final String CODE = "CODE"; //$NON-NLS-1$
- public static final String COL = "COL"; //$NON-NLS-1$
- public static final String COLGROUP = "COLGROUP"; //$NON-NLS-1$
- public static final String DD = "DD"; //$NON-NLS-1$
- public static final String DEL = "DEL"; //$NON-NLS-1$
- public static final String DFN = "DFN"; //$NON-NLS-1$
- public static final String DIR = "DIR"; //$NON-NLS-1$
- public static final String DIV = "DIV"; //$NON-NLS-1$
- public static final String DL = "DL"; //$NON-NLS-1$
- public static final String DT = "DT"; //$NON-NLS-1$
- public static final String EM = "EM"; //$NON-NLS-1$
- public static final String EMBED = "EMBED"; //$NON-NLS-1$
- public static final String FIELDSET = "FIELDSET"; //$NON-NLS-1$
- public static final String FONT = "FONT"; //$NON-NLS-1$
- public static final String FORM = "FORM"; //$NON-NLS-1$
- public static final String FRAME = "FRAME"; //$NON-NLS-1$
- public static final String FRAMESET = "FRAMESET"; //$NON-NLS-1$
- public static final String H1 = "H1"; //$NON-NLS-1$
- public static final String H2 = "H2"; //$NON-NLS-1$
- public static final String H3 = "H3"; //$NON-NLS-1$
- public static final String H4 = "H4"; //$NON-NLS-1$
- public static final String H5 = "H5"; //$NON-NLS-1$
- public static final String H6 = "H6"; //$NON-NLS-1$
- public static final String HEAD = "HEAD"; //$NON-NLS-1$
- public static final String HR = "HR"; //$NON-NLS-1$
- public static final String HTML = "HTML"; //$NON-NLS-1$
- public static final String I = "I"; //$NON-NLS-1$
- public static final String IFRAME = "IFRAME"; //$NON-NLS-1$
- public static final String IMG = "IMG"; //$NON-NLS-1$
- public static final String INPUT = "INPUT"; //$NON-NLS-1$
- public static final String INS = "INS"; //$NON-NLS-1$
- public static final String ISINDEX = "ISINDEX"; //$NON-NLS-1$
- public static final String KBD = "KBD"; //$NON-NLS-1$
- public static final String LABEL = "LABEL"; //$NON-NLS-1$
- public static final String LEGEND = "LEGEND"; //$NON-NLS-1$
- public static final String LI = "LI"; //$NON-NLS-1$
- public static final String LINK = "LINK"; //$NON-NLS-1$
- public static final String MAP = "MAP"; //$NON-NLS-1$
- public static final String MENU = "MENU"; //$NON-NLS-1$
- public static final String META = "META"; //$NON-NLS-1$
- public static final String NOBR = "NOBR"; // D205513 //$NON-NLS-1$
- public static final String NOEMBED = "NOEMBED"; //$NON-NLS-1$
- public static final String NOFRAMES = "NOFRAMES"; //$NON-NLS-1$
- public static final String NOSCRIPT = "NOSCRIPT"; //$NON-NLS-1$
- public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
- public static final String OL = "OL"; //$NON-NLS-1$
- public static final String OPTGROUP = "OPTGROUP"; //$NON-NLS-1$
- public static final String OPTION = "OPTION"; //$NON-NLS-1$
- public static final String P = "P"; //$NON-NLS-1$
- public static final String PARAM = "PARAM"; //$NON-NLS-1$
- public static final String PRE = "PRE"; //$NON-NLS-1$
- public static final String Q = "Q"; //$NON-NLS-1$
- public static final String S = "S"; //$NON-NLS-1$
- public static final String SAMP = "SAMP"; //$NON-NLS-1$
- public static final String SCRIPT = "SCRIPT"; //$NON-NLS-1$
- public static final String SELECT = "SELECT"; //$NON-NLS-1$
- public static final String SMALL = "SMALL"; //$NON-NLS-1$
- public static final String SPAN = "SPAN"; //$NON-NLS-1$
- public static final String STRIKE = "STRIKE"; //$NON-NLS-1$
- public static final String STRONG = "STRONG"; //$NON-NLS-1$
- public static final String STYLE = "STYLE"; //$NON-NLS-1$
- public static final String SUB = "SUB"; //$NON-NLS-1$
- public static final String SUP = "SUP"; //$NON-NLS-1$
- public static final String TABLE = "TABLE"; //$NON-NLS-1$
- public static final String TBODY = "TBODY"; //$NON-NLS-1$
- public static final String TD = "TD"; //$NON-NLS-1$
- public static final String TEXTAREA = "TEXTAREA"; //$NON-NLS-1$
- public static final String TFOOT = "TFOOT"; //$NON-NLS-1$
- public static final String TH = "TH"; //$NON-NLS-1$
- public static final String THEAD = "THEAD"; //$NON-NLS-1$
- public static final String TITLE = "TITLE"; //$NON-NLS-1$
- public static final String TR = "TR"; //$NON-NLS-1$
- public static final String TT = "TT"; //$NON-NLS-1$
- public static final String U = "U"; //$NON-NLS-1$
- public static final String UL = "UL"; //$NON-NLS-1$
- public static final String VAR = "VAR"; //$NON-NLS-1$
- public static final String WBR = "WBR"; // D205513 //$NON-NLS-1$
- public static final String MARQUEE = "MARQUEE"; //$NON-NLS-1$
- public static final String SSI_CONFIG = "SSI:CONFIG"; // D210393
- // //$NON-NLS-1$
- public static final String SSI_ECHO = "SSI:ECHO"; //$NON-NLS-1$
- public static final String SSI_EXEC = "SSI:EXEC"; //$NON-NLS-1$
- public static final String SSI_FSIZE = "SSI:FSIZE"; //$NON-NLS-1$
- public static final String SSI_FLASTMOD = "SSI:FLASTMOD"; //$NON-NLS-1$
- public static final String SSI_INCLUDE = "SSI:INCLUDE"; //$NON-NLS-1$
- public static final String SSI_PRINTENV = "SSI:PRINTENV"; //$NON-NLS-1$
- public static final String SSI_SET = "SSI:SET"; //$NON-NLS-1$
- public static final String WML_WML = "wml"; //$NON-NLS-1$
- public static final String WML_CARD = "card"; //$NON-NLS-1$
- public static final String WML_TEMPLATE = "template"; //$NON-NLS-1$
- public static final String WML_ACCESS = "access"; //$NON-NLS-1$
- public static final String WML_DO = "do"; //$NON-NLS-1$
- public static final String WML_ONEVENT = "onevent"; //$NON-NLS-1$
- public static final String WML_TIMER = "timer"; //$NON-NLS-1$
- public static final String WML_ANCHOR = "anchor"; //$NON-NLS-1$
- public static final String WML_PREV = "prev"; //$NON-NLS-1$
- public static final String WML_REFRESH = "refresh"; //$NON-NLS-1$
- public static final String WML_GO = "go"; //$NON-NLS-1$
- public static final String WML_NOOP = "noop"; //$NON-NLS-1$
- public static final String WML_SETVAR = "setvar"; //$NON-NLS-1$
- public static final String WML_POSTFIELD = "postfield"; //$NON-NLS-1$
- }
-
- // Character Entities
- public static interface EntityName {
- public static final String AACUTE_U = "Aacute"; //$NON-NLS-1$
- public static final String AACUTE_L = "aacute"; //$NON-NLS-1$
- public static final String ACIRC_U = "Acirc"; //$NON-NLS-1$
- public static final String ACIRC_L = "acirc"; //$NON-NLS-1$
- public static final String ACUTE = "acute"; //$NON-NLS-1$
- public static final String AELIG_U = "AElig"; //$NON-NLS-1$
- public static final String AELIG_L = "aelig"; //$NON-NLS-1$
- public static final String AGRAVE_U = "Agrave"; //$NON-NLS-1$
- public static final String AGRAVE_L = "agrave"; //$NON-NLS-1$
- public static final String ALEFSYM = "alefsym"; //$NON-NLS-1$
- public static final String ALPHA_U = "Alpha"; //$NON-NLS-1$
- public static final String ALPHA_L = "alpha"; //$NON-NLS-1$
- public static final String AMP = "amp"; //$NON-NLS-1$
- public static final String AND = "and"; //$NON-NLS-1$
- public static final String ANG = "ang"; //$NON-NLS-1$
- public static final String ARING_U = "Aring"; //$NON-NLS-1$
- public static final String ARING_L = "aring"; //$NON-NLS-1$
- public static final String ASYMP = "asymp"; //$NON-NLS-1$
- public static final String ATILDE_U = "Atilde"; //$NON-NLS-1$
- public static final String ATILDE_L = "atilde"; //$NON-NLS-1$
- public static final String AUML_U = "Auml"; //$NON-NLS-1$
- public static final String AUML_L = "auml"; //$NON-NLS-1$
- public static final String BDQUO = "bdquo"; //$NON-NLS-1$
- public static final String BETA_U = "Beta"; //$NON-NLS-1$
- public static final String BETA_L = "beta"; //$NON-NLS-1$
- public static final String BRVBAR = "brvbar"; //$NON-NLS-1$
- public static final String BULL = "bull"; //$NON-NLS-1$
- public static final String CAP = "cap"; //$NON-NLS-1$
- public static final String CCEDIL_U = "Ccedil"; //$NON-NLS-1$
- public static final String CCEDIL_L = "ccedil"; //$NON-NLS-1$
- public static final String CEDIL = "cedil"; //$NON-NLS-1$
- public static final String CENT = "cent"; //$NON-NLS-1$
- public static final String CHI_U = "Chi"; //$NON-NLS-1$
- public static final String CHI_L = "chi"; //$NON-NLS-1$
- public static final String CIRC = "circ"; //$NON-NLS-1$
- public static final String CLUBS = "clubs"; //$NON-NLS-1$
- public static final String CONG = "cong"; //$NON-NLS-1$
- public static final String COPY = "copy"; //$NON-NLS-1$
- public static final String CRARR = "crarr"; //$NON-NLS-1$
- public static final String CUP = "cup"; //$NON-NLS-1$
- public static final String CURREN = "curren"; //$NON-NLS-1$
- public static final String DAGGER_U = "Dagger"; //$NON-NLS-1$
- public static final String DAGGER_L = "dagger"; //$NON-NLS-1$
- public static final String DARR_U = "dArr"; //$NON-NLS-1$
- public static final String DARR_L = "darr"; //$NON-NLS-1$
- public static final String DEG = "deg"; //$NON-NLS-1$
- public static final String DELTA_U = "Delta"; //$NON-NLS-1$
- public static final String DELTA_L = "delta"; //$NON-NLS-1$
- public static final String DIAMS = "diams"; //$NON-NLS-1$
- public static final String DIVIDE = "divide"; //$NON-NLS-1$
- public static final String EACUTE_U = "Eacute"; //$NON-NLS-1$
- public static final String EACUTE_L = "eacute"; //$NON-NLS-1$
- public static final String ECIRC_U = "Ecirc"; //$NON-NLS-1$
- public static final String ECIRC_L = "ecirc"; //$NON-NLS-1$
- public static final String EGRAVE_U = "Egrave"; //$NON-NLS-1$
- public static final String EGRAVE_L = "egrave"; //$NON-NLS-1$
- public static final String EMPTY = "empty"; //$NON-NLS-1$
- public static final String EMSP = "emsp"; //$NON-NLS-1$
- public static final String ENSP = "ensp"; //$NON-NLS-1$
- public static final String EPSILON_U = "Epsilon"; //$NON-NLS-1$
- public static final String EPSILON_L = "epsilon"; //$NON-NLS-1$
- public static final String EQUIV = "equiv"; //$NON-NLS-1$
- public static final String ETA_U = "Eta"; //$NON-NLS-1$
- public static final String ETA_L = "eta"; //$NON-NLS-1$
- public static final String ETH_U = "ETH"; //$NON-NLS-1$
- public static final String ETH_L = "eth"; //$NON-NLS-1$
- public static final String EUML_U = "Euml"; //$NON-NLS-1$
- public static final String EUML_L = "euml"; //$NON-NLS-1$
- public static final String EURO = "euro"; //$NON-NLS-1$
- public static final String EXIST = "exist"; //$NON-NLS-1$
- public static final String FNOF = "fnof"; //$NON-NLS-1$
- public static final String FORALL = "forall"; //$NON-NLS-1$
- public static final String FRAC12 = "frac12"; //$NON-NLS-1$
- public static final String FRAC14 = "frac14"; //$NON-NLS-1$
- public static final String FRAC34 = "frac34"; //$NON-NLS-1$
- public static final String FRASL = "frasl"; //$NON-NLS-1$
- public static final String GAMMA_U = "Gamma"; //$NON-NLS-1$
- public static final String GAMMA_L = "gamma"; //$NON-NLS-1$
- public static final String GE = "ge"; //$NON-NLS-1$
- public static final String GT = "gt"; //$NON-NLS-1$
- public static final String HARR_U = "hArr"; //$NON-NLS-1$
- public static final String HARR_L = "harr"; //$NON-NLS-1$
- public static final String HEARTS = "hearts"; //$NON-NLS-1$
- public static final String HELLIP = "hellip"; //$NON-NLS-1$
- public static final String IACUTE_U = "Iacute"; //$NON-NLS-1$
- public static final String IACUTE_L = "iacute"; //$NON-NLS-1$
- public static final String ICIRC_U = "Icirc"; //$NON-NLS-1$
- public static final String ICIRC_L = "icirc"; //$NON-NLS-1$
- public static final String IEXCL = "iexcl"; //$NON-NLS-1$
- public static final String IGRAVE_U = "Igrave"; //$NON-NLS-1$
- public static final String IGRAVE_L = "igrave"; //$NON-NLS-1$
- public static final String IMAGE = "image"; //$NON-NLS-1$
- public static final String INFIN = "infin"; //$NON-NLS-1$
- public static final String INT = "int"; //$NON-NLS-1$
- public static final String IOTA_U = "Iota"; //$NON-NLS-1$
- public static final String IOTA_L = "iota"; //$NON-NLS-1$
- public static final String IQUEST = "iquest"; //$NON-NLS-1$
- public static final String ISIN = "isin"; //$NON-NLS-1$
- public static final String IUML_U = "Iuml"; //$NON-NLS-1$
- public static final String IUML_L = "iuml"; //$NON-NLS-1$
- public static final String KAPPA_U = "Kappa"; //$NON-NLS-1$
- public static final String KAPPA_L = "kappa"; //$NON-NLS-1$
- public static final String LAMBDA_U = "Lambda"; //$NON-NLS-1$
- public static final String LAMBDA_L = "lambda"; //$NON-NLS-1$
- public static final String LANG = "lang"; //$NON-NLS-1$
- public static final String LAQUO = "laquo"; //$NON-NLS-1$
- public static final String LARR_U = "lArr"; //$NON-NLS-1$
- public static final String LARR_L = "larr"; //$NON-NLS-1$
- public static final String LCEIL = "lceil"; //$NON-NLS-1$
- public static final String LDQUO = "ldquo"; //$NON-NLS-1$
- public static final String LE = "le"; //$NON-NLS-1$
- public static final String LFLOOR = "lfloor"; //$NON-NLS-1$
- public static final String LOWAST = "lowast"; //$NON-NLS-1$
- public static final String LOZ = "loz"; //$NON-NLS-1$
- public static final String LRM = "lrm"; //$NON-NLS-1$
- public static final String LSAQUO = "lsaquo"; //$NON-NLS-1$
- public static final String LSQUO = "lsquo"; //$NON-NLS-1$
- public static final String LT = "lt"; //$NON-NLS-1$
- public static final String MACR = "macr"; //$NON-NLS-1$
- public static final String MDASH = "mdash"; //$NON-NLS-1$
- public static final String MICRO = "micro"; //$NON-NLS-1$
- public static final String MIDDOT = "middot"; //$NON-NLS-1$
- public static final String MINUS = "minus"; //$NON-NLS-1$
- public static final String MU_U = "Mu"; //$NON-NLS-1$
- public static final String MU_L = "mu"; //$NON-NLS-1$
- public static final String NABLA = "nabla"; //$NON-NLS-1$
- public static final String NBSP = "nbsp"; //$NON-NLS-1$
- public static final String NDASH = "ndash"; //$NON-NLS-1$
- public static final String NE = "ne"; //$NON-NLS-1$
- public static final String NI = "ni"; //$NON-NLS-1$
- public static final String NOT = "not"; //$NON-NLS-1$
- public static final String NOTIN = "notin"; //$NON-NLS-1$
- public static final String NSUB = "nsub"; //$NON-NLS-1$
- public static final String NTILDE_U = "Ntilde"; //$NON-NLS-1$
- public static final String NTILDE_L = "ntilde"; //$NON-NLS-1$
- public static final String NU_U = "Nu"; //$NON-NLS-1$
- public static final String NU_L = "nu"; //$NON-NLS-1$
- public static final String OACUTE_U = "Oacute"; //$NON-NLS-1$
- public static final String OACUTE_L = "oacute"; //$NON-NLS-1$
- public static final String OCIRC_U = "Ocirc"; //$NON-NLS-1$
- public static final String OCIRC_L = "ocirc"; //$NON-NLS-1$
- public static final String OELIG_U = "OElig"; //$NON-NLS-1$
- public static final String OELIG_L = "oelig"; //$NON-NLS-1$
- public static final String OGRAVE_U = "Ograve"; //$NON-NLS-1$
- public static final String OGRAVE_L = "ograve"; //$NON-NLS-1$
- public static final String OLINE = "oline"; //$NON-NLS-1$
- public static final String OMEGA_U = "Omega"; //$NON-NLS-1$
- public static final String OMEGA_L = "omega"; //$NON-NLS-1$
- public static final String OMICRON_U = "Omicron"; //$NON-NLS-1$
- public static final String OMICRON_L = "omicron"; //$NON-NLS-1$
- public static final String OPLUS = "oplus"; //$NON-NLS-1$
- public static final String OR = "or"; //$NON-NLS-1$
- public static final String ORDF = "ordf"; //$NON-NLS-1$
- public static final String ORDM = "ordm"; //$NON-NLS-1$
- public static final String OSLASH_U = "Oslash"; //$NON-NLS-1$
- public static final String OSLASH_L = "oslash"; //$NON-NLS-1$
- public static final String OTILDE_U = "Otilde"; //$NON-NLS-1$
- public static final String OTILDE_L = "otilde"; //$NON-NLS-1$
- public static final String OTIMES = "otimes"; //$NON-NLS-1$
- public static final String OUML_U = "Ouml"; //$NON-NLS-1$
- public static final String OUML_L = "ouml"; //$NON-NLS-1$
- public static final String PARA = "para"; //$NON-NLS-1$
- public static final String PART = "part"; //$NON-NLS-1$
- public static final String PERMIL = "permil"; //$NON-NLS-1$
- public static final String PERP = "perp"; //$NON-NLS-1$
- public static final String PHI_U = "Phi"; //$NON-NLS-1$
- public static final String PHI_L = "phi"; //$NON-NLS-1$
- public static final String PI_U = "Pi"; //$NON-NLS-1$
- public static final String PI_L = "pi"; //$NON-NLS-1$
- public static final String PIV = "piv"; //$NON-NLS-1$
- public static final String PLUSMN = "plusmn"; //$NON-NLS-1$
- public static final String POUND = "pound"; //$NON-NLS-1$
- public static final String PRIME_U = "Prime"; //$NON-NLS-1$
- public static final String PRIME_L = "prime"; //$NON-NLS-1$
- public static final String PROD = "prod"; //$NON-NLS-1$
- public static final String PROP = "prop"; //$NON-NLS-1$
- public static final String PSI_U = "Psi"; //$NON-NLS-1$
- public static final String PSI_L = "psi"; //$NON-NLS-1$
- public static final String QUOT = "quot"; //$NON-NLS-1$
- public static final String RADIC = "radic"; //$NON-NLS-1$
- public static final String RANG = "rang"; //$NON-NLS-1$
- public static final String RAQUO = "raquo"; //$NON-NLS-1$
- public static final String RARR_U = "rArr"; //$NON-NLS-1$
- public static final String RARR_L = "rarr"; //$NON-NLS-1$
- public static final String RCEIL = "rceil"; //$NON-NLS-1$
- public static final String RDQUO = "rdquo"; //$NON-NLS-1$
- public static final String REAL = "real"; //$NON-NLS-1$
- public static final String REG = "reg"; //$NON-NLS-1$
- public static final String RFLOOR = "rfloor"; //$NON-NLS-1$
- public static final String RHO_U = "Rho"; //$NON-NLS-1$
- public static final String RHO_L = "rho"; //$NON-NLS-1$
- public static final String RLM = "rlm"; //$NON-NLS-1$
- public static final String RSAQUO = "rsaquo"; //$NON-NLS-1$
- public static final String RSQUO = "rsquo"; //$NON-NLS-1$
- public static final String SBQUO = "sbquo"; //$NON-NLS-1$
- public static final String SCARON_U = "Scaron"; //$NON-NLS-1$
- public static final String SCARON_L = "scaron"; //$NON-NLS-1$
- public static final String SDOT = "sdot"; //$NON-NLS-1$
- public static final String SECT = "sect"; //$NON-NLS-1$
- public static final String SHY = "shy"; //$NON-NLS-1$
- public static final String SIGMA_U = "Sigma"; //$NON-NLS-1$
- public static final String SIGMA_L = "sigma"; //$NON-NLS-1$
- public static final String SIGMAF = "sigmaf"; //$NON-NLS-1$
- public static final String SIM = "sim"; //$NON-NLS-1$
- public static final String SPADES = "spades"; //$NON-NLS-1$
- public static final String SUB = "sub"; //$NON-NLS-1$
- public static final String SUBE = "sube"; //$NON-NLS-1$
- public static final String SUM = "sum"; //$NON-NLS-1$
- public static final String SUP = "sup"; //$NON-NLS-1$
- public static final String SUP1 = "sup1"; //$NON-NLS-1$
- public static final String SUP2 = "sup2"; //$NON-NLS-1$
- public static final String SUP3 = "sup3"; //$NON-NLS-1$
- public static final String SUPE = "supe"; //$NON-NLS-1$
- public static final String SZLIG = "szlig"; //$NON-NLS-1$
- public static final String TAU_U = "Tau"; //$NON-NLS-1$
- public static final String TAU_L = "tau"; //$NON-NLS-1$
- public static final String THERE4 = "there4"; //$NON-NLS-1$
- public static final String THETA_U = "Theta"; //$NON-NLS-1$
- public static final String THETA_L = "theta"; //$NON-NLS-1$
- public static final String THETASYM = "thetasym"; //$NON-NLS-1$
- public static final String THINSP = "thinsp"; //$NON-NLS-1$
- public static final String THORN_U = "THORN"; //$NON-NLS-1$
- public static final String THORN_L = "thorn"; //$NON-NLS-1$
- public static final String TILDE = "tilde"; //$NON-NLS-1$
- public static final String TIMES = "times"; //$NON-NLS-1$
- public static final String TRADE = "trade"; //$NON-NLS-1$
- public static final String UACUTE_U = "Uacute"; //$NON-NLS-1$
- public static final String UACUTE_L = "uacute"; //$NON-NLS-1$
- public static final String UARR_U = "uArr"; //$NON-NLS-1$
- public static final String UARR_L = "uarr"; //$NON-NLS-1$
- public static final String UCIRC_U = "Ucirc"; //$NON-NLS-1$
- public static final String UCIRC_L = "ucirc"; //$NON-NLS-1$
- public static final String UGRAVE_U = "Ugrave"; //$NON-NLS-1$
- public static final String UGRAVE_L = "ugrave"; //$NON-NLS-1$
- public static final String UML = "uml"; //$NON-NLS-1$
- public static final String UPSIH = "upsih"; //$NON-NLS-1$
- public static final String UPSILON_U = "Upsilon"; //$NON-NLS-1$
- public static final String UPSILON_L = "upsilon"; //$NON-NLS-1$
- public static final String UUML_U = "Uuml"; //$NON-NLS-1$
- public static final String UUML_L = "uuml"; //$NON-NLS-1$
- public static final String WEIERP = "weierp"; //$NON-NLS-1$
- public static final String XI_U = "Xi"; //$NON-NLS-1$
- public static final String XI_L = "xi"; //$NON-NLS-1$
- public static final String YACUTE_U = "Yacute"; //$NON-NLS-1$
- public static final String YACUTE_L = "yacute"; //$NON-NLS-1$
- public static final String YEN = "yen"; //$NON-NLS-1$
- public static final String YUML_U = "Yuml"; //$NON-NLS-1$
- public static final String YUML_L = "yuml"; //$NON-NLS-1$
- public static final String ZETA_U = "Zeta"; //$NON-NLS-1$
- public static final String ZETA_L = "zeta"; //$NON-NLS-1$
- public static final String ZWJ = "zwj"; //$NON-NLS-1$
- public static final String ZWNJ = "zwnj"; //$NON-NLS-1$
- }
-
- public static final String HTML40_URI = "http://www.w3.org/TR/REC-html40/frameset.dtd"; //$NON-NLS-1$
- public static final String HTML40_TAG_PREFIX = ""; //$NON-NLS-1$
- // global attribute names
- public static final String ATTR_NAME_ID = "id"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CLASS = "class"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_STYLE = "style"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TITLE = "title"; // %coreattrs;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LANG = "lang"; // %i18n;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DIR = "dir"; // %i18n; //$NON-NLS-1$
- public static final String ATTR_NAME_ONCLICK = "onclick"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONDBLCLICK = "ondblclick"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEDOWN = "onmousedown"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEUP = "onmouseup"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOVER = "onmouseover"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEMOVE = "onmousemove"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONMOUSEOUT = "onmouseout"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYPRESS = "onkeypress"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYDOWN = "onkeydown"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONKEYUP = "onkeyup"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONHELP = "onhelp"; // %events;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BGCOLOR = "bgcolor"; // %bodycolor;,
- // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TEXT = "text"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LINK = "link"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VLINK = "vlink"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ALINK = "alink"; // %bodycolor;
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VERSION = "version"; // HTML
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PROFILE = "profile"; // HEAD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONLOAD = "onload"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONUNLOAD = "onunload"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BACKGROUND = "background"; // BODY,
- // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SRC = "src"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALT = "alt"; // IMG,AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LONGDESC = "longdesc"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NAME = "name"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_HEIGHT = "height"; // IMG, TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_WIDTH = "width"; // IMG, TABLE,HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_USEMAP = "usemap"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ISMAP = "ismap"; // IMG //$NON-NLS-1$
- public static final String ATTR_NAME_ALIGN = "align"; // IMG, TABLE,HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BORDER = "border"; // IMG, TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HSPACE = "hspace"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VSPACE = "vspace"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MAPFILE = "mapfile"; // IMG
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SUMMARY = "summary"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FRAME = "frame"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_RULES = "rules"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CELLSPACING = "cellspacing"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CELLPADDING = "cellpadding"; // TABLE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DATAPAGESIZE = "datapagesize"; // TABLE,HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COLOR = "color"; // BASEFONT,FONT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FACE = "face"; // BASEFONT,FONT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SIZE = "size"; // BASEFONT,FONT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CLEAR = "clear"; // BR //$NON-NLS-1$
- public static final String ATTR_NAME_SHAPE = "shape"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COORDS = "coords"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HREF = "href"; // AREA //$NON-NLS-1$
- public static final String ATTR_NAME_TARGET = "target"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NOHREF = "nohref"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TABINDEX = "tabindex"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACCESSKEY = "accesskey"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONFOCUS = "onfocus"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONBLUR = "onblur"; // AREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CHARSET = "charset"; // LINK
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HREFLANG = "hreflang"; // LINK
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TYPE = "type"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REL = "rel"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_REV = "rev"; // LINK //$NON-NLS-1$
- public static final String ATTR_NAME_MEDIA = "media"; // LINK
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VALUE = "value"; // PARAM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VALUETYPE = "valuetype"; // PARAM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NOSHADE = "noshade"; // HR
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CHECKED = "checked"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DISABLED = "disabled"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_READONLY = "readonly"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MAXLENGTH = "maxlength"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONSELECT = "onselect"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONCHANGE = "onchange"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT = "accept"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ISTYLE = "istyle"; // INPUT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CHAR = "char"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_CHAROFF = "charoff"; // COL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VALIGN = "valign"; // COL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SPAN = "span"; // COL //$NON-NLS-1$
- public static final String ATTR_NAME_FRAMEBORDER = "frameborder"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINWIDTH = "marginwidth"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MARGINHEIGHT = "marginheight"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NORESIZE = "noresize"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLING = "scrolling"; // FRAME
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PROMPT = "prompt"; // ISINDEX
- // //$NON-NLS-1$
- public static final String ATTR_NAME_HTTP_EQUIV = "http-equiv"; // META
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CONTENT = "content"; // META
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCHEME = "scheme"; // META
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ERRMSG = "errmsg"; // ssi:config
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SIZEFMT = "sizefmt"; // ssi:config
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TIMEFMT = "timefmt"; // ssi:config
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VAR = "var"; // ssi:echo
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CGI = "cgi"; // ssi:exec
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CMD = "cmd"; // ssi:exec
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FILE = "file"; // ssi:fsize
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VIRTUAL = "virtual"; // ssi:fsize
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SELECTED = "selected"; // OPTION
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LABEL = "label"; // OPTION
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ROWS = "rows"; // TEXTAREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COLS = "cols"; // TEXTAREA
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LANGUAGE = "language"; // SCRIPT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DEFER = "defer"; // SCRIPT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_EVENT = "event"; // SCRIPT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_FOR = "for"; // SCRIPT //$NON-NLS-1$
- public static final String ATTR_NAME_COMPACT = "compact"; // OL/UL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_START = "start"; // OL/UL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTKEY = "directkey"; // A
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CODEBASE = "codebase"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ARCHIVE = "archive"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CODE = "code"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_OBJECT = "object"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MAYSCRIPT = "mayscript"; // APPLET
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CITE = "cite"; // BLOCKQUOTE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MACRO = "macro"; // D2W //$NON-NLS-1$
- public static final String ATTR_NAME_DATETIME = "datetime"; // INS/DEL
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LOOP = "loop"; // EMBED //$NON-NLS-1$
- public static final String ATTR_NAME_HIDDEN = "hidden"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_VOLUME = "volume"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSTART = "autostart"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOPLAY = "autoplay"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_AUTOSIZE = "autosize"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CONTROLLER = "controller";// EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCALE = "scale"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SHOWCONTROLS = "showcontrols";// EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PLAYCOUNT = "playcount"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_REPEAT = "repeat"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PANEL = "panel"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_PALETTE = "palette"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TEXTFOCUS = "textfocus"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACTION = "action"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_METHOD = "method"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ENCTYPE = "enctype"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONSUBMIT = "onsubmit"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ONRESET = "onreset"; // FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ACCEPT_CHARSET = "accept-charset";// FORM
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BEHAVIOR = "behavior"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DIRECTION = "direction"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLAMOUNT = "scrollamount";// MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCROLLDELAY = "scrolldelay";// MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_TRUESPEED = "truespeed"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DECLARE = "declare"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CLASSID = "classid"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_DATA = "data"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_CODETYPE = "codetype"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_STANDBY = "standby"; // OBJECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_MULTIPLE = "multiple"; // SELECT
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ABBR = "abbr"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_AXIS = "axis"; // TH/TD //$NON-NLS-1$
- public static final String ATTR_NAME_HEADERS = "headers"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_SCOPE = "scope"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_ROWSPAN = "rowspan"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_COLSPAN = "colspan"; // TH/TD
- // //$NON-NLS-1$
- public static final String ATTR_NAME_NOWRAP = "nowrap"; // TH/TD
- // //$NON-NLS-1$
- // <<D205514
- public static final String ATTR_NAME_TOPMARGIN = "topmargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BOTTOMMARGIN = "bottommargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_LEFTMARGIN = "leftmargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_RIGHTMARGIN = "rightmargin"; // BODY
- // //$NON-NLS-1$
- public static final String ATTR_NAME_BORDERCOLOR = "bordercolor"; // TABLE/TR/TH/TD/FRAMESET/FRAME
- // //$NON-NLS-1$
- // for WML
- public static final String WML_ATTR_NAME_TITLE = "title"; // card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_DOMAIN = "domain"; // access
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_PATH = "path"; // access
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERFORWARD = "onenterforward"; // template,card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONENTERBACKWARD = "onenterbackward"; // template,card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONPICK = "onpick"; // option
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ONTIMER = "ontimer"; // template,card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_NEWCONTEXT = "newcontext"; // card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ORDERED = "ordered"; // card
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_OPTIONAL = "optional"; // do
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_CACHE_CONTROL = "cache-control"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_SENDREFERER = "sendreferer"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_METHOD = "method"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ENCTYPE = "enctype"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_ACCEPT_CHARSET = "accept-charset"; // go
- // //$NON-NLS-1$
- public static final String WML_ATTR_NAME_COLUMNS = "columns"; // table
- // //$NON-NLS-1$
- // D205514
- //<<D215684
- public static final String ATTR_NAME_FRAMESPACING = "framespacing"; // FRAMESET
- // //$NON-NLS-1$
- //D215684
- // global attribute values; mainly used in enumeration.
- public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD HTML 4.01 Transitional//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_VERSION_FRAMESET = "-//W3C//DTD HTML 4.01 Frameset//EN"; //$NON-NLS-1$
- public static final String ATTR_VALUE_LTR = "ltr"; // dir //$NON-NLS-1$
- public static final String ATTR_VALUE_RTL = "rtl"; // dir //$NON-NLS-1$
- // for align (top|middle|bottom|left|right)
- public static final String ATTR_VALUE_TOP = "top"; // align //$NON-NLS-1$
- public static final String ATTR_VALUE_MIDDLE = "middle"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BOTTOM = "bottom"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_LEFT = "left"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CENTER = "center"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RIGHT = "right"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_JUSTIFY = "justify"; // align
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CHAR = "char"; // align
- // //$NON-NLS-1$
- // for valign (baseline)
- public static final String ATTR_VALUE_BASELINE = "baseline"; // valign
- // //$NON-NLS-1$
- // for clear (left|all|right|none): left and right are already defined
- // above.
- public static final String ATTR_VALUE_ALL = "all"; // clear //$NON-NLS-1$
- public static final String ATTR_VALUE_NONE = "none"; // clear
- // //$NON-NLS-1$
- // for shape (rect|circle|poly|default)
- public static final String ATTR_VALUE_RECT = "rect"; // shape
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CIRCLE = "circle"; // shape
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_POLY = "poly"; // shape
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_DEFAULT = "default"; // shape
- // //$NON-NLS-1$
- // for valuetype (data|ref|object)
- public static final String ATTR_VALUE_DATA = "data"; // valuetype
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_REF = "ref"; // valuetype
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_OBJECT = "object"; // valuetype
- // //$NON-NLS-1$
- // for type of INPUT
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- public static final String ATTR_VALUE_TEXT = "text"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_PASSWORD = "password"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_CHECKBOX = "checkbox"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RADIO = "radio"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_SUBMIT = "submit"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RESET = "reset"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_FILE = "file"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_HIDDEN = "hidden"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_IMAGE = "image"; // INPUT:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BUTTON = "button"; // INPUT:type
- // //$NON-NLS-1$
- // for span, colspan, rowspan
- public static final String ATTR_VALUE_1 = "1"; // span //$NON-NLS-1$
- // for frameborder
- public static final String ATTR_VALUE_0 = "0"; // FRAME //$NON-NLS-1$
- // for scrolling
- public static final String ATTR_VALUE_YES = "yes"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_NO = "no"; // FRAME //$NON-NLS-1$
- public static final String ATTR_VALUE_AUTO = "auto"; // FRAME
- // //$NON-NLS-1$
- // for UL
- public static final String ATTR_VALUE_DISC = "disc"; // UL:type
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_SQUARE = "square"; // UL:type
- // //$NON-NLS-1$
- // for frame of TABLE
- public static final String ATTR_VALUE_VOID = "void"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ABOVE = "above"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BELOW = "below"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_HSIDES = "hsides"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_LHS = "lhs"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_RHS = "rhs"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_VSIDES = "vsides"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BOX = "box"; // TABLE:frame
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_BORDER = "border"; // TABLE:frame
- // //$NON-NLS-1$
- // for rules of TABLE
- public static final String ATTR_VALUE_GROUPS = "groups"; // TABLE:rules
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWS = "rows"; // TEXTAREA
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_COLS = "cols"; // TEXTAREA
- // //$NON-NLS-1$
- // for method of FORM
- public static final String ATTR_VALUE_GET = "get"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_POST = "post"; // FORM //$NON-NLS-1$
- public static final String ATTR_VALUE_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$
- // for scope of (TH | TD)
- public static final String ATTR_VALUE_ROW = "row"; // (TH|TD):scope
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_COL = "col"; // (TH|TD):scope
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ROWGROUP = "rowgroup";// (TH|TD):scope
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_COLGROUP = "colgroup";// (TH|TD):scope
- // //$NON-NLS-1$
- // for auto?? of EMBED
- public static final String ATTR_VALUE_TRUE = "true"; // EMBED
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_FALSE = "false"; // EMBED
- // //$NON-NLS-1$
- // for behaviro of MARQUEE
- public static final String ATTR_VALUE_SCROLL = "scroll"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_SLIDE = "slide"; // MARQUEE
- // //$NON-NLS-1$
- public static final String ATTR_VALUE_ALTERNATE = "alternate"; // MARQUEE
- // //$NON-NLS-1$
- // for direction of MARQUEE
- public static final String ATTR_VALUE_UP = "up"; // MARQUEE //$NON-NLS-1$
- public static final String ATTR_VALUE_DOWN = "down"; // MARQUEE
- // //$NON-NLS-1$
- // for type of LI (D19924)
- public static final String ATTR_VALUE_NUMBER = "1"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ALPHA = "a"; // LI
- // //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ContentSettingsRegistry.java
deleted file mode 100644
index 97638179f1..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ContentSettingsRegistry.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.ui.contentproperties;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboList;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-
-public final class ContentSettingsRegistry {
- private static final String NONE = ResourceHandler.getString("UI_none"); //$NON-NLS-1$
-
- public static void setCSSMetaModelRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- combo.add(name, id);
- }
- combo.sortByKey(1);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ui/CSSContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ui/CSSContentSettingsPropertyPage.java
deleted file mode 100644
index e2c70ca078..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/contentproperties/ui/CSSContentSettingsPropertyPage.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.wst.css.ui.contentproperties.ui;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.css.ui.contentproperties.ContentSettingsRegistry;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ContentSettingsPropertyPage;
-
-public final class CSSContentSettingsPropertyPage extends ContentSettingsPropertyPage {
-
- private final int N_CSS_PROFILE = 0;
-
-
-
- public CSSContentSettingsPropertyPage() {
- super();
- numberOfCombo = 1;
- numCols = 2;
- numRows = 1;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createSettingsPageGUI() {
-
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.FILE :
- //composite = createComposite(propertyPage,numCols,numRows);
- createCSSComboBox();
- WorkbenchHelp.setHelp(propertyPage, IHelpContextIds.CSS_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "CSSContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
- break;
- }
-
- }
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
-
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class CSSContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java
deleted file mode 100644
index 529da96642..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.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.ui.edit.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.css.core.cleanup.CleanupProcessorCSS;
-import org.eclipse.wst.sse.core.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.ui.edit.util.CleanupAction;
-
-public class CleanupActionCSS extends CleanupAction {
- protected IStructuredCleanupProcessor fCleanupProcessor;
-
- public CleanupActionCSS(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- protected Dialog getCleanupDialog(Shell shell) {
- if (fCleanupDialog == null)
- fCleanupDialog = new CleanupDialogCSS(shell);
-
- return fCleanupDialog;
- }
-
- protected IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new CleanupProcessorCSS();
-
- return fCleanupProcessor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupDialogCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupDialogCSS.java
deleted file mode 100644
index bb901ea12c..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupDialogCSS.java
+++ /dev/null
@@ -1,292 +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.ui.edit.ui;
-
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.css.core.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.cleanup.CSSCleanupStrategyImpl;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-
-public class CleanupDialogCSS extends Dialog {
-
- private boolean embeddedCSS;
- protected Button fRadioButtonIdentCaseAsis;
- protected Button fRadioButtonIdentCaseLower;
- protected Button fRadioButtonIdentCaseUpper;
- protected Button fRadioButtonPropNameCaseAsis;
- protected Button fRadioButtonPropNameCaseLower;
- protected Button fRadioButtonPropNameCaseUpper;
- protected Button fRadioButtonPropValueCaseAsis;
- protected Button fRadioButtonPropValueCaseLower;
- protected Button fRadioButtonPropValueCaseUpper;
- protected Button fRadioButtonSelectorTagCaseAsis;
- protected Button fRadioButtonSelectorTagCaseLower;
- protected Button fRadioButtonSelectorTagCaseUpper;
- protected Button fCheckBoxQuoteValues;
- protected Button fCheckBoxFormatSource;
-
- /**
- * CSSCleanupDialog constructor comment.
- *
- * @param parentShell
- * org.eclipse.swt.widgets.Shell
- */
- public CleanupDialogCSS(Shell parentShell) {
- super(parentShell);
- }
-
- /**
- *
- * @return org.eclipse.swt.widgets.Control
- * @param parent
- * org.eclipse.swt.widgets.Composite
- */
- public Control createDialogArea(Composite parent) {
- if (isEmbeddedCSS())
- getShell().setText(ResourceHandler.getString("CSS_Cleanup_UI_")); //$NON-NLS-1$ = "CSS Cleanup"
- else
- getShell().setText(ResourceHandler.getString("Cleanup_UI_")); //$NON-NLS-1$ = "Cleanup"
-
- Composite panel = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- panel.setLayout(layout);
-
- WorkbenchHelp.setHelp(panel, IHelpContextIds.CSS_CLEANUP_HELPID);
-
- // Convert ident case
- // ACC: Group radio buttons together so associated label is read
- // Label identCaseLabel = new Label(panel, SWT.NULL);
- // identCaseLabel.setText(ResourceHandler.getString("Identifier_case__UI_"));
- // //$NON-NLS-1$ = "Identifier case:"
- // Canvas identCase = new Canvas(panel, SWT.NULL);
- Group identCase = new Group(panel, SWT.NULL);
- identCase.setText(ResourceHandler.getString("Identifier_case__UI_")); //$NON-NLS-1$ = "Identifier case:"
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- identCase.setLayout(hLayout);
- fRadioButtonIdentCaseAsis = new Button(identCase, SWT.RADIO);
- fRadioButtonIdentCaseAsis.setText(ResourceHandler.getString("As-is_UI_")); //$NON-NLS-1$ = "As-is"
- fRadioButtonIdentCaseLower = new Button(identCase, SWT.RADIO);
- fRadioButtonIdentCaseLower.setText(ResourceHandler.getString("Lower_UI_")); //$NON-NLS-1$ = "Lower"
- fRadioButtonIdentCaseUpper = new Button(identCase, SWT.RADIO);
- fRadioButtonIdentCaseUpper.setText(ResourceHandler.getString("Upper_UI_")); //$NON-NLS-1$ = "Upper"
-
- // Convert property name case
- // ACC: Group radio buttons together so associated label is read
- // Label propNameCaseLabel = new Label(panel, SWT.NULL);
- // propNameCaseLabel.setText(ResourceHandler.getString("Property_name_case__UI_"));
- // //$NON-NLS-1$ = "Property name case:"
- // Canvas propNameCase = new Canvas(panel, SWT.NULL);
- Group propNameCase = new Group(panel, SWT.NULL);
- propNameCase.setText(ResourceHandler.getString("Property_name_case__UI_")); //$NON-NLS-1$ = "Property name case:"
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- propNameCase.setLayout(hLayout);
- fRadioButtonPropNameCaseAsis = new Button(propNameCase, SWT.RADIO);
- fRadioButtonPropNameCaseAsis.setText(ResourceHandler.getString("As-is_UI_")); //$NON-NLS-1$ = "As-is"
- fRadioButtonPropNameCaseLower = new Button(propNameCase, SWT.RADIO);
- fRadioButtonPropNameCaseLower.setText(ResourceHandler.getString("Lower_UI_")); //$NON-NLS-1$ = "Lower"
- fRadioButtonPropNameCaseUpper = new Button(propNameCase, SWT.RADIO);
- fRadioButtonPropNameCaseUpper.setText(ResourceHandler.getString("Upper_UI_")); //$NON-NLS-1$ = "Upper"
-
- // Convert property Value case
- // ACC: Group radio buttons together so associated label is read
- // Label propValueCaseLabel = new Label(panel, SWT.NULL);
- // propValueCaseLabel.setText(ResourceHandler.getString("Property_value_case__UI_"));
- // //$NON-NLS-1$ = "Property value case:"
- // Canvas propValueCase = new Canvas(panel, SWT.NULL);
- Group propValueCase = new Group(panel, SWT.NULL);
- propValueCase.setText(ResourceHandler.getString("Property_value_case__UI_")); //$NON-NLS-1$ = "Property value case:"
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- propValueCase.setLayout(hLayout);
- fRadioButtonPropValueCaseAsis = new Button(propValueCase, SWT.RADIO);
- fRadioButtonPropValueCaseAsis.setText(ResourceHandler.getString("As-is_UI_")); //$NON-NLS-1$ = "As-is"
- fRadioButtonPropValueCaseLower = new Button(propValueCase, SWT.RADIO);
- fRadioButtonPropValueCaseLower.setText(ResourceHandler.getString("Lower_UI_")); //$NON-NLS-1$ = "Lower"
- fRadioButtonPropValueCaseUpper = new Button(propValueCase, SWT.RADIO);
- fRadioButtonPropValueCaseUpper.setText(ResourceHandler.getString("Upper_UI_")); //$NON-NLS-1$ = "Upper"
-
- if (!isEmbeddedCSS()) {
- // Convert selector tag case
- // ACC: Group radio buttons together so associated label is read
- // Label selectorTagCaseLabel = new Label(panel, SWT.NULL);
- // selectorTagCaseLabel.setText(ResourceHandler.getString("Selector_tag_name_case__UI_"));
- // //$NON-NLS-1$ = "Selector tag name case:"
- // Canvas selectorTagCase = new Canvas(panel, SWT.NULL);
- Group selectorTagCase = new Group(panel, SWT.NULL);
- selectorTagCase.setText(ResourceHandler.getString("Selector_tag_name_case__UI_")); //$NON-NLS-1$ = "Selector tag name case:"
- hLayout = new GridLayout();
- hLayout.numColumns = 3;
- selectorTagCase.setLayout(hLayout);
- fRadioButtonSelectorTagCaseAsis = new Button(selectorTagCase, SWT.RADIO);
- fRadioButtonSelectorTagCaseAsis.setText(ResourceHandler.getString("As-is_UI_")); //$NON-NLS-1$ = "As-is"
- fRadioButtonSelectorTagCaseLower = new Button(selectorTagCase, SWT.RADIO);
- fRadioButtonSelectorTagCaseLower.setText(ResourceHandler.getString("Lower_UI_")); //$NON-NLS-1$ = "Lower"
- fRadioButtonSelectorTagCaseUpper = new Button(selectorTagCase, SWT.RADIO);
- fRadioButtonSelectorTagCaseUpper.setText(ResourceHandler.getString("Upper_UI_")); //$NON-NLS-1$ = "Upper"
- }
-
- // Quote attribute values
- fCheckBoxQuoteValues = new Button(panel, SWT.CHECK);
- fCheckBoxQuoteValues.setText(ResourceHandler.getString("Quote_values_UI_")); //$NON-NLS-1$ = "Quote values"
-
- if (!isEmbeddedCSS()) {
- // Format source
- fCheckBoxFormatSource = new Button(panel, SWT.CHECK);
- fCheckBoxFormatSource.setText(ResourceHandler.getString("Format_source_UI_")); //$NON-NLS-1$ = "Format source"
- }
-
- setCleanupOptions();
-
- return panel;
- }
-
- /**
- * Insert the method's description here.
- *
- * @return boolean
- */
- public boolean isEmbeddedCSS() {
- return embeddedCSS;
- }
-
- /**
- *
- */
- protected void okPressed() {
- updateCleanupOptions();
- super.okPressed();
- }
-
- /**
- *
- */
- protected void setCleanupOptions() {
- CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
-
- if (fRadioButtonIdentCaseAsis != null) {
- if (stgy.getIdentCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonIdentCaseUpper.setSelection(true);
- else if (stgy.getIdentCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonIdentCaseLower.setSelection(true);
- else
- fRadioButtonIdentCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonPropNameCaseAsis != null) {
- if (stgy.getPropNameCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonPropNameCaseUpper.setSelection(true);
- else if (stgy.getPropNameCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonPropNameCaseLower.setSelection(true);
- else
- fRadioButtonPropNameCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonPropValueCaseAsis != null) {
- if (stgy.getPropValueCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonPropValueCaseUpper.setSelection(true);
- else if (stgy.getPropValueCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonPropValueCaseLower.setSelection(true);
- else
- fRadioButtonPropValueCaseAsis.setSelection(true);
- }
-
- if (fRadioButtonSelectorTagCaseAsis != null) {
- if (stgy.getSelectorTagCase() == CSSCleanupStrategy.UPPER)
- fRadioButtonSelectorTagCaseUpper.setSelection(true);
- else if (stgy.getSelectorTagCase() == CSSCleanupStrategy.LOWER)
- fRadioButtonSelectorTagCaseLower.setSelection(true);
- else
- fRadioButtonSelectorTagCaseAsis.setSelection(true);
- }
-
- if (fCheckBoxQuoteValues != null)
- fCheckBoxQuoteValues.setSelection(stgy.isQuoteValues());
-
- if (fCheckBoxFormatSource != null)
- fCheckBoxFormatSource.setSelection(stgy.isFormatSource());
-
- }
-
- /**
- * Insert the method's description here.
- *
- * @param newEmbeddedCSS
- * boolean
- */
- public void setEmbeddedCSS(boolean newEmbeddedCSS) {
- embeddedCSS = newEmbeddedCSS;
- }
-
- /**
- *
- */
- protected void updateCleanupOptions() {
- CSSCleanupStrategy stgy = CSSCleanupStrategyImpl.getInstance();
-
- if (fRadioButtonIdentCaseAsis != null) {
- if (fRadioButtonIdentCaseUpper.getSelection())
- stgy.setIdentCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonIdentCaseLower.getSelection())
- stgy.setIdentCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setIdentCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonPropNameCaseAsis != null) {
- if (fRadioButtonPropNameCaseUpper.getSelection())
- stgy.setPropNameCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonPropNameCaseLower.getSelection())
- stgy.setPropNameCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setPropNameCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonPropValueCaseAsis != null) {
- if (fRadioButtonPropValueCaseUpper.getSelection())
- stgy.setPropValueCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonPropValueCaseLower.getSelection())
- stgy.setPropValueCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setPropValueCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fRadioButtonSelectorTagCaseAsis != null) {
- if (fRadioButtonSelectorTagCaseUpper.getSelection())
- stgy.setSelectorTagCase(CSSCleanupStrategy.UPPER);
- else if (fRadioButtonSelectorTagCaseLower.getSelection())
- stgy.setSelectorTagCase(CSSCleanupStrategy.LOWER);
- else
- stgy.setSelectorTagCase(CSSCleanupStrategy.ASIS);
- }
-
- if (fCheckBoxQuoteValues != null)
- stgy.setQuoteValues(fCheckBoxQuoteValues.getSelection());
-
- if (fCheckBoxFormatSource != null)
- stgy.setFormatSource(fCheckBoxFormatSource.getSelection());
-
- // save these values to preferences
- ((CSSCleanupStrategyImpl) stgy).saveOptions();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageHelper.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageHelper.java
deleted file mode 100644
index 47c3c888bb..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageHelper.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.wst.css.ui.image;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.CSSEditorPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-
-
-public class CSSImageHelper {
- /**
- * singleton
- */
- public synchronized static CSSImageHelper getInstance() {
- if (fInstance == null) {
- fInstance = new CSSImageHelper();
- }
- return fInstance;
- }
-
- /**
- * by relative path(from here)
- */
- public Image getImage(String resource) {
- if (resource == null) {
- return null;
- }
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * by type
- */
- public Image getImage(CSSImageType type) {
- if (fTypeMap == null) {
- fTypeMap = new HashMap();
- fTypeMap.put(CSSImageType.STYLESHEET, CSSEditorPluginImages.IMG_OBJ_STYLESHEET);
-
- fTypeMap.put(CSSImageType.RULE_CHARSET, CSSEditorPluginImages.IMG_OBJ_RULE_CHARSET);
- fTypeMap.put(CSSImageType.RULE_FONTFACE, CSSEditorPluginImages.IMG_OBJ_RULE_FONTFACE);
- fTypeMap.put(CSSImageType.RULE_IMPORT, CSSEditorPluginImages.IMG_OBJ_RULE_IMPORT);
- fTypeMap.put(CSSImageType.RULE_MEDIA, CSSEditorPluginImages.IMG_OBJ_RULE_MEDIA);
- fTypeMap.put(CSSImageType.RULE_PAGE, CSSEditorPluginImages.IMG_OBJ_RULE_PAGE);
- fTypeMap.put(CSSImageType.RULE_STYLE, CSSEditorPluginImages.IMG_OBJ_RULE_STYLE);
- fTypeMap.put(CSSImageType.RULE_UNKNOWN, CSSEditorPluginImages.IMG_OBJ_RULE_UNKNOWN);
-
- fTypeMap.put(CSSImageType.SELECTOR_CLASS, CSSEditorPluginImages.IMG_OBJ_SELECTOR_CLASS);
- fTypeMap.put(CSSImageType.SELECTOR_ID, CSSEditorPluginImages.IMG_OBJ_SELECTOR_ID);
- fTypeMap.put(CSSImageType.SELECTOR_PSEUDO, CSSEditorPluginImages.IMG_OBJ_SELECTOR_PSEUDO);
- fTypeMap.put(CSSImageType.SELECTOR_TAG, CSSEditorPluginImages.IMG_OBJ_SELECTOR_TAG);
- fTypeMap.put(CSSImageType.SELECTOR_LINK, CSSEditorPluginImages.IMG_OBJ_SELECTOR_LINK);
- fTypeMap.put(CSSImageType.SELECTOR_DEFAULT, CSSEditorPluginImages.IMG_OBJ_SELECTOR_DEFAULT);
-
- fTypeMap.put(CSSImageType.VALUE_FUNCTION, CSSEditorPluginImages.IMG_OBJ_VALUE_FUNCTION);
- fTypeMap.put(CSSImageType.VALUE_NUMBER, CSSEditorPluginImages.IMG_OBJ_VALUE_NUMBER);
- fTypeMap.put(CSSImageType.VALUE_STRING, CSSEditorPluginImages.IMG_OBJ_VALUE_STRING);
-
- fTypeMap.put(CSSImageType.CATEGORY_AURAL, CSSEditorPluginImages.IMG_OBJ_CATEGORY_AURAL);
- fTypeMap.put(CSSImageType.CATEGORY_BOX, CSSEditorPluginImages.IMG_OBJ_CATEGORY_BOX);
- fTypeMap.put(CSSImageType.CATEGORY_COLORANDBACKGROUND, CSSEditorPluginImages.IMG_OBJ_CATEGORY_COLORANDBACKGROUND);
- fTypeMap.put(CSSImageType.CATEGORY_CONTENT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_CONTENT);
- fTypeMap.put(CSSImageType.CATEGORY_FONT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_FONT);
- fTypeMap.put(CSSImageType.CATEGORY_PAGE, CSSEditorPluginImages.IMG_OBJ_CATEGORY_PAGE);
- fTypeMap.put(CSSImageType.CATEGORY_TABLES, CSSEditorPluginImages.IMG_OBJ_CATEGORY_TABLES);
- fTypeMap.put(CSSImageType.CATEGORY_TEXT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_TEXT);
- fTypeMap.put(CSSImageType.CATEGORY_UI, CSSEditorPluginImages.IMG_OBJ_CATEGORY_UI);
- fTypeMap.put(CSSImageType.CATEGORY_VISUAL, CSSEditorPluginImages.IMG_OBJ_CATEGORY_VISUAL);
- fTypeMap.put(CSSImageType.CATEGORY_DEFAULT, CSSEditorPluginImages.IMG_OBJ_CATEGORY_DEFAULT);
- }
- return getImage((String) fTypeMap.get(type));
- }
-
- /**
- *
- */
- private CSSImageHelper() {
- super();
- }
-
- /**
- *
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(CSSEditorPlugin.ID, resource);
- Image image = null;
-
- if (desc == null) {
- desc = ImageDescriptor.getMissingImageDescriptor();
- image = desc.createImage();
- } else {
- image = desc.createImage();
- getImageRegistry().put(resource, image);
- }
-
- return image;
- }
-
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-
- private Map fTypeMap = null;
- private static CSSImageHelper fInstance = null;
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageType.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageType.java
deleted file mode 100644
index 9efa575dcf..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/image/CSSImageType.java
+++ /dev/null
@@ -1,235 +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.ui.image;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-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.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.document.ICSSSelector;
-import org.eclipse.wst.css.core.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.document.ICSSSimpleSelector;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelUtil;
-import org.w3c.dom.css.CSSCharsetRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSMediaRule;
-import org.w3c.dom.css.CSSPageRule;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSValue;
-
-/**
- */
-public class CSSImageType {
-
- private final String fName;
-
- private CSSImageType(String name) {
- this.fName = name;
- }
-
- public String toString() {
- return fName;
- }
-
- public static final CSSImageType STYLESHEET = new CSSImageType("STYLESHEET"); //$NON-NLS-1$
-
- public static final CSSImageType RULE_CHARSET = new CSSImageType("RULE_CHARSET"); //$NON-NLS-1$
- public static final CSSImageType RULE_FONTFACE = new CSSImageType("RULE_FONTFACE"); //$NON-NLS-1$
- public static final CSSImageType RULE_IMPORT = new CSSImageType("RULE_IMPORT"); //$NON-NLS-1$
- public static final CSSImageType RULE_MEDIA = new CSSImageType("RULE_MEDIA"); //$NON-NLS-1$
- public static final CSSImageType RULE_PAGE = new CSSImageType("RULE_PAGE"); //$NON-NLS-1$
- public static final CSSImageType RULE_STYLE = new CSSImageType("RULE_STYLE"); //$NON-NLS-1$
- public static final CSSImageType RULE_UNKNOWN = new CSSImageType("RULE_UNKNOWN"); //$NON-NLS-1$
-
- public static final CSSImageType SELECTOR_CLASS = new CSSImageType("SELECTOR_CLASS"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_ID = new CSSImageType("SELECTOR_ID"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_DEFAULT = new CSSImageType("SELECTOR_DEFAULT"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_PSEUDO = new CSSImageType("SELECTOR_PSEUDO"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_TAG = new CSSImageType("SELECTOR_TAG"); //$NON-NLS-1$
- public static final CSSImageType SELECTOR_LINK = new CSSImageType("SELECTOR_LINK"); //$NON-NLS-1$
-
- public static final CSSImageType VALUE_FUNCTION = new CSSImageType("VALUE_FUNCTION"); //$NON-NLS-1$
- public static final CSSImageType VALUE_NUMBER = new CSSImageType("VALUE_NUMBER"); //$NON-NLS-1$
- public static final CSSImageType VALUE_STRING = new CSSImageType("VALUE_STRING"); //$NON-NLS-1$
-
- public static final CSSImageType CATEGORY_AURAL = new CSSImageType("CATEGORY_AURAL"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_BOX = new CSSImageType("CATEGORY_BOX"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_COLORANDBACKGROUND = new CSSImageType("CATEGORY_COLORANDBACKGROUND"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_CONTENT = new CSSImageType("CATEGORY_CONTENT"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_FONT = new CSSImageType("CATEGORY_FONT"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_PAGE = new CSSImageType("CATEGORY_PAGE"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_TABLES = new CSSImageType("CATEGORY_TABLES"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_TEXT = new CSSImageType("CATEGORY_TEXT"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_UI = new CSSImageType("CATEGORY_UI"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_VISUAL = new CSSImageType("CATEGORY_VISUAL"); //$NON-NLS-1$
- public static final CSSImageType CATEGORY_DEFAULT = new CSSImageType("CATEGORY_DEFAULT"); //$NON-NLS-1$
-
- /**
- * by node
- */
- public static CSSImageType getImageType(ICSSNode node) {
- CSSImageType imageType = null;
- if (node instanceof CSSCharsetRule) {
- imageType = RULE_CHARSET;
- } else if (node instanceof CSSFontFaceRule) {
- imageType = RULE_FONTFACE;
- } else if (node instanceof CSSImportRule) {
- imageType = RULE_IMPORT;
- } else if (node instanceof CSSMediaRule) {
- imageType = RULE_MEDIA;
- } else if (node instanceof CSSPageRule) {
- imageType = RULE_PAGE;
- } else if (node instanceof CSSStyleRule) {
- imageType = getImageType(((ICSSStyleRule) node).getSelectors());
- } else if (node instanceof CSSStyleDeclaration) {
- ICSSNode parent = node.getParentNode();
- if (parent != null) {
- return getImageType(parent);
- }
- } else if (node instanceof ICSSStyleDeclItem) {
- String name = ((ICSSStyleDeclItem) node).getPropertyName();
- ICSSDocument doc = node.getOwnerDocument();
- ICSSModel model = (doc != null) ? doc.getModel() : null;
- CSSMetaModelFinder finder = CSSMetaModelFinder.getInstance();
- CSSMetaModel metaModel = finder.findMetaModelFor(model);
- // is font-face rule ?
- ICSSNode parent = node.getParentNode();
- if (parent != null) {
- parent = parent.getParentNode();
- if (parent instanceof CSSFontFaceRule) {
- imageType = CSSImageType.CATEGORY_FONT;
- }
- }
- if (imageType == null) {
- CSSMMProperty prop = new CSSMetaModelUtil(metaModel).getProperty(name);
- if (prop != null) {
- String category = prop.getAttribute("category"); //$NON-NLS-1$
- imageType = getImageType(category);
- }
- if (imageType == null) {
- imageType = CSSImageType.CATEGORY_DEFAULT;
- }
- }
- } else if (node instanceof CSSValue) {
- switch (((CSSValue) node).getCssValueType()) {
- case CSSPrimitiveValue.CSS_NUMBER :
- case CSSPrimitiveValue.CSS_PERCENTAGE :
- case CSSPrimitiveValue.CSS_EMS :
- case CSSPrimitiveValue.CSS_EXS :
- case CSSPrimitiveValue.CSS_PX :
- case CSSPrimitiveValue.CSS_CM :
- case CSSPrimitiveValue.CSS_MM :
- case CSSPrimitiveValue.CSS_IN :
- case CSSPrimitiveValue.CSS_PT :
- case CSSPrimitiveValue.CSS_PC :
- case CSSPrimitiveValue.CSS_DEG :
- case CSSPrimitiveValue.CSS_RAD :
- case CSSPrimitiveValue.CSS_GRAD :
- case CSSPrimitiveValue.CSS_MS :
- case CSSPrimitiveValue.CSS_S :
- case CSSPrimitiveValue.CSS_HZ :
- case CSSPrimitiveValue.CSS_KHZ :
- case CSSPrimitiveValue.CSS_DIMENSION :
- case ICSSPrimitiveValue.CSS_INTEGER :
- case ICSSPrimitiveValue.CSS_HASH :
- imageType = VALUE_NUMBER;
- break;
- case CSSPrimitiveValue.CSS_ATTR :
- case CSSPrimitiveValue.CSS_COUNTER :
- case CSSPrimitiveValue.CSS_RECT :
- case CSSPrimitiveValue.CSS_RGBCOLOR :
- case CSSPrimitiveValue.CSS_URI :
- case ICSSPrimitiveValue.CSS_FORMAT :
- case ICSSPrimitiveValue.CSS_LOCAL :
- imageType = VALUE_FUNCTION;
- break;
- default :
- imageType = VALUE_STRING;
- break;
- }
- }
- return imageType;
- }
-
- public static CSSImageType getImageType(ICSSSelectorList selectorList) {
- if (selectorList == null || selectorList.getLength() == 0) {
- return SELECTOR_DEFAULT;
- }
- CSSImageType imageType = null;
- int nSelectors = selectorList.getLength();
- for (int i = 0; i < nSelectors; i++) {
- CSSImageType candidate = getImageType(selectorList.getSelector(i));
- if (imageType == null) {
- imageType = candidate;
- } else if (imageType != candidate) {
- imageType = null;
- break;
- }
- }
-
- return (imageType == null) ? SELECTOR_DEFAULT : imageType;
- }
-
- public static CSSImageType getImageType(ICSSSelector selector) {
- CSSImageType imageType = SELECTOR_DEFAULT;
- if (selector == null || selector.getLength() == 0) {
- return imageType;
- }
- ICSSSelectorItem item = selector.getItem(selector.getLength() - 1);
- if (item.getItemType() == ICSSSelectorItem.SIMPLE) {
- ICSSSimpleSelector ss = (ICSSSimpleSelector) item;
- if (0 < ss.getNumOfIDs()) {
- imageType = SELECTOR_ID;
- } else if (0 < ss.getNumOfClasses()) {
- imageType = SELECTOR_CLASS;
- } else if (0 < ss.getNumOfPseudoNames()) {
- imageType = SELECTOR_PSEUDO;
- } else {
- imageType = SELECTOR_TAG;
- }
- }
- return imageType;
- }
-
- public static CSSImageType getImageType(String category) {
- if (fCategoryMap == null) {
- fCategoryMap = new HashMap();
- fCategoryMap.put("aural", CATEGORY_AURAL); //$NON-NLS-1$
- fCategoryMap.put("box", CATEGORY_BOX); //$NON-NLS-1$
- fCategoryMap.put("colorandbackground", CATEGORY_COLORANDBACKGROUND); //$NON-NLS-1$
- fCategoryMap.put("content", CATEGORY_CONTENT); //$NON-NLS-1$
- fCategoryMap.put("font", CATEGORY_FONT); //$NON-NLS-1$
- fCategoryMap.put("page", CATEGORY_PAGE); //$NON-NLS-1$
- fCategoryMap.put("tables", CATEGORY_TABLES); //$NON-NLS-1$
- fCategoryMap.put("text", CATEGORY_TEXT); //$NON-NLS-1$
- fCategoryMap.put("ui", CATEGORY_UI); //$NON-NLS-1$
- fCategoryMap.put("visual", CATEGORY_VISUAL); //$NON-NLS-1$
- }
- CSSImageType imageType = (CSSImageType) fCategoryMap.get(category);
- return (imageType == null) ? CATEGORY_DEFAULT : imageType;
- }
-
- private static Map fCategoryMap = null;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java
deleted file mode 100644
index 480a5a6acc..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java
+++ /dev/null
@@ -1,154 +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.ui.internal;
-
-
-
-import java.util.StringTokenizer;
-
-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.wst.css.ui.CSSEditorPlugin;
-
-/**
- * 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 Plugin fPlugin = CSSEditorPlugin.getDefault();
- private static final String fPluginId = fPlugin.getDescriptor().getUniqueIdentifier();
-
- 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, fPluginId, severity, message, exception);
- fPlugin.getLog().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, fPluginId, IStatus.OK, message, exception);
- fPlugin.getLog().log(statusObj);
- }
- }
-
- /**
- * @return true if the plugin for this logger is debugging
- */
- public static boolean isDebugging() {
- return fPlugin.isDebugging();
- }
-
- /**
- * 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(fPluginId + 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.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java
deleted file mode 100644
index c7d179fb39..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java
+++ /dev/null
@@ -1,51 +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.ui.internal.editor;
-
-
-/**
- * Bundle of most images used by the CSS Source Editor plug-in.
- */
-public class CSSEditorPluginImages {
- public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_STYLESHEET = "icons/full/obj16/stylesheet.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_CHARSET = "icons/full/obj16/charset_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_FONTFACE = "icons/full/obj16/fontface_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_IMPORT = "icons/full/obj16/link_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_MEDIA = "icons/full/obj16/media_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_PAGE = "icons/full/obj16/page_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_STYLE = "icons/full/obj16/style_rule.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_RULE_UNKNOWN = "icons/full/obj16/unknown_rule.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_SELECTOR_CLASS = "icons/full/obj16/class_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_ID = "icons/full/obj16/id_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_PSEUDO = "icons/full/obj16/pseudo.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_TAG = "icons/full/obj16/tag_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_LINK = "icons/full/obj16/link_selector.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SELECTOR_DEFAULT = "icons/full/obj16/tag_selector.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_VALUE_FUNCTION = "icons/full/obj16/css_propertyvalue_function.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_VALUE_NUMBER = "icons/full/obj16/css_propertyvalue_unit.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_VALUE_STRING = "icons/full/obj16/css_propertyvalue_identifier.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_CATEGORY_AURAL = "icons/full/obj16/aural_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_BOX = "icons/full/obj16/boxmodel_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_COLORANDBACKGROUND = "icons/full/obj16/colback_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_CONTENT = "icons/full/obj16/content_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_FONT = "icons/full/obj16/font_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_PAGE = "icons/full/obj16/pagedmedia_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_TABLES = "icons/full/obj16/table_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_TEXT = "icons/full/obj16/text_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_UI = "icons/full/obj16/ui_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_VISUAL = "icons/full/obj16/visual_props.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_CATEGORY_DEFAULT = "icons/full/obj16/other_props.gif"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 598c776ecc..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.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.ui.internal.editor;
-
-import org.eclipse.wst.css.ui.CSSEditorPlugin;
-
-/**
- * Help context ids for the CSS Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.wst.css.ui.
- public static final String PREFIX = CSSEditorPlugin.ID + "."; //$NON-NLS-1$
-
- // CSS Source page editor
- public static final String CSS_SOURCEVIEW_HELPID = PREFIX + "ecss0000"; //$NON-NLS-1$
-
- // CSS Files Preference page
- public static final String CSS_PREFWEBX_FILES_HELPID = PREFIX + "webx0010"; //$NON-NLS-1$
- // CSS Source Preference page
- public static final String CSS_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0011"; //$NON-NLS-1$
- // CSS Styles Preference page
- public static final String CSS_PREFWEBX_STYLES_HELPID = PREFIX + "webx0012"; //$NON-NLS-1$
-
- // CSS Cleanup dialog
- public static final String CSS_CLEANUP_HELPID = PREFIX + "xmlm1300"; //$NON-NLS-1$
-
- // CSS Content Settings
- public static final String CSS_CONTENT_SETTINGS_HELPID = PREFIX + "misc0180"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/nls/ResourceHandler.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/nls/ResourceHandler.java
deleted file mode 100644
index a14f3f636b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/nls/ResourceHandler.java
+++ /dev/null
@@ -1,66 +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.ui.internal.nls;
-
-
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ResourceHandler {
-
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("EditingCSS");//$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- } else {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- } catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-
- public static String getString(String key, Object[] args, int x) {
-
- return getString(key);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectCSSAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectCSSAction.java
deleted file mode 100644
index cf318d6c58..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectCSSAction.java
+++ /dev/null
@@ -1,53 +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.ui.internal.selection;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.internal.selection.StructureSelectAction;
-
-public abstract class StructureSelectCSSAction extends StructureSelectAction {
- public StructureSelectCSSAction(StructuredTextEditor editor, SelectionHistory history) {
- super(editor, history);
- }
-
- public void run() {
- Region currentRegion = new Region(fViewer.getSelectedRange().x, fViewer.getSelectedRange().y);
- if (currentRegion.getLength() == fViewer.getDocument().getLength())
- return;
-
- IndexedRegion cursorIndexedRegion = getCursorIndexedRegion();
- if (cursorIndexedRegion instanceof ICSSNode) {
- ICSSNode cursorNode = (ICSSNode) cursorIndexedRegion;
-
- Region cursorNodeRegion = new Region(cursorIndexedRegion.getStartOffset(), cursorIndexedRegion.getEndOffset() - cursorIndexedRegion.getStartOffset());
-
- Region newRegion = null;
- if (cursorNodeRegion.getOffset() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() <= currentRegion.getOffset() + currentRegion.getLength() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentRegion.getOffset() + currentRegion.getLength())
- newRegion = getNewSelectionRegion(cursorNode, currentRegion);
- else
- newRegion = cursorNodeRegion;
-
- if (newRegion != null) {
- fHistory.remember(currentRegion);
- try {
- fHistory.ignoreSelectionChanges();
- fEditor.selectAndReveal(newRegion.getOffset(), newRegion.getLength());
- } finally {
- fHistory.listenToSelectionChanges();
- }
- }
- }
- }
-
- abstract protected Region getNewSelectionRegion(ICSSNode node, Region region);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectEnclosingCSSAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectEnclosingCSSAction.java
deleted file mode 100644
index 62b67c2583..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectEnclosingCSSAction.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.ui.internal.selection;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-import org.w3c.dom.Node;
-
-public class StructureSelectEnclosingCSSAction extends StructureSelectCSSAction {
- public StructureSelectEnclosingCSSAction(StructuredTextEditor editor, SelectionHistory history) {
- super(editor, history);
- setText(ResourceHandler.getString("StructureSelectEnclosing.label")); //$NON-NLS-1$
- setToolTipText(ResourceHandler.getString("StructureSelectEnclosing.tooltip")); //$NON-NLS-1$
- setDescription(ResourceHandler.getString("StructureSelectEnclosing.description")); //$NON-NLS-1$
- }
-
- protected IndexedRegion getCursorIndexedRegion() {
- return getIndexedRegion(fViewer.getSelectedRange().x);
- }
-
- protected Region getNewSelectionRegion(Node node, Region region) {
- return null;
- }
-
- protected Region getNewSelectionRegion(ICSSNode node, Region region) {
- Region newRegion = null;
-
- ICSSNode newNode = node.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
-
- return newRegion;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectNextCSSAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectNextCSSAction.java
deleted file mode 100644
index 7e469265ec..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectNextCSSAction.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.ui.internal.selection;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-import org.w3c.dom.Node;
-
-public class StructureSelectNextCSSAction extends StructureSelectCSSAction {
- public StructureSelectNextCSSAction(StructuredTextEditor editor, SelectionHistory history) {
- super(editor, history);
- setText(ResourceHandler.getString("StructureSelectNext.label")); //$NON-NLS-1$
- setToolTipText(ResourceHandler.getString("StructureSelectNext.tooltip")); //$NON-NLS-1$
- setDescription(ResourceHandler.getString("StructureSelectNext.description")); //$NON-NLS-1$
- }
-
- protected IndexedRegion getCursorIndexedRegion() {
- int offset = fViewer.getSelectedRange().x + fViewer.getSelectedRange().y - 1;
-
- if (offset < 0)
- offset = 0;
-
- return getIndexedRegion(offset);
- }
-
- protected Region getNewSelectionRegion(Node node, Region region) {
- return null;
- }
-
- protected Region getNewSelectionRegion(ICSSNode node, Region region) {
- Region newRegion = null;
-
- ICSSNode newNode = node.getNextSibling();
- if (newNode == null) {
- newNode = node.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- } else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(region.getOffset(), newIndexedRegion.getEndOffset() - region.getOffset());
- }
- }
-
- return newRegion;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectPreviousCSSAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectPreviousCSSAction.java
deleted file mode 100644
index 762eb0b6a4..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructureSelectPreviousCSSAction.java
+++ /dev/null
@@ -1,55 +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.ui.internal.selection;
-
-import org.eclipse.jface.text.Region;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-import org.w3c.dom.Node;
-
-public class StructureSelectPreviousCSSAction extends StructureSelectCSSAction {
- public StructureSelectPreviousCSSAction(StructuredTextEditor editor, SelectionHistory history) {
- super(editor, history);
- setText(ResourceHandler.getString("StructureSelectPrevious.label")); //$NON-NLS-1$
- setToolTipText(ResourceHandler.getString("StructureSelectPrevious.tooltip")); //$NON-NLS-1$
- setDescription(ResourceHandler.getString("StructureSelectPrevious.description")); //$NON-NLS-1$
- }
-
- protected IndexedRegion getCursorIndexedRegion() {
- return getIndexedRegion(fViewer.getSelectedRange().x);
- }
-
- protected Region getNewSelectionRegion(Node node, Region region) {
- return null;
- }
-
- protected Region getNewSelectionRegion(ICSSNode node, Region region) {
- Region newRegion = null;
-
- ICSSNode newNode = node.getPreviousSibling();
- if (newNode == null) {
- newNode = node.getParentNode();
-
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), newIndexedRegion.getEndOffset() - newIndexedRegion.getStartOffset());
- }
- } else {
- if (newNode instanceof IndexedRegion) {
- IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
- newRegion = new Region(newIndexedRegion.getStartOffset(), region.getOffset() + region.getLength() - newIndexedRegion.getStartOffset());
- }
- }
-
- return newRegion;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/CSSPreferenceManager.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/CSSPreferenceManager.java
deleted file mode 100644
index 433a9bab57..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/CSSPreferenceManager.java
+++ /dev/null
@@ -1,185 +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.ui.preferences;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @deprecated preference management has moved to base preferences
- */
-public class CSSPreferenceManager extends PreferenceManager {
-
- private static CSSPreferenceManager fInstance = null;
- //
- private final static String GROUP_COLOR = "color";//$NON-NLS-1$
- private final static String COLOR_ENABLED = "useColor";//$NON-NLS-1$
- //
- private final static String GROUP_ASSIST = "contentAssist"; //$NON-NLS-1$
- private final static String ASSIST_CATEGORIZE = "categorize"; //$NON-NLS-1$
-
- protected Document fallbackDocument = null;
-
- /**
- *
- */
- protected CSSPreferenceManager() {
- super();
- }
-
- /**
- *
- */
- public Document createDefaultPreferences() {
- Document doc = super.createDefaultPreferences();
- if (doc == null) {
- return doc;
- }
-
- Node preference = doc.getFirstChild();
-
- Element color = doc.createElement(GROUP_COLOR);
- setBooleanAttribute(color, COLOR_ENABLED, true);
- preference.appendChild(color);
-
- Element contentAssist = doc.createElement(GROUP_ASSIST);
- setBooleanAttribute(contentAssist, ASSIST_CATEGORIZE, true);
- preference.appendChild(contentAssist);
-
- return doc;
- }
-
- public boolean getContentAssistCategorize() {
- return getBooleanAttribute(getGroupElement(GROUP_ASSIST), ASSIST_CATEGORIZE);
- }
-
- public void setContentAssistCategorize(boolean categorize) {
- setBooleanAttribute(getGroupElement(GROUP_ASSIST), ASSIST_CATEGORIZE, categorize);
- }
-
- /**
- *
- */
- protected boolean getBooleanAttribute(Element element, String name) {
- String str = element.getAttribute(name);
- if (str == null || str.length() <= 0) {
- element = getDefaultGroupElement(element.getTagName());
- if (element != null)
- str = element.getAttribute(name);
- }
- return (str == null) ? false : str.equals(Boolean.TRUE.toString());
- }
-
- /**
- *
- */
- public boolean getColorEnabled() {
- return getBooleanAttribute(getGroupElement(GROUP_COLOR), COLOR_ENABLED);
- }
-
- /**
- *
- */
- protected String getFilename() {
- if (fileName == null) {
- fileName = Platform.getPlugin(IModelManagerPlugin.ID).getStateLocation().toString() + "/cssprefs.xml";//$NON-NLS-1$
- }
- return fileName;
- }
-
- /**
- *
- */
- protected Element getGroupElement(String name) {
- Node node = getNamedChild(getRootElement(), name);
- return (node instanceof Element) ? (Element) node : getDefaultGroupElement(name);
- }
-
- /**
- *
- */
- protected Element getDefaultGroupElement(String name) {
- Node node = getNamedChild(getDefaultRootElement(), name);
- return (node instanceof Element) ? (Element) node : null;
- }
-
- /**
- *
- */
- protected Node getDefaultRootElement() {
- if (fallbackDocument == null)
- fallbackDocument = createDefaultPreferences();
- return getRootElement(fallbackDocument);
- }
-
- /**
- *
- */
- public synchronized static CSSPreferenceManager getInstance() {
- if (fInstance == null) {
- fInstance = new CSSPreferenceManager();
- }
- return fInstance;
- }
-
- /**
- *
- */
- protected int getIntAttribute(Element element, String name) {
- int value = 0;
- try {
- value = Integer.parseInt(element.getAttribute(name));
- } catch (NumberFormatException e) {
- element = getDefaultGroupElement(element.getTagName());
- try {
- value = Integer.parseInt(element.getAttribute(name));
- } catch (NumberFormatException ee) {
- }
- }
- return value;
- }
-
- /**
- *
- */
- protected String getStringAttribute(Element element, String name) {
- if (element.getAttributeNode(name) == null) {
- element = getDefaultGroupElement(element.getTagName());
- }
- return element.getAttribute(name);
- }
-
- /**
- *
- */
- protected void setBooleanAttribute(Element element, String name, boolean value) {
- element.setAttribute(name, new Boolean(value).toString());
- }
-
- /**
- *
- */
- public void setColorEnabled(boolean enabled) {
- setBooleanAttribute(getGroupElement(GROUP_COLOR), COLOR_ENABLED, enabled);
- }
-
- /**
- *
- */
- protected void setStringAttribute(Element element, String name, String value) {
- element.setAttribute(name, value);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorManager.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorManager.java
deleted file mode 100644
index e3c1eac472..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorManager.java
+++ /dev/null
@@ -1,228 +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.ui.preferences.ui;
-
-
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.css.ui.internal.Logger;
-import org.eclipse.wst.css.ui.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceManager;
-import org.eclipse.wst.sse.ui.preferences.ui.ColorNames;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @deprecated color preference management has moved to base preferences
- */
-public class CSSColorManager extends PreferenceManager {
-
- private static CSSColorManager fInstance = null;
- // highlighting types
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String NORMAL = "NORMAL";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String ATMARK_RULE = "ATMARK_RULE";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String SELECTOR = "SELECTOR";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String MEDIA = "MEDIA"; //$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String COMMENT = "COMMENT";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String PROPERTY_NAME = "PROPERTY_NAME";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String PROPERTY_VALUE = "PROPERTY_VALUE";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String URI = "URI";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String STRING = "STRING";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String COLON = "COLON";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String SEMI_COLON = "SEMI_COLON";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String CURLY_BRACE = "CURLY_BRACE";//$NON-NLS-1$
- /** @deprecated use IStyleConstantsCSS instead TODO remove in C5 or earlier */
- public static final String ERROR = "ERROR";//$NON-NLS-1$
- // names for preference elements ... non-NLS
- public static final String FOREGROUND = "foreground";//$NON-NLS-1$
- public static final String BACKGROUND = "background";//$NON-NLS-1$
- public static final String BOLD = "bold";//$NON-NLS-1$
- public static final String ITALIC = "italic";//$NON-NLS-1$
- public static final String NAME = "name";//$NON-NLS-1$
- public static final String COLOR = "color";//$NON-NLS-1$
-
- private CSSColorManager() {
- super();
- }
-
- protected Element addColor(Node colors, String name, String foreground, String background) {
- Element newColor = newColor(colors.getOwnerDocument(), name, foreground, background);
- colors.appendChild(newColor);
- return newColor;
- }
-
- /**
- * <!ELEMENT colors (color) > <!ELEMENT color EMPTY > <!ATTLIST color name
- * CDATA #REQUIRED foreground CDATA #IMPLIED background CDATA #IMPLIED
- * bold CDATA #REQUIRED >
- *
- */
- public Document createDefaultPreferences() {
- Document prefDocument = super.createDefaultPreferences();
- if (prefDocument == null)
- return prefDocument;
-
- while (prefDocument.getChildNodes().getLength() > 0)
- prefDocument.removeChild(prefDocument.getLastChild());
- Element colors = prefDocument.createElement(getRootElementName());
- prefDocument.appendChild(colors);
-
- // current as of 2001-8-13
- addColor(colors, IStyleConstantsCSS.NORMAL, null, null);
- addColor(colors, IStyleConstantsCSS.ATMARK_RULE, getColorString(63, 127, 127), null);
- addColor(colors, IStyleConstantsCSS.SELECTOR, getColorString(63, 127, 127), null);
- addColor(colors, IStyleConstantsCSS.MEDIA, getColorString(42, 0, 225), null);
- addColor(colors, IStyleConstantsCSS.COMMENT, getColorString(63, 95, 191), null);
- addColor(colors, IStyleConstantsCSS.PROPERTY_NAME, getColorString(127, 0, 127), null);
- addColor(colors, IStyleConstantsCSS.PROPERTY_VALUE, getColorString(42, 0, 225), null);
- addColor(colors, IStyleConstantsCSS.URI, getColorString(42, 0, 225), null);
- addColor(colors, IStyleConstantsCSS.STRING, getColorString(42, 0, 225), null);
- addColor(colors, IStyleConstantsCSS.COLON, null, null);
- addColor(colors, IStyleConstantsCSS.SEMI_COLON, null, null);
- addColor(colors, IStyleConstantsCSS.CURLY_BRACE, null, null);
- addColor(colors, IStyleConstantsCSS.ERROR, getColorString(191, 63, 63), null);
-
- return prefDocument;
- }
-
- public RGB getBackgroundRGB(String name) {
- Element element = getColorElement(name);
- if (element != null) {
- return getRGB(element.getAttribute(BACKGROUND));
- } else {
- return new RGB(255, 255, 255);
- }
- }
-
- private Element getColorElement(String name) {
- Node colorsElement = getRootElement();
- NodeList colors = colorsElement.getChildNodes();
- for (int i = 0; i < colors.getLength(); i++) {
- Node node = colors.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE && ((Element) node).getAttribute(NAME).equals(name)) {
- return (Element) node;
- }
- }
- return null;
- }
-
- public static String getColorString(int r, int g, int b) {
- return "#" + getHexString(r, 2) + getHexString(g, 2) + getHexString(b, 2);//$NON-NLS-1$
- }
-
- public String getFilename() {
- if (fileName == null) {
- fileName = Platform.getPlugin(IModelManagerPlugin.ID).getStateLocation().toString() + "/csssourcecolors.xml";//$NON-NLS-1$
- }
- return fileName;
- }
-
- public RGB getForegroundRGB(String name) {
- Element element = getColorElement(name);
- if (element != null) {
- return getRGB(element.getAttribute(FOREGROUND));
- } else {
- return new RGB(0, 0, 0);
- }
- }
-
- public static String getHexString(int value, int minWidth) {
- String hexString = Integer.toHexString(value);
- for (int i = hexString.length(); i < minWidth; i++) {
- hexString = "0" + hexString;//$NON-NLS-1$
- }
- return hexString;
- }
-
- public synchronized static CSSColorManager getInstance() {
- if (fInstance == null) {
- fInstance = new CSSColorManager();
- }
- return fInstance;
- }
-
- private RGB getRGB(String rgbStr) {
- RGB result = null;
- if (6 < rgbStr.length() && rgbStr.charAt(0) == '#') {
- try {
- int r = Integer.valueOf(rgbStr.substring(1, 3), 16).intValue();
- int g = Integer.valueOf(rgbStr.substring(3, 5), 16).intValue();
- int b = Integer.valueOf(rgbStr.substring(5, 7), 16).intValue();
- result = new RGB(r, g, b);
- } catch (NumberFormatException e) {
- Logger.logException("Invalid color string " + rgbStr, e); //$NON-NLS-1$
- }
- }
- return result;
- }
-
- /**
- * The intended name for the root Element of the Document; what is also
- * listed within the DOCTYPE declaration.
- *
- * @return String
- */
- public String getRootElementName() {
- return ColorNames.COLORS;
- }
-
- public int getStyle(String name) {
- int style = SWT.NORMAL;
- Element element = getColorElement(name);
- if (element != null) {
- if (Boolean.valueOf(element.getAttribute(BOLD)).booleanValue()) {
- style |= SWT.BOLD;
- }
- if (Boolean.valueOf(element.getAttribute(ITALIC)).booleanValue()) {
- style |= SWT.ITALIC;
- }
- }
- return style;
- }
-
- protected Element newColor(Document doc, String name, String foreground, String background) {
- if (doc == null || name == null || name.length() < 1)
- return null;
- Element newColor = doc.createElement(ColorNames.COLOR);
- newColor.setAttribute(ColorNames.NAME, name);
- if (foreground != null)
- newColor.setAttribute(ColorNames.FOREGROUND, foreground);
- if (background != null)
- newColor.setAttribute(ColorNames.BACKGROUND, background);
- return newColor;
- }
-
- protected Element newColor(Document doc, String name, String foreground, String background, boolean bold, boolean italic) {
- Element newColor = newColor(doc, name, foreground, background);
- if (newColor == null)
- return null;
- newColor.setAttribute(ColorNames.BOLD, String.valueOf(bold));
- newColor.setAttribute(ColorNames.ITALIC, String.valueOf(italic));
- return newColor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java
deleted file mode 100644
index bbbbad30c3..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java
+++ /dev/null
@@ -1,236 +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.ui.preferences.ui;
-
-
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.css.ui.style.IStyleConstantsCSS;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage;
-import org.eclipse.wst.sse.ui.preferences.ui.StyledTextColorPicker;
-
-public class CSSColorPage extends AbstractColorPage {
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceKeyGenerator.generateKey((String) i.next(), IContentTypeIdentifier.ContentTypeID_CSS)));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- protected Control createContents(Composite parent) {
- Composite pageComponent = createComposite(parent, 1);
- ((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
- super.createContents(pageComponent);
-
- // assigning one help for whole group
- // WorkbenchHelp.setHelp(pageComponent,
- // "com.ibm.etools.webedit.core.cssp2000"); //$NON-NLS-1$
- WorkbenchHelp.setHelp(pageComponent, IHelpContextIds.CSS_PREFWEBX_STYLES_HELPID);
-
- return pageComponent;
- }
-
- protected Composite createColoringComposite(Composite parent) {
- Composite coloringComposite = super.createColoringComposite(parent);
-
- // assigning one help for whole group
- // WorkbenchHelp.setHelp(coloringComposite,
- // "com.ibm.etools.webedit.core.cssp2100"); //$NON-NLS-1$
-
- return coloringComposite;
- }
-
- /**
- * getSampleText method comment.
- */
- public String getSampleText() {
- return ResourceHandler.getString("PrefsLabel.ColorSample"); //$NON-NLS-1$
- }
-
- /**
- *
- * @param contextStyleMap
- * java.util.Dictionary
- */
- protected void initContextStyleMap(Dictionary contextStyleMap) {
- contextStyleMap.put(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
- contextStyleMap.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
- contextStyleMap.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
- contextStyleMap.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
- contextStyleMap.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
- contextStyleMap.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
- contextStyleMap.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
- contextStyleMap.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
- contextStyleMap.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
- contextStyleMap.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
- contextStyleMap.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
- contextStyleMap.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
- contextStyleMap.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
- contextStyleMap.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
- contextStyleMap.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
-
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
- contextStyleMap.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
-
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
- contextStyleMap.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
- contextStyleMap.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.ERROR);
- }
-
- /**
- *
- * @param descriptions
- * java.util.Dictionary
- */
- protected void initDescriptions(Dictionary descriptions) {
- // create descriptions for hilighting types
- descriptions.put(IStyleConstantsCSS.NORMAL, ResourceHandler.getString("PrefsLabel.ColorNormal"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.ATMARK_RULE, ResourceHandler.getString("PrefsLabel.ColorAtmarkRule"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.SELECTOR, ResourceHandler.getString("PrefsLabel.ColorSelector"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.MEDIA, ResourceHandler.getString("PrefsLabel.ColorMedia"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.COMMENT, ResourceHandler.getString("PrefsLabel.ColorComment"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.PROPERTY_NAME, ResourceHandler.getString("PrefsLabel.ColorPropertyName"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.PROPERTY_VALUE, ResourceHandler.getString("PrefsLabel.ColorPropertyValue"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.URI, ResourceHandler.getString("PrefsLabel.ColorUri"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.STRING, ResourceHandler.getString("PrefsLabel.ColorString"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.COLON, ResourceHandler.getString("PrefsLabel.ColorColon"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.SEMI_COLON, ResourceHandler.getString("PrefsLabel.ColorSemiColon"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.CURLY_BRACE, ResourceHandler.getString("PrefsLabel.ColorCurlyBrace"));//$NON-NLS-1$
- descriptions.put(IStyleConstantsCSS.ERROR, ResourceHandler.getString("PrefsLabel.ColorError"));//$NON-NLS-1$
- }
-
- /**
- *
- * @param list
- * java.util.ArrayList
- */
- protected void initStyleList(ArrayList list) {
- list.add(IStyleConstantsCSS.NORMAL);
- list.add(IStyleConstantsCSS.ATMARK_RULE);
- list.add(IStyleConstantsCSS.SELECTOR);
- list.add(IStyleConstantsCSS.MEDIA);
- list.add(IStyleConstantsCSS.COMMENT);
- list.add(IStyleConstantsCSS.PROPERTY_NAME);
- list.add(IStyleConstantsCSS.PROPERTY_VALUE);
- list.add(IStyleConstantsCSS.URI);
- list.add(IStyleConstantsCSS.STRING);
- list.add(IStyleConstantsCSS.COLON);
- list.add(IStyleConstantsCSS.SEMI_COLON);
- list.add(IStyleConstantsCSS.CURLY_BRACE);
- list.add(IStyleConstantsCSS.ERROR);
- }
-
- /**
- * setupPicker method comment.
- */
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- if (plugin != null) {
- IModelManager mmanager = plugin.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_CSS).getParser());
- } else {
- picker.setParser(new CSSSourceParser());
- }
-
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
-
- picker.setGeneratorKey(IContentTypeIdentifier.ContentTypeID_CSS);
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return EditorPlugin.getDefault().getPreferenceStore();
- }
-
- public boolean performOk() {
- super.performOk();
-
- EditorPlugin.getDefault().savePluginPreferences();
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSFilesPreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSFilesPreferencePage.java
deleted file mode 100644
index 681a3834aa..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSFilesPreferencePage.java
+++ /dev/null
@@ -1,59 +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.ui.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.css.core.CSSCorePlugin;
-import org.eclipse.wst.css.ui.CSSEditorPlugin;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.preferences.XMLFilesPreferencePage;
-
-public class CSSFilesPreferencePage extends XMLFilesPreferencePage {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return CSSEditorPlugin.getDefault().getPreferenceStore();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#doSavePreferenceStore()
- */
- protected void doSavePreferenceStore() {
- CSSCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return CSSCorePlugin.getDefault().getPluginPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- WorkbenchHelp.setHelp(c, IHelpContextIds.CSS_PREFWEBX_FILES_HELPID);
- return c;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSSourcePreferencePage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSSourcePreferencePage.java
deleted file mode 100644
index ce5f660442..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSSourcePreferencePage.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.wst.css.ui.preferences.ui;
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.css.core.CSSCorePlugin;
-import org.eclipse.wst.css.core.preferences.CSSModelPreferenceNames;
-import org.eclipse.wst.css.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.css.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.xml.ui.preferences.XMLSourcePreferencePage;
-
-/**
- */
-public class CSSSourcePreferencePage extends XMLSourcePreferencePage {
- // Formatting
- private final static String FORMATTING_GROUP = ResourceHandler.getString("Formatting_UI_"); //$NON-NLS-1$
- // private final static String FORMATTING_SPLIT_LINES = "Split lines";
- private final static String FORMATTING_LINE_WIDTH = ResourceHandler.getString("Line_width__UI_"); //$NON-NLS-1$;
- private final static String FORMATTING_INSERT_LINE_BREAK = ResourceHandler.getString("PrefsLabel.WrappingInsertLineBreak"); //$NON-NLS-1$
- private final static String FORMATTING_WRAPPING_WITHOUT_ATTR = ResourceHandler.getString("PrefsLabel.WrappingWithoutAttr");//$NON-NLS-1$
- private final static String FORMATTING_INDENT_USING_TABS = ResourceHandler.getString("&Indent_using_tabs_3"); //$NON-NLS-1$
-
- // Case
- private final static String CASE_GROUP = ResourceHandler.getString("PrefsLabel.CaseGroup"); //$NON-NLS-1$
- private final static String CASE_IDENT = ResourceHandler.getString("PrefsLabel.CaseIdent"); //$NON-NLS-1$
- private final static String CASE_PROP_NAME = ResourceHandler.getString("PrefsLabel.CasePropName"); //$NON-NLS-1$
- private final static String CASE_PROP_VALUE = ResourceHandler.getString("PrefsLabel.CasePropValue"); //$NON-NLS-1$
- private final static String CASE_IDENT_UPPER = ResourceHandler.getString("PrefsLabel.CaseIdentUpper"); //$NON-NLS-1$
- private final static String CASE_IDENT_LOWER = ResourceHandler.getString("PrefsLabel.CaseIdentLower"); //$NON-NLS-1$
- private final static String CASE_PROP_NAME_UPPER = ResourceHandler.getString("PrefsLabel.CasePropNameUpper"); //$NON-NLS-1$
- private final static String CASE_PROP_NAME_LOWER = ResourceHandler.getString("PrefsLabel.CasePropNameLower"); //$NON-NLS-1$
- private final static String CASE_PROP_VALUE_UPPER = ResourceHandler.getString("PrefsLabel.CasePropValueUpper"); //$NON-NLS-1$
- private final static String CASE_PROP_VALUE_LOWER = ResourceHandler.getString("PrefsLabel.CasePropValueLower"); //$NON-NLS-1$
-
- // one property per one line
- protected Button fPropertyPerLine;
- // prohibit wrapping if style attribute
- protected Button fNowrapAttr;
-
- // case of output character
- // case of identifier
- protected Button fIdentUpper;
- protected Button fIdentLower;
- // case of property name
- protected Button fPropNameUpper;
- protected Button fPropNameLower;
- // case of property value
- protected Button fPropValueUpper;
- protected Button fPropValueLower;
-
- protected void createContentsForFormattingGroup(Composite parent) {
- Group formattingGroup = createGroup(parent, 2);
- formattingGroup.setText(FORMATTING_GROUP);
- // // assigning one help for whole group
- // WorkbenchHelp.setHelp(formattingGroup,
- // "com.ibm.etools.webedit.core.cssp1200"); //$NON-NLS-1$
-
- fLineWidthLabel = createLabel(formattingGroup, FORMATTING_LINE_WIDTH);
- fLineWidthText = new Text(formattingGroup, SWT.SINGLE | SWT.BORDER);
- GridData gData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.BEGINNING);
- gData.widthHint = 25;
- fLineWidthText.setLayoutData(gData);
- fLineWidthText.addModifyListener(this);
-
- fPropertyPerLine = createCheckBox(formattingGroup, FORMATTING_INSERT_LINE_BREAK);
- ((GridData) fPropertyPerLine.getLayoutData()).horizontalSpan = 2;
-
- fIndentUsingTabs = createCheckBox(formattingGroup, FORMATTING_INDENT_USING_TABS);
- ((GridData) fIndentUsingTabs.getLayoutData()).horizontalSpan = 2;
-
- fNowrapAttr = createCheckBox(formattingGroup, FORMATTING_WRAPPING_WITHOUT_ATTR);
- ((GridData) fNowrapAttr.getLayoutData()).horizontalSpan = 2;
- }
-
- protected void performDefaultsForFormattingGroup() {
- // Formatting
- Preferences prefs = getModelPreferences();
- fLineWidthText.setText(prefs.getDefaultString(CommonModelPreferenceNames.LINE_WIDTH));
- fPropertyPerLine.setSelection(prefs.getDefaultBoolean(CSSModelPreferenceNames.WRAPPING_ONE_PER_LINE));
- fIndentUsingTabs.setSelection(prefs.getDefaultBoolean(CommonModelPreferenceNames.INDENT_USING_TABS));
- fNowrapAttr.setSelection(prefs.getDefaultBoolean(CSSModelPreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR));
- }
-
- protected void initializeValuesForFormattingGroup() {
- // Formatting
- Preferences prefs = getModelPreferences();
- fLineWidthText.setText(prefs.getString(CommonModelPreferenceNames.LINE_WIDTH));
- fPropertyPerLine.setSelection(prefs.getBoolean(CSSModelPreferenceNames.WRAPPING_ONE_PER_LINE));
- fIndentUsingTabs.setSelection(prefs.getBoolean(CommonModelPreferenceNames.INDENT_USING_TABS));
- fNowrapAttr.setSelection(prefs.getBoolean(CSSModelPreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR));
- }
-
- protected void storeValuesForFormattingGroup() {
- // Formatting
- Preferences prefs = getModelPreferences();
- prefs.setValue(CommonModelPreferenceNames.LINE_WIDTH, fLineWidthText.getText());
- prefs.setValue(CSSModelPreferenceNames.WRAPPING_ONE_PER_LINE, fPropertyPerLine.getSelection());
- prefs.setValue(CommonModelPreferenceNames.INDENT_USING_TABS, fIndentUsingTabs.getSelection());
- prefs.setValue(CSSModelPreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, fNowrapAttr.getSelection());
- }
-
- protected void createContentsForContentAssistGroup(Composite parent) {
- // not content assist, but preferred case
- Group caseGroup = createGroup(parent, 3);
- caseGroup.setText(CASE_GROUP);
- // WorkbenchHelp.setHelp(caseGroup,
- // "com.ibm.etools.webedit.core.cssp1400"); //$NON-NLS-1$
-
- // createLabel(caseGroup, CASE_IDENT);
- // createLabel(caseGroup, CASE_PROP_NAME);
- // createLabel(caseGroup, CASE_PROP_VALUE);
-
- // use group for radio buttons so that associated label is read
- // Composite identGroup = createComposite(caseGroup, 1);
- Group identGroup = createGroup(caseGroup, 1);
- identGroup.setText(CASE_IDENT);
- fIdentUpper = createRadioButton(identGroup, CASE_IDENT_UPPER);
- fIdentLower = createRadioButton(identGroup, CASE_IDENT_LOWER);
-
- // use group for radio buttons so that associated label is read
- // Composite propNameGroup = createComposite(caseGroup, 1);
- Group propNameGroup = createGroup(caseGroup, 1);
- propNameGroup.setText(CASE_PROP_NAME);
- fPropNameUpper = createRadioButton(propNameGroup, CASE_PROP_NAME_UPPER);
- fPropNameLower = createRadioButton(propNameGroup, CASE_PROP_NAME_LOWER);
-
- // use group for radio buttons so that associated label is read
- // Composite propValueGroup = createComposite(caseGroup, 1);
- Group propValueGroup = createGroup(caseGroup, 1);
- propValueGroup.setText(CASE_PROP_VALUE);
- fPropValueUpper = createRadioButton(propValueGroup, CASE_PROP_VALUE_UPPER);
- fPropValueLower = createRadioButton(propValueGroup, CASE_PROP_VALUE_LOWER);
- }
-
- protected void performDefaultsForContentAssistGroup() {
- // not content assist, but preferred case
- Preferences prefs = getModelPreferences();
- fIdentUpper.setSelection(prefs.getDefaultInt(CSSModelPreferenceNames.CASE_IDENTIFIER) == CommonModelPreferenceNames.UPPER);
- fIdentLower.setSelection(prefs.getDefaultInt(CSSModelPreferenceNames.CASE_IDENTIFIER) == CommonModelPreferenceNames.LOWER);
- fPropNameUpper.setSelection(prefs.getDefaultInt(CSSModelPreferenceNames.CASE_PROPERTY_NAME) == CommonModelPreferenceNames.UPPER);
- fPropNameLower.setSelection(prefs.getDefaultInt(CSSModelPreferenceNames.CASE_PROPERTY_NAME) == CommonModelPreferenceNames.LOWER);
- fPropValueUpper.setSelection(prefs.getDefaultInt(CSSModelPreferenceNames.CASE_PROPERTY_VALUE) == CommonModelPreferenceNames.UPPER);
- fPropValueLower.setSelection(prefs.getDefaultInt(CSSModelPreferenceNames.CASE_PROPERTY_VALUE) == CommonModelPreferenceNames.LOWER);
- }
-
- protected void initializeValuesForContentAssistGroup() {
- // not content assist, but preferred case
- Preferences prefs = getModelPreferences();
- fIdentUpper.setSelection(prefs.getInt(CSSModelPreferenceNames.CASE_IDENTIFIER) == CommonModelPreferenceNames.UPPER);
- fIdentLower.setSelection(prefs.getInt(CSSModelPreferenceNames.CASE_IDENTIFIER) == CommonModelPreferenceNames.LOWER);
- fPropNameUpper.setSelection(prefs.getInt(CSSModelPreferenceNames.CASE_PROPERTY_NAME) == CommonModelPreferenceNames.UPPER);
- fPropNameLower.setSelection(prefs.getInt(CSSModelPreferenceNames.CASE_PROPERTY_NAME) == CommonModelPreferenceNames.LOWER);
- fPropValueUpper.setSelection(prefs.getInt(CSSModelPreferenceNames.CASE_PROPERTY_VALUE) == CommonModelPreferenceNames.UPPER);
- fPropValueLower.setSelection(prefs.getInt(CSSModelPreferenceNames.CASE_PROPERTY_VALUE) == CommonModelPreferenceNames.LOWER);
- }
-
- protected void storeValuesForContentAssistGroup() {
- // not content assist, but preferred case
- Preferences prefs = getModelPreferences();
- prefs.setValue(CSSModelPreferenceNames.CASE_IDENTIFIER, (fIdentUpper.getSelection()) ? CommonModelPreferenceNames.UPPER : CommonModelPreferenceNames.LOWER);
- prefs.setValue(CSSModelPreferenceNames.CASE_PROPERTY_NAME, (fPropNameUpper.getSelection()) ? CommonModelPreferenceNames.UPPER : CommonModelPreferenceNames.LOWER);
- prefs.setValue(CSSModelPreferenceNames.CASE_PROPERTY_VALUE, (fPropValueUpper.getSelection()) ? CommonModelPreferenceNames.UPPER : CommonModelPreferenceNames.LOWER);
- }
-
- protected void createContentsForGrammarConstraintsGroup(Composite parent) {
- // do nothing
- }
-
- protected void performDefaultsForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void initializeValuesForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void storeValuesForGrammarConstraintsGroup() {
- // do nothing
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- // protected IPreferenceStore doGetPreferenceStore() {
- // return CSSEditorPlugin.getDefault().getPreferenceStore();
- // }
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#doSavePreferenceStore()
- */
- protected void doSavePreferenceStore() {
- EditorPlugin.getDefault().savePluginPreferences();
- CSSCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return CSSCorePlugin.getDefault().getPluginPreferences();
- }
-
- /*
- * helper method to generate content type id specific preference keys
- */
- protected String getKey(String key) {
- String contentTypeId = IContentTypeIdentifier.ContentTypeID_CSS;
- return PreferenceKeyGenerator.generateKey(key, contentTypeId);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- WorkbenchHelp.setHelp(c, IHelpContextIds.CSS_PREFWEBX_SOURCE_HELPID);
- return c;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/registry/AdapterFactoryProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/registry/AdapterFactoryProviderCSS.java
deleted file mode 100644
index f5f854f233..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/registry/AdapterFactoryProviderCSS.java
+++ /dev/null
@@ -1,55 +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.ui.registry;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.css.core.modelhandler.ModelHandlerForCSS;
-import org.eclipse.wst.css.ui.views.contentoutline.JFaceNodeAdapterFactoryCSS;
-import org.eclipse.wst.css.ui.views.properties.CSSPropertySourceAdapterFactory;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.IFactoryRegistry;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.util.Assert;
-import org.eclipse.wst.sse.ui.views.contentoutline.IJFaceNodeAdapter;
-
-public class AdapterFactoryProviderCSS implements AdapterFactoryProvider {
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForCSS);
- }
-
- public void addAdapterFactories(IStructuredModel structuredModel) {
- // add the normal content based factories to model's registry
- addContentBasedFactories(structuredModel);
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
- IFactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- AdapterFactory factory = null;
-
- factory = factoryRegistry.getFactoryFor(IPropertySource.class);
- if (factory == null) {
- factory = new CSSPropertySourceAdapterFactory(IPropertySource.class, true);
- factoryRegistry.addFactory(factory);
- }
-
- factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
- if (factory == null) {
- factory = new JFaceNodeAdapterFactoryCSS(IJFaceNodeAdapter.class, true);
- factoryRegistry.addFactory(factory);
- }
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
-
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/CSSTextColors.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/CSSTextColors.java
deleted file mode 100644
index 8bf4594aab..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/CSSTextColors.java
+++ /dev/null
@@ -1,143 +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.ui.style;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.css.ui.preferences.CSSPreferenceManager;
-import org.eclipse.wst.css.ui.preferences.ui.CSSColorManager;
-import org.eclipse.wst.sse.ui.util.EditorUtility;
-
-/**
- * @deprecated Most methods and constants moved to LineStyleProviderForCSS or
- * IStyleConstantsCSS. TODO remove in C5 or earlier
- */
-public class CSSTextColors {
- class TextColors {
-
- TextColors() {
- super();
- }
-
- void setTextAttribute(Object key, RGB foreground, RGB background, int style) {
- TextAttribute attribute = new TextAttribute(EditorUtility.getColor(foreground), EditorUtility.getColor(background), style);
- setTextAttribute(key, attribute);
- }
-
- void setTextAttribute(Object key, TextAttribute attribute) {
- TextAttribute oldAttribute = (TextAttribute) fAttributeTable.get(key);
- if (oldAttribute != null) {
- fAttributeTable.remove(key);
- }
- fAttributeTable.put(key, attribute);
- }
-
- TextAttribute getTextAttribute(Object key) {
- return (TextAttribute) fAttributeTable.get(key);
- }
-
- private Map fAttributeTable = new HashMap();
- }
-
- // color types
- public static final String NORMAL = "NORMAL"; //$NON-NLS-1$
- public static final String ATMARK_RULE = "ATMARK_RULE"; //$NON-NLS-1$
- public static final String SELECTOR = "SELECTOR"; //$NON-NLS-1$
- public static final String MEDIA = "MEDIA"; //$NON-NLS-1$
- public static final String COMMENT = "COMMENT"; //$NON-NLS-1$
- public static final String PROPERTY_NAME = "PROPERTY_NAME"; //$NON-NLS-1$
- public static final String PROPERTY_VALUE = "PROPERTY_VALUE"; //$NON-NLS-1$
- public static final String URI = "URI"; //$NON-NLS-1$
- public static final String STRING = "STRING"; //$NON-NLS-1$
- public static final String COLON = "COLON"; //$NON-NLS-1$
- public static final String SEMI_COLON = "SEMI_COLON"; //$NON-NLS-1$
- public static final String CURLY_BRACE = "CURLY_BRACE"; //$NON-NLS-1$
- public static final String ERROR = "ERROR"; //$NON-NLS-1$
- private static CSSTextColors fInstance = null;
- private TextColors fTextColors = null;
- private Map fPrefToType = null;
-
- protected CSSTextColors() {
- super();
- applyPreference();
- }
-
- public synchronized static CSSTextColors getInstance() {
- if (fInstance == null) {
- fInstance = new CSSTextColors();
- }
- return fInstance;
- }
-
- public void applyPreference() {
- if (fTextColors == null) {
- fTextColors = new TextColors();
- }
-
- if (fPrefToType == null) {
- fPrefToType = new HashMap();
- fPrefToType.put(NORMAL, CSSColorManager.NORMAL);
- fPrefToType.put(ATMARK_RULE, CSSColorManager.ATMARK_RULE);
- fPrefToType.put(SELECTOR, CSSColorManager.SELECTOR);
- fPrefToType.put(MEDIA, CSSColorManager.MEDIA);
- fPrefToType.put(COMMENT, CSSColorManager.COMMENT);
- fPrefToType.put(PROPERTY_NAME, CSSColorManager.PROPERTY_NAME);
- fPrefToType.put(PROPERTY_VALUE, CSSColorManager.PROPERTY_VALUE);
- fPrefToType.put(URI, CSSColorManager.URI);
- fPrefToType.put(STRING, CSSColorManager.STRING);
- fPrefToType.put(COLON, CSSColorManager.COLON);
- fPrefToType.put(SEMI_COLON, CSSColorManager.SEMI_COLON);
- fPrefToType.put(CURLY_BRACE, CSSColorManager.CURLY_BRACE);
- fPrefToType.put(ERROR, CSSColorManager.ERROR);
- }
- boolean bEnabled = CSSPreferenceManager.getInstance().getColorEnabled();
- CSSColorManager pref = CSSColorManager.getInstance();
-
- Iterator i = fPrefToType.keySet().iterator();
- while (i.hasNext()) {
- String key = (String) i.next();
- if (bEnabled) {
- String type = (String) fPrefToType.get(key);
- setTextAttribute(key, pref.getForegroundRGB(type), pref.getBackgroundRGB(type), pref.getStyle(type));
- } else {
- setTextAttribute(key, null);
- }
- }
- }
-
- public void dispose() {
- }
-
- public TextAttribute getTextAttribute(String type) {
- if (fTextColors == null) {
- applyPreference();
- }
- return fTextColors.getTextAttribute(type);
- }
-
- private void setTextAttribute(String type, RGB foreground) {
- setTextAttribute(type, foreground, null, SWT.NORMAL);
- }
-
- private void setTextAttribute(String type, RGB foreground, RGB background, int style) {
- if (fTextColors == null) {
- return;
- }
- fTextColors.setTextAttribute(type, foreground, background, style);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/IStyleConstantsCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/IStyleConstantsCSS.java
deleted file mode 100644
index 31eb84e7ed..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/IStyleConstantsCSS.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.ui.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsCSS {
- public static final String NORMAL = "NORMAL"; //$NON-NLS-1$
- public static final String ATMARK_RULE = "ATMARK_RULE"; //$NON-NLS-1$
- public static final String SELECTOR = "SELECTOR"; //$NON-NLS-1$
- public static final String MEDIA = "MEDIA"; //$NON-NLS-1$
- public static final String COMMENT = "COMMENT"; //$NON-NLS-1$
- public static final String PROPERTY_NAME = "PROPERTY_NAME"; //$NON-NLS-1$
- public static final String PROPERTY_VALUE = "PROPERTY_VALUE"; //$NON-NLS-1$
- public static final String URI = "URI"; //$NON-NLS-1$
- public static final String STRING = "STRING"; //$NON-NLS-1$
- public static final String COLON = "COLON"; //$NON-NLS-1$
- public static final String SEMI_COLON = "SEMI_COLON"; //$NON-NLS-1$
- public static final String CURLY_BRACE = "CURLY_BRACE"; //$NON-NLS-1$
- public static final String ERROR = "ERROR"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForCSS.java
deleted file mode 100644
index 27bf5378cd..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForCSS.java
+++ /dev/null
@@ -1,202 +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.ui.style;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-
-/**
- */
-public class LineStyleProviderForCSS extends AbstractLineStyleProvider implements LineStyleProvider {
- /** Contains region to style mapping */
- private Map fColorTypes;
-
- /**
- * LineStyleProviderForEmbeddedCSS constructor comment.
- */
- public LineStyleProviderForCSS() {
- super();
- initAttributes();
- loadColors();
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- if (region != null) {
- String type = region.getType();
- if (type != null) {
- return getAttributeFor(type);
- }
- }
- return (TextAttribute) getTextAttributes().get(IStyleConstantsCSS.NORMAL);
- }
-
- protected TextAttribute getAttributeFor(String type) {
- return (TextAttribute) getTextAttributes().get(fColorTypes.get(type));
- }
-
- private void initAttributes() {
- if (fColorTypes == null) {
- fColorTypes = new HashMap();
- }
- fColorTypes.put(CSSRegionContexts.CSS_COMMENT, IStyleConstantsCSS.COMMENT);
- fColorTypes.put(CSSRegionContexts.CSS_CDO, IStyleConstantsCSS.COMMENT);
- fColorTypes.put(CSSRegionContexts.CSS_CDC, IStyleConstantsCSS.COMMENT);
- fColorTypes.put(CSSRegionContexts.CSS_S, IStyleConstantsCSS.NORMAL);
-
- fColorTypes.put(CSSRegionContexts.CSS_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
- fColorTypes.put(CSSRegionContexts.CSS_LBRACE, IStyleConstantsCSS.CURLY_BRACE);
- fColorTypes.put(CSSRegionContexts.CSS_RBRACE, IStyleConstantsCSS.CURLY_BRACE);
-
- fColorTypes.put(CSSRegionContexts.CSS_IMPORT, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_PAGE, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_MEDIA, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_FONT_FACE, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_CHARSET, IStyleConstantsCSS.ATMARK_RULE);
- fColorTypes.put(CSSRegionContexts.CSS_ATKEYWORD, IStyleConstantsCSS.ATMARK_RULE);
-
- fColorTypes.put(CSSRegionContexts.CSS_STRING, IStyleConstantsCSS.STRING);
- fColorTypes.put(CSSRegionContexts.CSS_URI, IStyleConstantsCSS.URI);
- fColorTypes.put(CSSRegionContexts.CSS_MEDIUM, IStyleConstantsCSS.MEDIA);
- fColorTypes.put(CSSRegionContexts.CSS_MEDIA_SEPARATOR, IStyleConstantsCSS.MEDIA);
-
- fColorTypes.put(CSSRegionContexts.CSS_CHARSET_NAME, IStyleConstantsCSS.STRING);
-
- fColorTypes.put(CSSRegionContexts.CSS_PAGE_SELECTOR, IStyleConstantsCSS.MEDIA);
-
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_UNIVERSAL, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_PSEUDO, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_CLASS, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ID, IStyleConstantsCSS.SELECTOR);
-
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_COMBINATOR, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_SEPARATOR, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE, IStyleConstantsCSS.SELECTOR);
- fColorTypes.put(CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR, IStyleConstantsCSS.SELECTOR);
-
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_PROPERTY, IStyleConstantsCSS.PROPERTY_NAME);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_STRING, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_URI, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_HASH, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_VALUE_S, IStyleConstantsCSS.PROPERTY_VALUE);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_SEPARATOR, IStyleConstantsCSS.COLON);
- fColorTypes.put(CSSRegionContexts.CSS_DECLARATION_DELIMITER, IStyleConstantsCSS.SEMI_COLON);
-
- fColorTypes.put(CSSRegionContexts.CSS_UNKNOWN, IStyleConstantsCSS.NORMAL);
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (getPreferenceKey(IStyleConstantsCSS.ATMARK_RULE).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ATMARK_RULE;
- } else if (getPreferenceKey(IStyleConstantsCSS.COLON).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.COLON;
- } else if (getPreferenceKey(IStyleConstantsCSS.COMMENT).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.COMMENT;
- } else if (getPreferenceKey(IStyleConstantsCSS.CURLY_BRACE).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.CURLY_BRACE;
- } else if (getPreferenceKey(IStyleConstantsCSS.ERROR).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.ERROR;
- } else if (getPreferenceKey(IStyleConstantsCSS.MEDIA).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.MEDIA;
- } else if (getPreferenceKey(IStyleConstantsCSS.NORMAL).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.NORMAL;
- } else if (getPreferenceKey(IStyleConstantsCSS.PROPERTY_NAME).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.PROPERTY_NAME;
- } else if (getPreferenceKey(IStyleConstantsCSS.PROPERTY_VALUE).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.PROPERTY_VALUE;
- } else if (getPreferenceKey(IStyleConstantsCSS.SELECTOR).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.SELECTOR;
- } else if (getPreferenceKey(IStyleConstantsCSS.SEMI_COLON).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.SEMI_COLON;
- } else if (getPreferenceKey(IStyleConstantsCSS.STRING).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.STRING;
- } else if (getPreferenceKey(IStyleConstantsCSS.URI).equals(prefKey)) {
- styleKey = IStyleConstantsCSS.URI;
- }
- } else {
- // this is around for old deprecated preferencesChanged() method
- // TODO remove when preferencesChanged() is removed
- loadColors();
- super.handlePropertyChange(event);
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- super.handlePropertyChange(event);
- }
- }
-
- public void release() {
- if (fColorTypes != null) {
- fColorTypes.clear();
- }
- super.release();
- }
-
- public void loadColors() {
- clearColors();
- addTextAttribute(IStyleConstantsCSS.ATMARK_RULE);
- addTextAttribute(IStyleConstantsCSS.COLON);
- addTextAttribute(IStyleConstantsCSS.COMMENT);
- addTextAttribute(IStyleConstantsCSS.CURLY_BRACE);
- addTextAttribute(IStyleConstantsCSS.ERROR);
- addTextAttribute(IStyleConstantsCSS.MEDIA);
- addTextAttribute(IStyleConstantsCSS.NORMAL);
- addTextAttribute(IStyleConstantsCSS.PROPERTY_NAME);
- addTextAttribute(IStyleConstantsCSS.PROPERTY_VALUE);
- addTextAttribute(IStyleConstantsCSS.SELECTOR);
- addTextAttribute(IStyleConstantsCSS.SEMI_COLON);
- addTextAttribute(IStyleConstantsCSS.STRING);
- addTextAttribute(IStyleConstantsCSS.URI);
- }
-
- protected void clearColors() {
- getTextAttributes().clear();
- }
-
- protected String getPreferenceKey(String key) {
- String contentTypeId = IContentTypeIdentifier.ContentTypeID_CSS;
- return PreferenceKeyGenerator.generateKey(key, contentTypeId);
- }
-
- protected IPreferenceStore getColorPreferences() {
- return EditorPlugin.getDefault().getPreferenceStore();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForEmbeddedCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForEmbeddedCSS.java
deleted file mode 100644
index 71bc4b2a49..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/style/LineStyleProviderForEmbeddedCSS.java
+++ /dev/null
@@ -1,104 +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.ui.style;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.wst.css.core.parser.CSSTextParser;
-import org.eclipse.wst.css.core.parser.CSSTextToken;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-public class LineStyleProviderForEmbeddedCSS extends LineStyleProviderForCSS {
-
- public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
- int regionStart = typedRegion.getOffset();
- int regionEnd = regionStart + typedRegion.getLength();
- IStructuredDocumentRegion wholeRegion = getDocument().getRegionAtCharacterOffset(regionStart);
-
- List tokens;
- int offset;
-
- ParserCache cache = getCachedParsingResult(wholeRegion);
- if (cache == null) {
- offset = wholeRegion.getStartOffset();
- String content;
- content = wholeRegion.getText();
-
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, content);
- tokens = parser.getTokenList();
- cacheParsingResult(wholeRegion, new ParserCache(offset, tokens));
- } else {
- tokens = cache.tokens;
- offset = cache.offset;
- }
-
- boolean result = false;
-
- if (0 < tokens.size()) {
- int start = offset;
- Iterator i = tokens.iterator();
- while (i.hasNext()) {
- CSSTextToken token = (CSSTextToken) i.next();
- if (regionStart <= start && start < regionEnd) {
- TextAttribute attribute = getAttributeFor(token.kind);
- holdResults.add(new StyleRange(start, token.length, attribute.getForeground(), attribute.getBackground()));
- }
- start += token.length;
- }
- result = true;
- }
-
- return result;
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- return null;
- }
-
- private void cleanupCache() {
- fCacheKey = -1;
- fCacheResult = null;
- }
-
- private ParserCache getCachedParsingResult(IStructuredDocumentRegion region) {
- if (fCacheKey == region.getText().hashCode()) {
- return fCacheResult;
- }
- return null;
- }
-
- private void cacheParsingResult(IStructuredDocumentRegion region, ParserCache result) {
- fCacheKey = region.getText().hashCode();
- fCacheResult = result;
- }
-
- public void release() {
- super.release();
- cleanupCache();
- }
-
- private class ParserCache {
- ParserCache(int newOffset, List newTokens) {
- offset = newOffset;
- tokens = newTokens;
- }
-
- int offset;
- List tokens;
- }
-
- int fCacheKey = -1;
- ParserCache fCacheResult = null;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/taginfo/CSSBestMatchHoverProcessor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/taginfo/CSSBestMatchHoverProcessor.java
deleted file mode 100644
index 2c4a0feb23..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/taginfo/CSSBestMatchHoverProcessor.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.ui.taginfo;
-
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.wst.sse.ui.taginfo.AbstractBestMatchHoverProcessor;
-
-/**
- * Provides the best css hover help documentation (by using other hover help
- * processors) Priority of hover help processors is: ProblemHoverProcessor,
- * AnnotationHoverProcessor
- */
-public class CSSBestMatchHoverProcessor extends AbstractBestMatchHoverProcessor {
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.taginfo.AbstractBestMatchHoverProcessor#getTagInfoHover()
- */
- protected ITextHover getTagInfoHover() {
- // CSS has no taginfo hover
- return null;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/text/CSSDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/text/CSSDocumentRegionEdgeMatcher.java
deleted file mode 100644
index ce975a9b81..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/text/CSSDocumentRegionEdgeMatcher.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.ui.text;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.ICharacterPairMatcher;
-import org.eclipse.wst.css.core.parser.CSSRegionContexts;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-public class CSSDocumentRegionEdgeMatcher implements ICharacterPairMatcher {
-
- private int fAnchor = ICharacterPairMatcher.LEFT;
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public CSSDocumentRegionEdgeMatcher() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
- */
- public int getAnchor() {
- return fAnchor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.ui.text.DocumentRegionEdgeMatcher#match(org.eclipse.jface.text.IDocument,
- * int)
- */
-
-
- public IRegion match(IDocument document, int offset) {
- if (document instanceof IStructuredDocument) {
- IStructuredDocumentRegion r = ((IStructuredDocument) document).getRegionAtCharacterOffset(offset);
- if (r != null) {
- if (r.getPrevious() != null && r.getStartOffset() == offset && r.getPrevious().getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- r = r.getPrevious();
- }
- if (r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- while (r != null && !r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
- r = r.getPrevious();
- }
- if (r != null) {
- return new Region(r.getStartOffset(), 1);
- }
- } else if (r.getType().equals(CSSRegionContexts.CSS_LBRACE)) {
- while (r != null && !r.getType().equals(CSSRegionContexts.CSS_RBRACE)) {
- r = r.getNext();
- }
- if (r != null) {
- return new Region(r.getEndOffset() - 1, 1);
- }
- }
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java
deleted file mode 100644
index 82f94e504e..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java
+++ /dev/null
@@ -1,118 +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.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICSSValue;
-import org.eclipse.wst.css.ui.CSSEditorPlugin;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.view.events.NodeSelectionChangedEvent;
-import org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.views.contentoutline.StructuredContentOutlineConfiguration;
-
-public class CSSContentOutlineConfiguration extends StructuredContentOutlineConfiguration {
- private final String OUTLINE_SORT_PREF = "outline-sort"; //$NON-NLS-1$
-
- public CSSContentOutlineConfiguration() {
- super();
- }
-
- public IContributionItem[] createToolbarContributions(TreeViewer viewer) {
- IContributionItem[] items = super.createToolbarContributions(viewer);
-
- SortAction sortAction = new SortAction(viewer, CSSEditorPlugin.getDefault().getPreferenceStore(), getSortPreferenceKey());
- IContributionItem sortItem = new PropertyChangeUpdateActionContributionItem(sortAction);
-
- if (items == null) {
- items = new IContributionItem[1];
- items[0] = sortItem;
- } else {
- IContributionItem[] combinedItems = new IContributionItem[items.length + 1];
- combinedItems[0] = sortItem;
- System.arraycopy(items, 0, combinedItems, 1, items.length);
- items = combinedItems;
- }
- return items;
- }
-
- /**
- * @see com.ibm.sse.editor.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public IContentProvider getContentProvider(TreeViewer viewer) {
- if (fContentProvider == null && getFactory() != null)
- fContentProvider = new JFaceNodeContentProviderCSS((AdapterFactory) getFactory());
- return fContentProvider;
- }
-
- /**
- * @see com.ibm.sse.editor.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null && getFactory() != null)
- fLabelProvider = new JFaceNodeLabelProviderCSS((AdapterFactory) getFactory());
- return fLabelProvider;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.views.contentoutline.ContentOutlineConfiguration#getNodes(java.util.List)
- */
- public List getNodes(List nodes) {
- List filteredNodes = new ArrayList(nodes);
-
- List targetNodes = new ArrayList();
- Iterator i = filteredNodes.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof ICSSNode) {
- ICSSNode node = (ICSSNode) obj;
- short nodeType = node.getNodeType();
- if (node instanceof ICSSValue) {
- while (node != null && !(node instanceof ICSSStyleDeclItem)) {
- node = node.getParentNode();
- }
- } else if (nodeType == ICSSNode.STYLEDECLARATION_NODE) {
- node = node.getParentNode();
- } else if (nodeType == ICSSNode.MEDIALIST_NODE) {
- node = node.getParentNode();
- }
- if (node != null) {
- obj = node;
- }
- }
- targetNodes.add(obj);
- }
-
- return targetNodes;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.views.contentoutline.ContentOutlineConfiguration#getSelectedNodes(com.ibm.sse.editor.view.events.NodeSelectionChangedEvent)
- */
- public List getSelectedNodes(NodeSelectionChangedEvent event) {
- return getNodes(event.getSelectedNodes());
- }
-
- public String getSortPreferenceKey() {
- return PreferenceKeyGenerator.generateKey(OUTLINE_SORT_PREF, getDeclaringID());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSNodeAdapter.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSNodeAdapter.java
deleted file mode 100644
index d012df085d..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSNodeAdapter.java
+++ /dev/null
@@ -1,319 +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.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-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.ICSSStyleRule;
-import org.eclipse.wst.css.core.document.ICSSStyleSheet;
-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.views.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.views.contentoutline.IJFaceNodeAdapterFactory;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-//public class CSSNodeAdapter extends JFaceNodeAdapter {
-public class CSSNodeAdapter implements INodeAdapter, Runnable {
- class NotifyContext {
- NotifyContext(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- this.notifier = notifier;
- this.eventType = eventType;
- this.changedFeature = changedFeature;
- this.oldValue = oldValue;
- this.newValue = newValue;
- this.pos = pos;
- }
-
- void fire() {
- internalNotifyChanged(notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
-
- INodeNotifier notifier;
- int eventType;
- Object changedFeature;
- Object oldValue;
- Object newValue;
- int pos;
- }
-
- class StyleViewUpdater implements Runnable {
- public void run() {
- if (lastUpdater == this) {
- internalActionPerformed();
- lastUpdater = null;
- }
- }
- }
-
- protected AdapterFactory adapterFactory;
- private Vector notifyQueue;
- StyleViewUpdater lastUpdater;
- protected int delayMSecs = 500;
- final static Class ADAPTER_KEY = IJFaceNodeAdapter.class;
-
- public CSSNodeAdapter(AdapterFactory adapterFactory) {
- super();
- this.adapterFactory = adapterFactory;
- }
-
- /**
- * Insert the method's description here.
- */
- protected void internalActionPerformed() {
- if (notifyQueue == null) {
- return;
- }
- boolean refresh_all = false;
- boolean refresh_rule = false;
- int pos_all = 0;
- List targets = new ArrayList();
- for (int i = 0; i < notifyQueue.size(); i++) {
- NotifyContext context = (NotifyContext) notifyQueue.get(i);
- if (context.notifier instanceof ICSSStyleSheet) {
- refresh_all = true;
- pos_all = i;
- }
- if (context.notifier instanceof ICSSStyleDeclaration) {
- refresh_rule = true;
- targets.add(context);
- // pos_rule = i;
- }
- // ((NotifyContext) notifyQueue.get(i)).fire();
- }
- if (refresh_all) {
- ((NotifyContext) notifyQueue.get(pos_all)).fire();
- } else if (refresh_rule) {
- Iterator i = targets.iterator();
- while (i.hasNext()) {
- ((NotifyContext) i.next()).fire();
- }
- // else if (refresh_rule) internalRefreshAll();
- } else {
- for (int i = 0; i < notifyQueue.size(); i++) {
- ((NotifyContext) notifyQueue.get(i)).fire();
- }
- }
- notifyQueue.clear();
- }
-
- /**
- * Called by the object being adapter (the notifier) when something has
- * changed.
- */
- public void internalNotifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- Iterator iterator = ((IJFaceNodeAdapterFactory) adapterFactory).getListeners().iterator();
- while (iterator.hasNext()) {
- Object listener = iterator.next();
- if (listener instanceof StructuredViewer) {
- notifyChangedForStructuredViewer((StructuredViewer) listener, notifier, eventType, changedFeature, oldValue, newValue, pos);
- } else if (listener instanceof PropertySheetPage) {
- notifyChangedForPropertySheetPage((PropertySheetPage) listener, notifier, eventType, changedFeature, oldValue, newValue, pos);
- }
- }
- }
-
- private void notifyChangedForPropertySheetPage(PropertySheetPage page, INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (page.getControl() == null || page.getControl().isDisposed()) {
- return;
- }
- if (eventType == INodeNotifier.CHANGE || eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE) {
- page.refresh();
- }
- }
-
- private void notifyChangedForStructuredViewer(StructuredViewer viewer, INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (viewer.getControl() == null || viewer.getControl().isDisposed()) {
- return;
- }
- if (eventType == INodeNotifier.CHANGE) {
- if (notifier instanceof ICSSStyleSheet) {
- ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
- if (temp instanceof ICSSStyleRule) {
- viewer.refresh();
- } else {
- for (;;) {
- if (temp instanceof ICSSStyleRule) {
- break;
- }
- temp = temp.getParentNode();
- if (temp == null) {
- break;
- }
- }
- if (temp == null || temp instanceof ICSSStyleSheet) {
- viewer.refresh();
- } else {
- viewer.refresh(temp);
- }
- }
- } else {
- ICSSNode temp = (ICSSNode) notifier;
- if (temp != null) {
- temp = temp.getParentNode();
- }
- if (temp == null || temp instanceof ICSSStyleSheet) {
- viewer.refresh();
- } else {
- viewer.refresh(temp);
- }
- }
- }
- if (eventType == INodeNotifier.ADD) {
- if (notifier instanceof ICSSStyleSheet) {
- ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
- if (temp instanceof ICSSStyleRule) {
- viewer.refresh();
- } else {
- for (;;) {
- if (temp instanceof ICSSStyleRule) {
- break;
- }
- temp = temp.getParentNode();
- if (temp == null) {
- break;
- }
- }
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- } else {
- viewer.refresh(temp);
- }
- } else {
- if (newValue != null && (newValue instanceof ICSSStyleDeclItem)) {
- viewer.refresh(((ICSSNode) newValue).getParentNode());
- } else {
- ICSSNode temp = (ICSSNode) notifier;
- if (temp != null) {
- temp = temp.getParentNode();
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- } else {
- viewer.refresh(temp);
- }
- }
- }
- } else if (eventType == INodeNotifier.REMOVE) {
- if (notifier instanceof ICSSStyleSheet) {
- ICSSNode temp = (changedFeature != null) ? (ICSSNode) changedFeature : (ICSSNode) newValue;
- if (temp instanceof ICSSStyleRule) {
- viewer.refresh();
- } else {
- for (;;) {
- if (temp instanceof ICSSStyleRule) {
- break;
- }
- temp = temp.getParentNode();
- if (temp == null) {
- break;
- }
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- } else {
- viewer.refresh(temp);
- }
- }
- } else {
- // viewer.refresh(notifier);
- ICSSNode temp = (ICSSNode) notifier;
- if (temp != null) {
- temp = temp.getParentNode();
- }
- if (temp == null || (temp instanceof ICSSStyleSheet)) {
- viewer.refresh();
- } else {
- viewer.refresh(temp);
- }
- }
- }
- // }
- }
-
- /**
- *
- */
- public void internalRefreshAll() {
- Collection listeners = ((JFaceNodeAdapterFactoryCSS) adapterFactory).getListeners();
- Iterator iterator = listeners.iterator();
- while (iterator.hasNext()) {
- Object listener = iterator.next();
- if (listener instanceof StructuredViewer) {
- StructuredViewer viewer = (StructuredViewer) listener;
- if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
- viewer.refresh();
- }
- } else if (listener instanceof PropertySheetPage) {
- PropertySheetPage page = (PropertySheetPage) listener;
- if (page.getControl() != null && !page.getControl().isDisposed()) {
- page.refresh();
- }
- }
- }
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type.equals(ADAPTER_KEY);
- }
-
- /**
- * Called by the object being adapter (the notifier) when something has
- * changed.
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (notifyQueue == null)
- notifyQueue = new Vector();
- notifyQueue.add(new NotifyContext(notifier, eventType, changedFeature, oldValue, newValue, pos));
- // TODO-future: there's probably a better way than relying on async
- // exec
- if (Thread.currentThread() == getDisplay().getThread())
- getDisplay().timerExec(delayMSecs, this);
- else
- getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (getDisplay() != null) {
- getDisplay().timerExec(delayMSecs, this);
- }
- }
- });
- }
-
- Display getDisplay() {
- return PlatformUI.getWorkbench().getDisplay();
- }
-
- /**
- * this method is intended only for timerExec()
- */
- public void run() {
- lastUpdater = new StyleViewUpdater();
- getDisplay().asyncExec(lastUpdater);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeAdapterFactoryCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeAdapterFactoryCSS.java
deleted file mode 100644
index df96b82b76..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeAdapterFactoryCSS.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.ui.views.contentoutline;
-
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.views.contentoutline.JFaceNodeAdapterFactory;
-
-public class JFaceNodeAdapterFactoryCSS extends JFaceNodeAdapterFactory {
- public JFaceNodeAdapterFactoryCSS() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactoryCSS(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
-
- protected void initAdapter(INodeAdapter adapter, INodeNotifier node) {
- }
-
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- singletonAdapter = new CSSNodeAdapter(this);
- initAdapter(singletonAdapter, node);
- }
- return singletonAdapter;
- }
-
- public void release() {
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
deleted file mode 100644
index 3235b9cae1..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java
+++ /dev/null
@@ -1,263 +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.ui.views.contentoutline;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-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.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclaration;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.xml.ui.views.contentoutline.JFaceNodeContentProvider;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * A Content provider for a JFace viewer used to display DOM nodes. This
- * content provider takes an adapter factory to create JFace adapters for the
- * nodes in the tree.
- */
-public class JFaceNodeContentProviderCSS extends JFaceNodeContentProvider {
- protected AdapterFactory adapterFactory;
-
- //protected DomainNotifier domainNotifier;
- /**
- */
- public JFaceNodeContentProviderCSS(AdapterFactory adapterFactory) {
- super(adapterFactory);
- this.adapterFactory = adapterFactory;
- }
-
- /**
- */
- protected void adaptElements(Object element) {
-
- ICSSNode node;
-
- if (element instanceof ICSSModel) {
- ICSSDocument doc = ((ICSSModel) element).getDocument();
- adapterFactory.adapt((INodeNotifier) doc);
- node = doc.getFirstChild();
- } else if (element instanceof ICSSNode) {
- node = ((ICSSNode) element).getFirstChild();
- } else {
- return;
- }
-
- while (node != null) {
- // if (node instanceof CSSRule) {
- adapterFactory.adapt((INodeNotifier) node);
- adaptElements(node);
- // }
- // else{
- // adapterFactory.adapt((INodeNotifier) node);
- // }
-
- node = node.getNextSibling();
- }
- }
-
- /**
- */
- protected void addElements(Object element, ArrayList v) {
-
- ICSSNode node;
-
- if (element instanceof ICSSModel) {
- ICSSModel model = (ICSSModel) element;
- ICSSDocument doc = model.getDocument();
- // addAdapter((INodeNotifier) doc);
- adapterFactory.adapt((INodeNotifier) doc);
- node = doc.getFirstChild();
- } else if (element instanceof ICSSNode) {
- node = ((ICSSNode) element).getFirstChild();
- } else
- return;
-
- while (node != null) {
- if (node instanceof CSSRule) {
- v.add(node);
- }
-
- node = node.getNextSibling();
- }
-
- }
-
- /**
- * The visual part that is using this content provider is about to be
- * disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- }
-
- /**
- * Returns an enumeration containing all child nodes of the given element,
- * which represents a node in a tree. The difference to
- * <code>IStructuredContentProvider.getElements(Object)</code> is as
- * follows: <code>getElements</code> is called to obtain the tree
- * viewer's root elements. Method <code>getChildren</code> is used to
- * obtain the children of a given node in the tree, which can can be a
- * root node, too.
- */
- public Object[] getChildren(Object object) {
- if (object instanceof ICSSNode) {
- ICSSNode node = (ICSSNode) object;
- short nodeType = node.getNodeType();
- if (nodeType == ICSSNode.STYLERULE_NODE || nodeType == ICSSNode.PAGERULE_NODE || nodeType == ICSSNode.FONTFACERULE_NODE) {
- for (node = node.getFirstChild(); node != null && !(node instanceof ICSSStyleDeclaration); node.getNextSibling()) {
- // nop
- }
- }
- List children = new ArrayList();
- ICSSNode child = (node != null) ? node.getFirstChild() : null;
- while (child != null) {
- if (!(child instanceof ICSSPrimitiveValue) && !(child instanceof MediaList)) {
- children.add(child);
- }
- child = child.getNextSibling();
- }
- return children.toArray();
- }
- return new Object[0];
- }
-
- /**
- * Returns an enumeration with the elements belonging to the passed
- * element. These elements can be presented as rows in a table, items in a
- * list etc.
- */
- public Object[] getElements(Object object) {
- // The root is usually an instance of an XMLStructuredModel in
- // which case we want to extract the document.
-
- if (object instanceof ICSSModel) {
- ArrayList v = new ArrayList();
- // internalGetElements(object, v);
- addElements(object, v);
- adaptElements(object);
- return v.toArray();
- }
- return new Object[0];
-
- }
-
- /**
- * Returns the parent for the given element. This method can return
- * <code>null</code> indicating that the parent can't be computed. In
- * this case the tree viewer can't expand a given node correctly if
- * requested.
- */
- public Object getParent(Object object) {
- // IJFaceNodeAdapter adapter = getAdapter(object);
- /*
- * ICSSNodeAdapter adapter = (ICSSNodeAdapter)getAdapter(object); if
- * (adapter != null) return adapter.getParent((ICSSNode) object); else
- * return null;
- */
- if (object instanceof ICSSNode) {
- ICSSNode node = ((ICSSNode) object).getParentNode();
- if (node != null && node.getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- node = node.getParentNode();
- }
- return node;
- }
- return null;
- }
-
- /**
- * Returns <code>true</code> if the given element has children.
- * Otherwise <code>false</code> is returned.
- */
- public boolean hasChildren(Object object) {
- // return getAdapter(object).hasChildren((ICSSNode) object);
- if (object instanceof ICSSNode) {
- if (object instanceof ICSSStyleDeclItem)
- return false;
- else
- return ((ICSSNode) object).hasChildNodes();
- }
- return false;
- }
-
- /**
- * Called when the viewer's input is changing from <code>oldInput</code>
- * to <code>newInput</code>. Both <code>newInput</code> and
- * <code>oldInput</code> can be <code>null</code>. If
- * <code>oldInput</code> is <code>null</code> it is the viewer's first
- * connection to the content provider. If <code>newInput</code> is
- * <code>null</code> the visual part is disconnected from any input. A
- * typical implementation of this methods registers the content provider
- * as a listener to changes on the new input, and deregisters the viewer
- * from the old input. The content provider then updates the viewer in
- * response to change notifications from the input.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- //// If there was no old input, then we must be providing content for
- // this part for the first time...
- //if (oldInput == null) {
- //// If the part is an IDomainListener then make the part start
- // listening to us.
- //if (viewer instanceof IDomainListener)
- //domainNotifier.addDomainListener((IDomainListener) viewer);
- //}
- //// If there is no new input, we must clean ourselves up as if we'd
- // never seen the viewer.
- //else
- //if (newInput == null) {
- //// If the part is an IDomainListener, then we make it stop
- // listening to us.
- //if (viewer instanceof IDomainListener)
- //domainNotifier.removeDomainListener((IDomainListener) viewer);
-
- //}
- }
-
- /**
- */
- /*
- * protected void internalGetElements(Object element, ArrayList v) {
- *
- * ICSSNode node;
- *
- * if (element instanceof ICSSModel) { ICSSModel model =
- * (ICSSModel)element; ICSSDocument doc = model.getDocument();
- * adapterFactory.adapt((INodeNotifier)doc); node = doc.getFirstChild(); }
- * else if (element instanceof ICSSNode) { node =
- * ((ICSSNode)element).getFirstChild(); } else { return; }
- *
- * while (node != null) { switch (node.getNodeType()) { case
- * ICSSNode.STYLEDECLARATION_NODE: adapterFactory.adapt((INodeNotifier)
- * node); break; case ICSSNode.STYLERULE_NODE: case
- * ICSSNode.FONTFACERULE_NODE: case ICSSNode.PAGERULE_NODE: case
- * ICSSNode.IMPORTRULE_NODE: case ICSSNode.MEDIARULE_NODE: v.add(node);
- * adapterFactory.adapt((INodeNotifier) node); break; default:
- * adapterFactory.adapt((INodeNotifier) node); break; }
- *
- * node = node.getNextSibling(); }
- * }
- */
- /**
- * Checks whether the given element is deleted or not.
- */
- public boolean isDeleted(Object element) {
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
deleted file mode 100644
index 5df26448d5..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java
+++ /dev/null
@@ -1,231 +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.ui.views.contentoutline;
-
-
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.document.ICSSMediaRule;
-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.ICSSStyleRule;
-import org.eclipse.wst.css.ui.image.CSSImageHelper;
-import org.eclipse.wst.css.ui.image.CSSImageType;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.contentoutline.IJFaceNodeAdapter;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * A class that uses a JFaceNodeAdapterFactory to provide adapters to provide
- * the labels and images for DOM nodes.
- */
-public class JFaceNodeLabelProviderCSS implements ILabelProvider {
- protected AdapterFactory fAdapterFactory;
-
- /**
- * JFaceNodeLabelProvider constructor comment.
- */
- public JFaceNodeLabelProviderCSS(AdapterFactory adapterFactory) {
- super();
- this.fAdapterFactory = adapterFactory;
- }
-
- /**
- * Adds a listener to the label provider. A label provider should inform
- * its listener about state changes that enforces rendering of the visual
- * part that uses this label provider.
- */
- public void addListener(ILabelProviderListener listener) {
- // The label provider state never changes so we do not have
- // to implement this method.
- }
-
- /**
- * The visual part that is using this label provider is about to be
- * disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- // Nothing to dispose
- }
-
- /**
- * Returns the JFace adapter for the specified object.
- *
- * @return com.ibm.sed.view.tree.DOMJFaceAdapter The JFace adapter
- * @param adaptable
- * java.lang.Object The object to get the adapter for
- */
- //protected IJFaceNodeAdapter getAdapter(Object adaptable) {
- // return (IJFaceNodeAdapter) adapterFactory.adapt((INodeNotifier)
- // adaptable);
- protected IJFaceNodeAdapter getAdapter(Object adaptable) {
- return (IJFaceNodeAdapter) fAdapterFactory.adapt((INodeNotifier) adaptable);
- }
-
- /**
- * Returns the image for the label of the given element, for use in the
- * given viewer.
- *
- * @param viewer
- * The viewer that displays the element.
- * @param element
- * The element for which to provide the label image. Element
- * can be <code>null</code> indicating no input object is set
- * to the viewer.
- */
- public Image getImage(Object element) {
- // return getAdapter(element).getLabelImage((Node) element);
-
-
- if (element instanceof ICSSNode) {
- CSSImageHelper helper = CSSImageHelper.getInstance();
- return helper.getImage(CSSImageType.getImageType((ICSSNode) element));
- // Image image = getCSSNodeImage(element);
- // return image;
- // return getAdapter(element).getLabelImage((ICSSNode) element);
- }
- return null;
- }
-
- /**
- * Insert the method's description here.
- */
- public String getLabelText(Viewer viewer, Object element) {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Returns the text for the label of the given element, for use in the
- * given viewer.
- *
- * @param viewer
- * The viewer that displays the element.
- * @param element
- * The element for which to provide the label text. Element can
- * be <code>null</code> indicating no input object is set to
- * the viewer.
- */
- public String getText(Object element) {
- // This was returning null, on occasion ... probably should not be,
- // but
- // took the quick and easy way out for now. (dmw 3/8/01)
-
- String result = "";//$NON-NLS-1$
- String mediaText;
- if (element instanceof ICSSNode) {
- switch (((ICSSNode) element).getNodeType()) {
- case ICSSNode.STYLERULE_NODE :
- result = ((ICSSStyleRule) element).getSelectors().getString();
- break;
- case ICSSNode.FONTFACERULE_NODE :
- result = "@font-face";//$NON-NLS-1$
- break;
- case ICSSNode.IMPORTRULE_NODE :
- result = ((CSSImportRule) element).getHref();
- mediaText = getMediaText((CSSImportRule) element);
- if (mediaText != null && 0 < mediaText.length()) {
- result += " (" + mediaText + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- case ICSSNode.PAGERULE_NODE :
- result = ((ICSSPageRule) element).getSelectors().getString();
- break;
- case ICSSNode.STYLEDECLARATION_NODE :
- result = "properties";//$NON-NLS-1$
- break;
- case ICSSNode.STYLEDECLITEM_NODE :
- result = ((ICSSStyleDeclItem) element).getPropertyName();
- break;
- case ICSSNode.PRIMITIVEVALUE_NODE :
- result = ((ICSSPrimitiveValue) element).getStringValue();
- break;
- case ICSSNode.MEDIARULE_NODE :
- result = "@media";//$NON-NLS-1$
- mediaText = getMediaText((ICSSMediaRule) element);
- if (mediaText != null && 0 < mediaText.length()) {
- result += " (" + mediaText + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- break;
- case ICSSNode.CHARSETRULE_NODE :
- result = "@charset";//$NON-NLS-1$
- break;
- case ICSSNode.MEDIALIST_NODE :
- result = ((MediaList) element).getMediaText();
- break;
- default :
- break;
- }
- }
-
- // if (element instanceof ICSSNode) {
- // ICSSNode node = ((ICSSNode)element);
- // result = getAdapter(element).getLabelText((ICSSNode) element);
- // }
- return result;
- }
-
- private String getMediaText(CSSRule rule) {
- String result = ""; //$NON-NLS-1$
- ICSSNode child = (rule != null) ? ((ICSSNode) rule).getFirstChild() : null;
- while (child != null) {
- if (child.getNodeType() == ICSSNode.MEDIALIST_NODE) {
- result = ((MediaList) child).getMediaText();
- break;
- }
- child = child.getNextSibling();
- }
- return result;
- }
-
- /**
- * Checks whether this label provider is affected by the given domain
- * event.
- */
- public boolean isAffected(Object dummy) {//DomainEvent event) {
- //return event.isModifier(DomainEvent.NON_STRUCTURE_CHANGE);
- return true;
-
- }
-
- /**
- * Returns whether the label would be affected by a change to the given
- * property of the given element. This can be used to optimize a
- * non-structural viewer update. If the property mentioned in the update
- * does not affect the label, then the viewer need not update the label.
- *
- * @param element
- * the element
- * @param property
- * the property
- * @return <code>true</code> if the label would be affected, and
- * <code>false</code> if it would be unaffected
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * Removes a listener from the label provider.
- */
- public void removeListener(ILabelProviderListener listener) {
- // The label provider state never changes so we do not have
- // to implement this method.
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java
deleted file mode 100644
index 3e6b16faa1..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java
+++ /dev/null
@@ -1,66 +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 Jan 22, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.css.ui.views.contentoutline;
-
-import java.text.Collator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.css.ui.CSSEditorPlugin;
-import org.eclipse.wst.css.ui.internal.editor.CSSEditorPluginImages;
-import org.eclipse.wst.css.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateAction;
-
-/**
- * Based on com.ibm.etools.dtd.editor.DTDContentOutlinePage#SortAction
- */
-class SortAction extends PropertyChangeUpdateAction {
- private TreeViewer treeViewer;
-
- public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
- super(ResourceHandler.getString("SortAction.0"), store, preferenceKey, false); //$NON-NLS-1$
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(CSSEditorPlugin.ID, CSSEditorPluginImages.IMG_OBJ_SORT);
- setImageDescriptor(desc);
- setToolTipText(getText());
- treeViewer = viewer;
- if (isChecked()) {
- treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- super.update();
- treeViewer.getControl().setVisible(false);
- Object[] expandedElements = treeViewer.getExpandedElements();
- if (isChecked()) {
- treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
- } else {
- treeViewer.setSorter(null);
- }
- treeViewer.setInput(treeViewer.getInput());
- treeViewer.setExpandedElements(expandedElements);
- treeViewer.getControl().setVisible(true);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java
deleted file mode 100644
index 5972406b2b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java
+++ /dev/null
@@ -1,53 +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 Jan 23, 2004
- *
- * To change the template for this generated file go to Window - Preferences -
- * Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.css.ui.views.properties;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.sse.ui.views.properties.StructuredPropertySheetConfiguration;
-
-public class CSSPropertySheetConfiguration extends StructuredPropertySheetConfiguration {
- public CSSPropertySheetConfiguration() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.views.properties.StructuredPropertySheetConfiguration#getSelection(org.eclipse.jface.viewers.ISelection,
- * org.eclipse.ui.IWorkbenchPart)
- */
- public ISelection getSelection(IWorkbenchPart selectingPart, ISelection selection) {
- ISelection preferredSelection = super.getSelection(selectingPart, selection);
- if (preferredSelection instanceof IStructuredSelection) {
- Object[] objects = ((IStructuredSelection) preferredSelection).toArray();
- for (int i = 0; i < objects.length; i++) {
- if (objects[i] instanceof ICSSNode) {
- ICSSNode node = (ICSSNode) objects[i];
- while (node.getNodeType() == ICSSNode.PRIMITIVEVALUE_NODE || node.getNodeType() == ICSSNode.STYLEDECLITEM_NODE) {
- node = node.getParentNode();
- objects[i] = node;
-
- }
- }
- }
- preferredSelection = new StructuredSelection(objects);
- }
- return preferredSelection;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySource.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySource.java
deleted file mode 100644
index 41b771c5fc..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySource.java
+++ /dev/null
@@ -1,350 +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.ui.views.properties;
-
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.document.ICSSNodeList;
-import org.eclipse.wst.css.core.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.metamodel.CSSMMCategory;
-import org.eclipse.wst.css.core.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelFinder;
-import org.eclipse.wst.css.core.metamodel.util.CSSMetaModelUtil;
-import org.eclipse.wst.css.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- * A IPropertySource implementation for a JFace viewer used to display
- * propreties of DOM nodes. This takes an adapter factory to create JFace
- * adapters for the nodes in the tree.
- */
-public class CSSPropertySource implements INodeAdapter, IPropertySource {
- protected ICSSNode fNode = null;
- // for performance...
- final static Class ADAPTER_KEY = IPropertySource.class;
-
- /**
- * DOMPropertySource constructor comment.
- */
- public CSSPropertySource(INodeNotifier target) {
- super();
- fNode = (ICSSNode) target;
- }
-
- protected IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName) {
- // the displayName MUST be set
- IPropertyDescriptor descriptor = new CSSTextPropertyDescriptor(attributeName, attributeName, fNode);
- // IPropertyDescriptor descriptor = new
- // TextPropertyDescriptor(attributeName, attributeName);
- return descriptor;
- }
-
- protected IPropertyDescriptor createPropertyDescriptor(CSSMMNode node, String category) {
- return createPropertyDescriptor(node.getName(), category);
- }
-
- protected IPropertyDescriptor createPropertyDescriptor(String name, String category) {
- IPropertyDescriptor descriptor = null;
- if (name != null && 0 < name.length()) {
- name = name.toLowerCase();
- if (category == null) {
- category = ResourceHandler.getString("INFO_Not_Categorized_1"); //$NON-NLS-1$
- }
- descriptor = new CSSTextPropertyDescriptor(name, name, fNode, category);
- // if (category == null) {
- // descriptor = new CSSTextPropertyDescriptor(name, name, fNode);
- // } else {
- // descriptor = new CSSTextPropertyDescriptor(name, name, fNode,
- // category);
- // }
- }
- return descriptor;
- }
-
- /**
- * Returns a value for this object that can be editted in a property
- * sheet.
- *
- * @return a value that can be editted
- */
- public Object getEditableValue() {
- return null;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return a vector containing all descriptors.
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- CSSMetaModel metamodel = CSSMetaModelFinder.getInstance().findMetaModelFor(fNode);
- Iterator iProperties = Collections.EMPTY_LIST.iterator();
- switch (fNode.getNodeType()) {
- case ICSSNode.STYLERULE_NODE :
- case ICSSNode.FONTFACERULE_NODE :
- case ICSSNode.PAGERULE_NODE :
- case ICSSNode.STYLEDECLARATION_NODE :
- CSSMMNode mmParent = new CSSMetaModelUtil(metamodel).getMetaModelNodeFor(fNode);
- if (mmParent != null) {
- iProperties = mmParent.getChildNodes();
- }
- break;
- case ICSSNode.STYLEDECLITEM_NODE :
- CSSMMNode mmNode = new CSSMetaModelUtil(metamodel).getMetaModelNodeFor(fNode);
- if (mmNode != null) {
- iProperties = Collections.singletonList(mmNode).iterator();
- }
- break;
- default :
- break;
- }
-
- // setup categories
- Map categories = new HashMap();
- Iterator iCategories = metamodel.getCategories();
- while (iCategories.hasNext()) {
- CSSMMCategory category = (CSSMMCategory) iCategories.next();
- categories.put(category.getName(), category.getCaption());
- }
-
- // collect property names
- Set declaredProperties = new HashSet();
- if (iProperties.hasNext()) {
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- ICSSNodeList nodeList = ((ICSSNode) declaration).getChildNodes();
- int nProps = (nodeList != null) ? nodeList.getLength() : 0;
- for (int i = 0; i < nProps; i++) {
- ICSSNode node = nodeList.item(i);
- if (node instanceof ICSSStyleDeclItem) {
- String name = ((ICSSStyleDeclItem) node).getPropertyName();
- if (name != null && 0 < name.length()) {
- declaredProperties.add(name.toLowerCase());
- }
- }
- }
- }
- }
-
- List descriptors = new ArrayList();
-
- // first: properties from content model
- while (iProperties.hasNext()) {
- CSSMMNode node = (CSSMMNode) iProperties.next();
- if (node.getType() == CSSMMNode.TYPE_PROPERTY || node.getType() == CSSMMNode.TYPE_DESCRIPTOR) {
- String category = (String) categories.get(node.getAttribute("category")); //$NON-NLS-1$
- String name = node.getName().toLowerCase();
- if (declaredProperties.contains(name)) {
- declaredProperties.remove(name);
- }
- IPropertyDescriptor descriptor = createPropertyDescriptor(name, category);
- if (descriptor != null) {
- descriptors.add(descriptor);
- }
- }
- }
-
- // second: existing properties but not in content model
- Iterator iRemains = declaredProperties.iterator();
- while (iRemains.hasNext()) {
- IPropertyDescriptor descriptor = createPropertyDescriptor((String) iRemains.next(), null);
- if (descriptor != null) {
- descriptors.add(descriptor);
- }
- }
-
- IPropertyDescriptor[] resultArray = new IPropertyDescriptor[descriptors.size()];
- return (IPropertyDescriptor[]) descriptors.toArray(resultArray);
- }
-
- /**
- * Returns the current value for the named property.
- *
- * @param name
- * the name of the property as named by its property descriptor
- * @return the current value of the property
- */
- public Object getPropertyValue(Object name) {
- if (name == null) {
- return ""; //$NON-NLS-1$
- }
-
- String valueString = null;
- String nameString = name.toString();
-
- CSSStyleDeclaration declaration = null;
-
- switch (fNode.getNodeType()) {
- case ICSSNode.STYLEDECLITEM_NODE :
- valueString = ((ICSSStyleDeclItem) fNode).getCSSValueText();
- break;
- case ICSSNode.STYLERULE_NODE :
- case ICSSNode.FONTFACERULE_NODE :
- case ICSSNode.PAGERULE_NODE :
- declaration = (CSSStyleDeclaration) fNode.getFirstChild();
- if (declaration != null) {
- valueString = declaration.getPropertyValue(nameString);
- }
- break;
- case ICSSNode.STYLEDECLARATION_NODE :
- valueString = ((CSSStyleDeclaration) fNode).getPropertyValue(nameString);
- break;
- case ICSSNode.PRIMITIVEVALUE_NODE :
- ICSSNode parent = fNode;
- while (parent != null && !(parent instanceof ICSSStyleDeclItem)) {
- parent = parent.getParentNode();
- }
- if (parent != null) {
- valueString = ((ICSSStyleDeclItem) parent).getCSSValueText();
- }
- break;
- default :
- break;
- }
-
- if (valueString == null) {
- valueString = ""; //$NON-NLS-1$
- }
-
- return valueString;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(java.lang.Object type) {
- return type.equals(ADAPTER_KEY);
- }
-
- /**
- * Returns whether the property value has changed from the default.
- *
- * @return <code>true</code> if the value of the specified property has
- * changed from its original default value; <code>false</code>
- * otherwise.
- */
- public boolean isPropertySet(Object property) {
- if (property == null) {
- return false;
- }
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- String value = declaration.getPropertyValue(property.toString());
- if (value != null && 0 < value.length()) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, java.lang.Object changedFeature, java.lang.Object oldValue, java.lang.Object newValue, int pos) {
- }
-
- /**
- * Resets the specified property's value to its default value.
- *
- * @param property
- * the property to reset
- */
- public void resetPropertyValue(Object str) {
- if (str == null) {
- return;
- }
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- declaration.removeProperty(str.toString());
- }
- }
-
- /**
- * Sets the named property to the given value.
- *
- * @param name
- * the name of the property being set
- * @param value
- * the new value for the property
- */
- public void setPropertyValue(Object name, Object value) {
- if (name == null) {
- return;
- }
- String valueString = (value != null) ? value.toString() : null;
- String nameString = name.toString();
- CSSStyleDeclaration declaration = getDeclarationNode();
- if (declaration != null) {
- try {
- if (valueString == null || valueString.length() <= 0) {
- declaration.removeProperty(nameString);
- } else {
- declaration.setProperty(nameString, valueString, ""); //$NON-NLS-1$
- }
- } catch (Exception e) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- String title = ResourceHandler.getString("Title.InvalidValue"); //$NON-NLS-1$
- String message = ResourceHandler.getString("Message.InvalidValue"); //$NON-NLS-1$
- MessageDialog.openWarning(window.getShell(), title, message);
- }
- }
- }
-
- private CSSStyleDeclaration getDeclarationNode() {
- CSSStyleDeclaration declaration = null;
-
- switch (fNode.getNodeType()) {
- case ICSSNode.STYLEDECLITEM_NODE :
- declaration = (CSSStyleDeclaration) fNode.getParentNode();
- break;
- case ICSSNode.STYLERULE_NODE :
- case ICSSNode.FONTFACERULE_NODE :
- case ICSSNode.PAGERULE_NODE :
- declaration = (CSSStyleDeclaration) fNode.getFirstChild();
- break;
- case ICSSNode.STYLEDECLARATION_NODE :
- declaration = (CSSStyleDeclaration) fNode;
- break;
- case ICSSNode.PRIMITIVEVALUE_NODE :
- ICSSNode parent = fNode;
- while (parent != null && !(parent instanceof CSSStyleDeclaration)) {
- parent = parent.getParentNode();
- }
- if (parent != null) {
- declaration = (CSSStyleDeclaration) parent;
- }
- break;
- default :
- break;
- }
-
- return declaration;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySourceAdapterFactory.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySourceAdapterFactory.java
deleted file mode 100644
index feed515d31..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySourceAdapterFactory.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.ui.views.properties;
-
-import org.eclipse.wst.sse.core.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-
-
-
-//import com.ibm.sed.edit.xml.DOMPropertySource;
-public class CSSPropertySourceAdapterFactory extends AbstractAdapterFactory {
- /**
- * PropertySourceAdapterFactory constructor comment.
- */
- public CSSPropertySourceAdapterFactory() {
- super();
- }
-
- /**
- * PropertySourceAdapterFactory constructor comment.
- *
- * @param adapterKey
- * java.lang.Object
- * @param registerAdapters
- * boolean
- */
- public CSSPropertySourceAdapterFactory(Object newAdapterKey, boolean newRegisterAdapters) {
- super(newAdapterKey, newRegisterAdapters);
- }
-
- /**
- * createAdapter method comment.
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- // at the moment, only one implementation exists
- return new CSSPropertySource(target);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java
deleted file mode 100644
index 4b6d0f2f1b..0000000000
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.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.wst.css.ui.views.properties;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.css.core.document.ICSSModel;
-import org.eclipse.wst.css.core.document.ICSSNode;
-import org.eclipse.wst.css.core.util.CSSPathService;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.xml.core.document.XMLNode;
-
-/**
- */
-public class CSSTextPropertyDescriptor extends TextPropertyDescriptor {
- private final ICSSNode fNode;
-
- /**
- * CSSTextPropertyDescriptor constructor comment.
- *
- * @param id
- * java.lang.String
- * @param displayName
- * java.lang.String
- */
- public CSSTextPropertyDescriptor(String id, String displayName, ICSSNode node) {
- super(id, displayName);
- this.fNode = node;
- }
-
- public CSSTextPropertyDescriptor(String id, String displayName, ICSSNode node, String category) {
- super(id, displayName);
- this.fNode = node;
- setCategory(category);
- }
-
- /**
- * @return org.eclipse.jface.viewers.CellEditor
- * @param parent
- * org.eclipse.swt.widgets.Composite
- */
- public CellEditor createPropertyEditor(Composite parent) {
- ICSSModel model = fNode.getOwnerDocument().getModel();
- if (model == null)
- return null;
- if (model.getStyleSheetType() == ICSSModel.EXTERNAL && findEditor(model) == null)
- return null;
- // check whether IFile is readonly to prohibit editing before
- // validateEdit()
- IStructuredModel structuredModel = model;
- if (model.getStyleSheetType() != ICSSModel.EXTERNAL) {
- structuredModel = ((XMLNode) model.getOwnerDOMNode()).getModel();
- if (structuredModel == null)
- return null;
- }
- IFile file = CSSPathService.location2File(structuredModel.getBaseLocation());
- if (file == null || file.isReadOnly())
- return null;
-
- return super.createPropertyEditor(parent);
- }
-
- private static IEditorPart findEditor(ICSSModel model) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- IWorkbenchPage[] pages = windows[i].getPages();
- for (int j = 0; j < pages.length; j++) {
- IEditorReference[] editors = pages[j].getEditorReferences();
- for (int k = 0; k < editors.length; k++) {
- IEditorPart editPart = editors[k].getEditor(false);
- if (editPart != null) {
- IEditorInput editorInput = editPart.getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) editorInput).getFile();
- if (file != null) {
- //TODO Urgent needs to be fixed
- // I think we need 'equals' (or 'equivalent'
- // on model) for cases like this
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- if (plugin.getModelManager().calculateId(file).equals(model.getId())) {
- return editPart;
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/.classpath b/bundles/org.eclipse.wst.dtd.core/.classpath
deleted file mode 100644
index df094ee4a7..0000000000
--- a/bundles/org.eclipse.wst.dtd.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.dtd.core/.compatibility b/bundles/org.eclipse.wst.dtd.core/.compatibility
deleted file mode 100644
index d77886bda2..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.compatibility
+++ /dev/null
@@ -1,2 +0,0 @@
-#Wed Mar 24 13:53:52 EST 2004
-.project=54098
diff --git a/bundles/org.eclipse.wst.dtd.core/.cvsignore b/bundles/org.eclipse.wst.dtd.core/.cvsignore
deleted file mode 100644
index db54fd1fa9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-dtdmodel.jar
-build.xml
-temp.folder
-org.eclipse.wst.dtd.core_1.0.0.jar
diff --git a/bundles/org.eclipse.wst.dtd.core/.project b/bundles/org.eclipse.wst.dtd.core/.project
deleted file mode 100644
index 76249e5f71..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.dtd.core</name>
- <comment></comment>
- <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.dtd.core/README.txt b/bundles/org.eclipse.wst.dtd.core/README.txt
deleted file mode 100644
index 5b71e3e17d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-This plugin extends the core model to implement a dtd specific model. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.core/build.properties b/bundles/org.eclipse.wst.dtd.core/build.properties
deleted file mode 100644
index 8267abc555..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/build.properties
+++ /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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- dtd.jar,\
- plugin.properties,\
- icons/
-src.includes = plugin.xml,\
- plugin.properties,\
- build.xml,\
- icons/
-source.dtdmodel.jar = src/
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif
deleted file mode 100644
index 64ee536107..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif
deleted file mode 100644
index 7017d91b91..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif
deleted file mode 100644
index 795eb5e9f4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif
deleted file mode 100644
index 28c2ccb1e7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif
deleted file mode 100644
index 749acfc9c9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif
deleted file mode 100644
index bc8e66c20f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif
deleted file mode 100644
index 6a91888855..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif
deleted file mode 100644
index d30b26b97a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif
deleted file mode 100644
index 801c13388d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif
deleted file mode 100644
index 2fb2ca7a92..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif
deleted file mode 100644
index 59096688cc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif
deleted file mode 100644
index 6fd82e60e1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif
deleted file mode 100644
index f849c75d58..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif
deleted file mode 100644
index c9f09459e6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif
deleted file mode 100644
index 5f54702ffc..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/newdtd_wiz.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/newdtd_wiz.gif
deleted file mode 100644
index 2c115ff961..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/newdtd_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif
deleted file mode 100644
index ce9df985b8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif
deleted file mode 100644
index 694c26f273..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif
deleted file mode 100644
index d13ba2e5b0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif
deleted file mode 100644
index 8b2b357f48..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif
deleted file mode 100644
index 96398c0ce1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif
deleted file mode 100644
index 041db277d1..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif
deleted file mode 100644
index 5f9658e5b3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif
deleted file mode 100644
index e7422d7738..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif
deleted file mode 100644
index fb4f9bd29e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif
deleted file mode 100644
index f8d5289f11..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif
deleted file mode 100644
index 358997d294..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif
deleted file mode 100644
index daf514dccd..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif
deleted file mode 100644
index a1ac131e67..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif b/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif
deleted file mode 100644
index 8ed4cb7374..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.properties b/bundles/org.eclipse.wst.dtd.core/plugin.properties
deleted file mode 100644
index 35a5f4d399..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/plugin.properties
+++ /dev/null
@@ -1,124 +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
-#
-###############################################################################
-Structured_Source_DTD_Model.name=Structured Source DTD Model
-Structured_Source_DTD_Model_NL_Support.name=Structured Source DTD Model NL Support
-! Properties file for component: XML tools SSE DTD Model
-! Packaged for translation in: xml.zip
-
-!plugin.xml
-_UI_PLUGIN_NAME=SSE DTD Model
-
-! Strings for DTDBasicTypeImpl type descriptions
-_UI_NONE_DESC=None
-
-!! NOTE TO TRANSLATOR: Do not translate following text in parentheses on following 10 lines i.e.(CDATA)
-_UI_CHARACTER_DATA_DESC=Character Data (CDATA)
-_UI_IDENTIFIER_DESC=Identifier (ID)
-_UI_ID_REFERENCE_DESC=ID Reference (IDREF)
-_UI_ID_REFERENCES_DESC=ID References (IDREFS)
-_UI_ENTITY_NAME_DESC=Entity Name (ENTITY)
-_UI_ENTITY_NAMES_DESC=Entity Names (ENTITIES)
-_UI_NAME_TOKEN_DESC=Name Token (NMTOKEN)
-_UI_NAME_TOKENS_DESC=Name Tokens (NMTOKENS)
-_UI_ENUM_NAME_TOKENS_DESC=Enumerated Name Tokens
-_UI_ENUM_NOTATION_DESC=Enumerated NOTATION
-
-!dtd/util/CreateListItems.java
-_UI_LABEL_NONE=(none)
-
-! Strings from sed/model
-
-! Attribute.java
-_UI_LABEL_ATTR_DEFAULT_VAL=Attribute Default Change Value
-_UI_LABEL_ATTR_DEFAULT_KIND=Change Attribute Default Value
-_UI_LABEL_ATTR_TYPE=Change Attribute Type
-
-! AttributeEnumList
-_UI_LABEL_ATTR_ENUM_ITEMS=Change Attribute Enumeration Value
-
-! AttributeList
-_UI_LABEL_ATTR_LIST_ADD=Add Attribute
-
-! CMGroupNode
-_UI_LABEL_CM_GRP_NODE_CONNECTOR=Change Connector
-_UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT=Insert Element
-_UI_LABEL_CM_GRP_NODE_ADD_GRP=Add Group
-_UI_LABEL_CM_GRP_NODE_ADD_CHILD=Add Child Element
-
-! CMNode
-_UI_LABEL_CM_NODE_MIX_CONTENT=Mixed Content
-_UI_LABEL_CM_NODE_CHILD_CONTENT=Children Content
-_UI_LABEL_CM_NODE_SET_MIX_CONTENT=Set Mixed Content
-_UI_LABEL_CM_NODE_SET_CHILD_CONTENT=Set Children Content
-
-!! NOTE TO TRANSLATOR - USAGE: "Set <variable content> Content"
-_UI_LABEL_CM_NODE_SET=Set
-_UI_LABEL_CM_NODE_CONTENT=Content
-
-!! NOTE TO TRANSLATOR - DO NOT TRANSLATE FOLLOWING 3 LINES
-_UI_LABEL_CM_NODE_PCDATA=(#PCDATA)
-_UI_LABEL_CM_NODE_ANY=ANY
-_UI_LABEL_CM_NODE_EMPTY=EMPTY
-
-! CMRepeatableNode
-_UI_LABEL_CM_REP_NODE_CHG_OCCUR=Change Occurrence
-
-! Comment
-_UI_LABEL_COMMENT_CHG=Comment Change
-
-! DTDFile
-_UI_LABEL_DTD_FILE_ADD_ELEMENT=Add Element
-_UI_LABEL_DTD_FILE_ADD_ENTITY=Add Entity
-_UI_LABEL_DTD_FILE_ADD_COMMENT=Add Comment
-_UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF=Add Parameter Entity Reference
-_UI_LABEL_DTD_FILE_ADD_NOTATION=Add Notation
-_UI_LABEL_DTD_FILE_ADD_ATTR_LIST=Add Attribute List
-_UI_LABEL_DTD_FILE_DELETE=Delete
-
-! DTDNode
-_UI_LABEL_DTD_NODE_NAME_CHG=Name Change
-_UI_LABEL_DTD_NODE_DELETE=Delete
-
-! Element
-_UI_LABEL_ELEMENT_ADD_ATTR=Add Attribute
-_UI_LABEL_ELEMENT_ADD_GRP=Add Group
-_UI_LABEL_ELEMENT_ADD_CHILD=Add Child Element
-
-! Entity
-_UI_LABEL_ENTITY_SET_PARM_ENTITY=Set Parameter Entity
-_UI_LABEL_ENTITY_SET_GENERAL_ENTITY=Set General Entity
-_UI_LABEL_ENTITY_SET_EXT_ENTITY=Set External Entity
-_UI_LABEL_ENTITY_SET_INT_ENTITY=Set Internal Entity
-_UI_LABEL_ENTITY_VALUE_CHG=Entity Value Change
-
-!! NOTE TO TRANSLATOR - USAGE: "NDATA Change"
-_UI_LABEL_ENTITY_NDATA_CHANGE=Change
-
-! ExternalNode
-_UI_LABEL_EXT_NODE_PUBLIC_ID_CHG=Public ID Change
-_UI_LABEL_EXT_NODE_SYSTEM_ID_CHG=System ID Change
-
-! NodeList
-_UI_LABEL_NODE_LIST_ELEMENTS=Elements
-_UI_LABEL_NODE_LIST_ENTITIES=Entities
-_UI_LABEL_NODE_LIST_NOTATIONS=Notations
-_UI_LABEL_NODE_LIST_COMMENTS=Comments
-_UI_LABEL_NODE_LIST_OTHER=Other
-_UI_LABEL_NODE_LIST_ATTRIBUTES=Attributes
-
-! ParameterEntityReference
-_UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF=Change Entity Reference
-_UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG=Comment Change
-
-! TopLevelNode
-_UI_LABEL_TOP_LEVEL_NODE_DELETE=Delete
diff --git a/bundles/org.eclipse.wst.dtd.core/plugin.xml b/bundles/org.eclipse.wst.dtd.core/plugin.xml
deleted file mode 100644
index f8c2e227da..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/plugin.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.dtd.core"
- name="%Structured_Source_DTD_Model.name"
- version="1.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.wst.dtd.core.DTDPlugin">
-
- <runtime>
- <library name="dtdmodel.jar">
- <export name="*" />
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility" />
- <import plugin="org.eclipse.ui.ide" />
- <import plugin="org.eclipse.ui.views" />
- <import plugin="org.eclipse.jface.text" />
- <import plugin="org.eclipse.ui.workbench.texteditor" />
- <import plugin="org.eclipse.ui.editors" />
- <import plugin="org.eclipse.wst.common.encoding" />
- <import plugin="org.eclipse.wst.sse.core" />
- <import plugin="org.eclipse.wst.xml.core" />
- <import plugin="org.eclipse.core.resources" />
- <import plugin="org.eclipse.core.runtime" />
- <import plugin="org.eclipse.ui" />
- </requires>
-
-
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- class="org.eclipse.wst.dtd.core.modelhandler.ModelHandlerForDTD"
- associatedContentTypeId="org.eclipse.wst.dtd.core.dtdsource"
- id="org.eclipse.wst.dtd.core.modelhandler">
- </modelHandler>
- </extension>
- <extension
- point="org.eclipse.wst.sse.core.builderdelegate"
- id="org.eclipse.wst.dtd.core.builderdelegate.todo">
- <participant
- class="org.eclipse.wst.dtd.core.builder.delegates.DTDTaskTagSeeker"
- contentType="org.eclipse.wst.dtd.core.dtdsource"
- />
- </extension>
-
- <extension point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.dtd.core.documentfactories"
- name="Structured DTD Document Factory">
- <factory
- contentTypeId="org.eclipse.wst.dtd.core.dtdsource"
- class="org.eclipse.wst.sse.core.filebuffers.BasicStructuredDocumentFactory:org.eclipse.wst.dtd.core.dtdsource"/>
- </extension>
-
- <extension point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="dtd" />
- <fileTypes
- type="text"
- extension="mod" />
- <fileTypes
- type="text"
- extension="ent" />
- </extension>
-
- <extension
- point="org.eclipse.core.runtime.contentTypes">
- <content-type
- file-extensions="dtd,mod,ent"
- priority="normal"
- name="DTD Content Type"
- id="dtdsource"
- base-type="org.eclipse.core.runtime.text"
- default-charset="UTF-8">
- <describer class="org.eclipse.wst.dtd.core.content.ContentDescriberForDTD"/>
- </content-type>
- </extension>
-
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java
deleted file mode 100644
index 7107139dc9..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java
+++ /dev/null
@@ -1,369 +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.dtd.core;
-
-import java.util.Hashtable;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-// base class for an Element's contentmodel
-public class Attribute extends DTDNode {
-
- public static final String CDATA = DTDPlugin.getDTDString("_UI_CHARACTER_DATA_DESC"); //$NON-NLS-1$
- public static final String ENTITIES = DTDPlugin.getDTDString("_UI_ENTITY_NAMES_DESC"); //$NON-NLS-1$
- public static final String ENTITY = DTDPlugin.getDTDString("_UI_ENTITY_NAME_DESC"); //$NON-NLS-1$
- public static final String ENUMERATED_NAME = DTDPlugin.getDTDString("_UI_ENUM_NAME_TOKENS_DESC"); //$NON-NLS-1$
- public static final String ENUMERATED_NOTATION = DTDPlugin.getDTDString("_UI_ENUM_NOTATION_DESC"); //$NON-NLS-1$
- public static final String FIXED = "#FIXED"; //$NON-NLS-1$
- public static final String ID = DTDPlugin.getDTDString("_UI_IDENTIFIER_DESC"); //$NON-NLS-1$
- public static final String IDREF = DTDPlugin.getDTDString("_UI_ID_REFERENCE_DESC"); //$NON-NLS-1$
- public static final String IDREFS = DTDPlugin.getDTDString("_UI_ID_REFERENCES_DESC"); //$NON-NLS-1$
-
- public static final String IMPLIED = "#IMPLIED"; //$NON-NLS-1$
- public static final String NMTOKEN = DTDPlugin.getDTDString("_UI_NAME_TOKEN_DESC"); //$NON-NLS-1$
- public static final String NMTOKENS = DTDPlugin.getDTDString("_UI_NAME_TOKENS_DESC"); //$NON-NLS-1$
- public static final String REQUIRED = "#REQUIRED"; //$NON-NLS-1$
-
- protected static Hashtable typeHash = new Hashtable();
-
- public static final String[] types = {CDATA, ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS, ENUMERATED_NAME, ENUMERATED_NOTATION};
-
- {
- typeHash.put(DTDRegionTypes.CDATA_KEYWORD, CDATA);
- typeHash.put(DTDRegionTypes.ID_KEYWORD, ID);
- typeHash.put(DTDRegionTypes.IDREF_KEYWORD, IDREF);
- typeHash.put(DTDRegionTypes.IDREFS_KEYWORD, IDREFS);
- typeHash.put(DTDRegionTypes.ENTITY_KEYWORD, ENTITY);
- typeHash.put(DTDRegionTypes.ENTITIES_KEYWORD, ENTITIES);
- typeHash.put(DTDRegionTypes.NMTOKEN_KEYWORD, NMTOKEN);
- typeHash.put(DTDRegionTypes.NMTOKENS_KEYWORD, NMTOKENS);
- typeHash.put(DTDRegionTypes.NOTATION_KEYWORD, ENUMERATED_NOTATION);
- // this one's a special case since there is no keyword for
- // enumerated name tokens
- typeHash.put("()", ENUMERATED_NAME); //$NON-NLS-1$
-
- // now put the reverse in place. This gives us a 2 way lookup
- // for when we want to retrieve the value and when we want to set it
- typeHash.put(CDATA, "CDATA"); //$NON-NLS-1$
- typeHash.put(ID, "ID"); //$NON-NLS-1$
- typeHash.put(IDREF, "IDREF"); //$NON-NLS-1$
- typeHash.put(IDREFS, "IDREFS"); //$NON-NLS-1$
- typeHash.put(ENTITY, "ENTITY"); //$NON-NLS-1$
- typeHash.put(ENTITIES, "ENTITIES"); //$NON-NLS-1$
- typeHash.put(NMTOKEN, "NMTOKEN"); //$NON-NLS-1$
- typeHash.put(NMTOKENS, "NMTOKENS"); //$NON-NLS-1$
- typeHash.put(ENUMERATED_NAME, ""); //$NON-NLS-1$
- typeHash.put(ENUMERATED_NOTATION, "NOTATION"); //$NON-NLS-1$
- }
-
- private AttributeEnumList enumList = null;
-
- // public static final String IMPLIED = "IMPLIED";
-
- public Attribute(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public String getDefaultKind() {
- ITextRegion defaultKindRegion = getDefaultKindRegion();
- if (defaultKindRegion != null) {
- return getStructuredDTDDocumentRegion().getText(defaultKindRegion);
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getDefaultKindRegion() {
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.IMPLIED_KEYWORD || region.getType() == DTDRegionTypes.REQUIRED_KEYWORD || region.getType() == DTDRegionTypes.FIXED_KEYWORD) {
- return region;
- }
- }
- return null;
- }
-
- public String getDefaultValue() {
- ITextRegion defaultValue = getNextQuotedLiteral(iterator());
- if (defaultValue != null) {
- return getValueFromQuotedRegion(defaultValue);
- }
- return ""; //$NON-NLS-1$
- }
-
- public AttributeEnumList getEnumList() {
- return enumList;
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.ATTRIBUTEICON);
- }
-
- public ITextRegion getNameRegion() {
- return getNextRegion(iterator(), DTDRegionTypes.ATTRIBUTE_NAME);
- }
-
- public ITextRegion getNextQuotedLiteral(RegionIterator iter) {
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || region.getType().equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- return region;
- }
- }
- return null;
- }
-
- protected int getOffsetAfterType() {
- ITextRegion typeRegion = getTypeRegion();
-
- String type = getType();
- boolean isEnumeration = type.equals(ENUMERATED_NAME) || type.equals(ENUMERATED_NOTATION);
- if (isEnumeration) {
- // now check if maybe this is an enumeration
- if (getEnumList() != null) {
- return getEnumList().getEndOffset();
- }
- }
- if (typeRegion != null) {
- return getStructuredDTDDocumentRegion().getEndOffset(typeRegion);
- } else {
- ITextRegion nameRegion = getNameRegion();
- return getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
- // // create one
- // typeRegion =
- // findOrCreateTypeRegion((String)typeHash.get(CDATA));
- }
- }
-
- public String getType() {
- ITextRegion region = getTypeRegion();
- if (region != null) {
- String type = (String) typeHash.get(region.getType());
- if (type == null) {
- // just return the text of the type region since this may be
- // an entity representing the type;
- return getStructuredDTDDocumentRegion().getText(region);
- }
- return type;
- } else if (getEnumList() != null) {
- // enumerated name tokens don't have a type keyword. just
- // the existence of the left paren is enough
- return (String) typeHash.get("()"); //$NON-NLS-1$
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getTypeRegion() {
- RegionIterator iter = iterator();
-
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.CDATA_KEYWORD || region.getType() == DTDRegionTypes.ID_KEYWORD || region.getType() == DTDRegionTypes.IDREF_KEYWORD || region.getType() == DTDRegionTypes.IDREFS_KEYWORD || region.getType() == DTDRegionTypes.ENTITY_KEYWORD || region.getType() == DTDRegionTypes.ENTITIES_KEYWORD || region.getType() == DTDRegionTypes.NMTOKEN_KEYWORD || region.getType() == DTDRegionTypes.NMTOKENS_KEYWORD || region.getType() == DTDRegionTypes.NOTATION_KEYWORD || region.getType() == DTDRegionTypes.PARM_ENTITY_TYPE) {
- return region;
- }
- }
- return null;
- }
-
- public String getValueFromQuotedRegion(ITextRegion region) {
- String type = region.getType();
- if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- String text = getStructuredDTDDocumentRegion().getText(region);
- return text.substring(1, text.length() - 1);
- }
- return ""; //$NON-NLS-1$
- }
-
- public void resolveRegions() {
- removeChildNodes();
- RegionIterator iter = iterator();
-
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- enumList = new AttributeEnumList(getDTDFile(), getStructuredDTDDocumentRegion());
- }
- if (enumList != null) {
- enumList.addRegion(currentRegion);
- if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
- return;
- }
- }
- }
-
- }
-
- public void setDefaultKind(Object requestor, String kind) {
-
- ITextRegion defaultKindRegion = getDefaultKindRegion();
- String oldDefaultKind = defaultKindRegion == null ? "" : getStructuredDTDDocumentRegion().getText(defaultKindRegion); //$NON-NLS-1$
- if (!kind.equals(oldDefaultKind)) {
- String newText = kind;
- int startOffset = 0;
- int length = 0;
- if (defaultKindRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
- length = getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) - startOffset;
- } else {
- startOffset = getOffsetAfterType();
- newText = " " + newText; //$NON-NLS-1$
- }
-
- ITextRegion defaultValue = getNextQuotedLiteral(iterator());
-
- if (kind.equals(Attribute.FIXED) || kind.equals("")) { //$NON-NLS-1$
- if (defaultValue == null) {
- // we are changing to fixed and wehave no quoted region.
- // put in an empty value
- newText += " \"\""; //$NON-NLS-1$
- }
- } else {
- if (defaultValue != null) {
- length = getStructuredDTDDocumentRegion().getEndOffset(defaultValue) - startOffset;
- }
- }
- replaceText(requestor, startOffset, length, newText);
- // do something if there is no "kind" region
- }
- }
-
- public void setDefaultKind(String kind) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ATTR_DEFAULT_KIND")); //$NON-NLS-1$
- setDefaultKind(this, kind);
- endRecording(this);
- }
-
- public void setDefaultValue(Object requestor, String value, boolean fixed) {
- ITextRegion defaultValue = getNextQuotedLiteral(iterator());
- String quoteChar = value.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- int startOffset = 0;
- int endOffset = 0;
- String newText = ""; //$NON-NLS-1$
-
- String oldValue = getDefaultValue();
- boolean oldKindIsFixed = getDefaultKind().equals(Attribute.FIXED);
- if (oldValue.equals(value) && fixed == oldKindIsFixed) {
- // nothing to do
- return;
- }
-
- if (defaultValue != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultValue);
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(defaultValue);
- }
-
- ITextRegion defaultKindRegion = getDefaultKindRegion();
- if (defaultKindRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
- endOffset = endOffset == 0 ? getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) : endOffset;
- } else {
- if (startOffset == 0) {
- endOffset = startOffset = getOffsetAfterType();
- newText += " "; //$NON-NLS-1$
- }
- ITextRegion typeRegion = getTypeRegion();
- if (typeRegion == null && getEnumList() == null) {
- // tack on a default type
- // newText += "CDATA ";
- }
- }
- if (fixed) {
- newText += "#FIXED "; //$NON-NLS-1$
- } else {
- if (getDefaultKind().equals("") && value.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
- // if not fixed and value is "" then reset the default kind to
- // implied
- newText += "#IMPLIED"; //$NON-NLS-1$
- }
- }
-
- if (!getType().equals("") && !value.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
- newText += quoteChar + value + quoteChar;
- }
- replaceText(requestor, startOffset, endOffset - startOffset, newText);
- }
-
- public void setDefaultValue(String value, boolean fixed) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ATTR_DEFAULT_VAL")); //$NON-NLS-1$
- setDefaultValue(this, value, fixed);
- endRecording(this);
- }
-
- public void setType(Object requestor, String type) {
- String oldType = getType();
- if (!type.equals(oldType)) {
- boolean wasEnumeration = oldType.equals(ENUMERATED_NAME) || oldType.equals(ENUMERATED_NOTATION);
- boolean isEnumeration = type.equals(ENUMERATED_NAME) || type.equals(ENUMERATED_NOTATION);
- String newText = ""; //$NON-NLS-1$
- int startOffset = 0;
- int endOffset = 0;
-
- if (wasEnumeration && !isEnumeration) {
- // get rid of the old enumlist
- AttributeEnumList enumList = getEnumList();
- if (enumList != null) {
- startOffset = enumList.getStartOffset();
- endOffset = enumList.getEndOffset();
- }
- }
-
- ITextRegion region = getTypeRegion();
- if (region != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
- if (endOffset == 0) {
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
- }
- } else if (startOffset == 0) {
- ITextRegion nameRegion = getNameRegion();
- newText += " "; //$NON-NLS-1$
- endOffset = startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
- }
-
- String newTypeWord = (String) typeHash.get(type);
- if (newTypeWord == null) {
- // then this must be a parm entity being used in the type
- // use the type text directly
- newTypeWord = type;
- }
-
- newText += newTypeWord;
-
- if (isEnumeration && !wasEnumeration) {
- // put in a new numlist
- boolean isSpaceNeeded = !type.equals(ENUMERATED_NAME);
- newText += isSpaceNeeded ? " " : ""; //$NON-NLS-1$ //$NON-NLS-2$
- newText += "()"; //$NON-NLS-1$
- }
- replaceText(requestor, startOffset, endOffset - startOffset, newText);
- if (newTypeWord.equals("") && !type.equals(ENUMERATED_NAME)) { //$NON-NLS-1$
- // the set the defaultkind to ""
- // setDefaultKind(requestor, "");
- setDefaultValue(requestor, "", false); //$NON-NLS-1$
- }
-
- }
- }
-
- public void setType(String type) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ATTR_TYPE")); //$NON-NLS-1$
- setType(this, type);
- endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java
deleted file mode 100644
index 4df1d7c78b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java
+++ /dev/null
@@ -1,71 +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.dtd.core;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class AttributeEnumList extends DTDNode {
-
- private ArrayList list = new ArrayList();
-
- public AttributeEnumList(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public Image getImage() {
- // never exposed in tree
- return null;
- }
-
- // return the items that are in this enumerated list
- public List getItems() {
- list.clear();
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion name = getNextRegion(iter, DTDRegionTypes.NAME);
- if (name != null) {
- list.add(getStructuredDTDDocumentRegion().getText(name));
- }
- }
- return list;
- }
-
- public void setItems(Object requestor, String[] items) {
- if (items != null) {
- String text = "("; //$NON-NLS-1$
- for (int i = 0; i < items.length; i++) {
- if (i > 0) {
- text += " | " + items[i]; //$NON-NLS-1$
- } else {
- text += items[i];
- }
- }
- text += ")"; //$NON-NLS-1$
- replaceText(requestor, getStartOffset(), getNodeLength(), text);
- }
- }
-
- public void setItems(String[] items) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ATTR_ENUM_ITEMS")); //$NON-NLS-1$
- setItems(this, items);
- endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java
deleted file mode 100644
index f798382952..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java
+++ /dev/null
@@ -1,115 +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.dtd.core;
-
-import java.util.ArrayList;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class AttributeList extends NamedTopLevelNode {
- public AttributeList(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.ATTLIST_TAG);
- }
-
- public void addAttribute(String name) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ATTR_LIST_ADD")); //$NON-NLS-1$
-
- DTDNode lastAttribute = (DTDNode) getLastChild();
- if (lastAttribute != null) {
- replaceText(this, lastAttribute.getEndOffset(), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- replaceText(this, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- }
-
- endRecording(this);
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.ATTRIBUTELISTICON);
- }
-
- public void insertIntoModel(Object requestor, Attribute reference, Attribute node, boolean isAfter) {
- int offset = 0;
- String newText = ""; //$NON-NLS-1$
- String nodeText = node.getFullNodeText();
- boolean isLastChild = false;
- if (!isAfter) {
- offset = reference.getStartOffset();
- } else {
- // try and get next child
- Attribute attr = (Attribute) reference.getNextSibling();
- if (attr != null) {
- offset = attr.getStartOffset();
- } else {
- // just use the end offset
- offset = reference.getWhitespaceEndOffset();
- }
- }
- newText += nodeText;// + (isLastChild ? "\n" : "\n\t");
- if (!node.hasTrailingWhitespace()) {
- newText += "\n\t"; //$NON-NLS-1$
- }
- replaceText(requestor, offset, 0, newText);
- }
-
- public void resolveRegions() {
- removeChildNodes();
- RegionIterator iter = iterator();
-
- if (getNameRegion() != null) {
- // we skip past the name token is our name
- skipPastName(iter);
- }
-
- ArrayList children = new ArrayList();
- Attribute attribute = null;
- boolean trailingWhitespace = false;
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType().equals(DTDRegionTypes.ATTRIBUTE_NAME)) {
- attribute = new Attribute(getDTDFile(), getStructuredDTDDocumentRegion());
- children.add(attribute);
- appendChild(attribute);
- trailingWhitespace = false;
- }
- if (attribute != null && currentRegion.getType() != DTDRegionTypes.END_TAG) {
- if (!trailingWhitespace) {
- attribute.addRegion(currentRegion);
- } else {
- if (currentRegion.getType() == DTDRegionTypes.WHITESPACE) {
- attribute.addWhitespaceRegion(currentRegion);
- }
- }
-
- // the following prevents extra whitespace from being picked
- // up by the attribute
- if (currentRegion.getType() == DTDRegionTypes.REQUIRED_KEYWORD || currentRegion.getType() == DTDRegionTypes.IMPLIED_KEYWORD || currentRegion.getType() == DTDRegionTypes.SINGLEQUOTED_LITERAL || currentRegion.getType() == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
- trailingWhitespace = true;
- }
- }
- }
- int numKids = children.size();
- for (int i = 0; i < numKids; i++) {
- ((Attribute) children.get(i)).resolveRegions();
- } // end of for ()
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMBasicNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMBasicNode.java
deleted file mode 100644
index 618cb920b3..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMBasicNode.java
+++ /dev/null
@@ -1,162 +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.dtd.core;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-/*
- * CMBasicNode combines all the different content types into one. The idea
- * behind this is to allow arbitrary name changes to not require a tree
- * update.
- */
-public class CMBasicNode extends CMRepeatableNode {
-
- // static final int EMPTY = 0;
- // static final int ANY = 1;
- // static final int PCDATA = 2;
-
- public CMBasicNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public Image getImage() {
- final String name = getName();
- ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
- if (pcdata != null) {
- return DTDPlugin.getInstance().getImage(DTDResource.PCDATAICON);
- }
-
- if (isRootElementContent()) {
- if (name.equals(EMPTY)) {
- return DTDPlugin.getInstance().getImage(DTDResource.EMPTYICON);
- } else if (name.equals(ANY)) {
- return DTDPlugin.getInstance().getImage(DTDResource.ANYICON);
- }
- }
-
- // Otherwise this is just an element reference node. Just return
- // what CMRepeatableNode would give us
- return super.getImage();
- }
-
- public ITextRegion getNameRegion() {
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.NAME || region.getType() == DTDRegionTypes.CONTENT_PCDATA) {
- return region;
- }
- }
- return null;
- }
-
- // returns the occurrencetoken, or the token where the occurrence token
- // should appear after
- public ITextRegion getOccurrenceRegion() {
- RegionIterator iter = iterator();
- skipPastName(iter);
- if (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return region;
- }
- }
- return getNameRegion();
- }
-
- public String getType() {
- ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
- if (pcdata != null) {
- return PCDATA;
- }
-
- if (isRootElementContent()) {
- final String name = getName();
- if (isRootElementContent()) {
- if (name.equals(EMPTY)) {
- return EMPTY;
- } else if (name.equals(ANY)) {
- return ANY;
- } else {
- // otherwise just return it's name as the type
- return name;
- }
-
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- public boolean isEmptyAnyOrPCData() {
- if (isPCData()) {
- return true;
- }
-
-
- final String name = getName();
- if (isRootElementContent()) {
- if (name.equals(EMPTY) || name.equals(ANY)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isPCData() {
- ITextRegion pcdata = getNextRegion(iterator(), DTDRegionTypes.CONTENT_PCDATA);
- if (pcdata != null) {
- return true;
- }
- return false;
- }
-
- // public Node insertRegion(Region token)
- // {
- // if (!tokenStream.containsToken(token) && token.getType() ==
- // Token.OCCUR_TYPE)
- // {
- // // then add it so that our range contains it
- // insertIntoTokenStream(token);
- // }
- // return this;
- // }
-
- public boolean isReference() {
- return !isEmptyAnyOrPCData();
- }
-
- public void setName(Object requestor, String name) {
- // beginRecording(requestor, "Name Change");
-
- super.setName(requestor, name);
- if (!isReference()) {
- // if it is no longer a reference node, remove the occurrence
- // token
- setOccurrence(requestor, CMRepeatableNode.ONCE);
- }
-
- // endRecording(requestor);
- }
-
- /*
- * public static String getName(int type) { switch (type) { case EMPTY:
- * return emptyString; case ANY: return anyString; case PCDATA: return
- * pcdataString; default: break; } // end of switch () return ""; }
- */
-
-}// CMBasicNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java
deleted file mode 100644
index daed03a452..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java
+++ /dev/null
@@ -1,424 +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.dtd.core;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.util.DTDUniqueNameHelper;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class CMGroupNode extends CMRepeatableNode {
-
- public static final char CHOICE = '|';
- public static final char SEQUENCE = ',';
-
- protected char connector = SEQUENCE;
-
- // protected ArrayList children = new ArrayList();
-
- public CMGroupNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public void addChild() {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_GRP_NODE_ADD_CHILD")); //$NON-NLS-1$
- DTDNode lastNode = (DTDNode) getLastChild();
- String elementName = DTDUniqueNameHelper.getUniqueName(getChildrenList(), "ChildNode"); //$NON-NLS-1$
- if (lastNode != null) {
- replaceText(this, lastNode.getEndOffset(), 0, String.valueOf(getConnector()) + elementName); //$NON-NLS-1$
- } else {
- replaceText(this, getStartOffset() + 1, 0, elementName); //$NON-NLS-1$
- }
-
- endRecording(this);
- }
-
- public void addGroup() {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_GRP_NODE_ADD_GRP")); //$NON-NLS-1$
- DTDNode lastNode = (DTDNode) getLastChild();
- if (lastNode != null) {
- replaceText(this, lastNode.getEndOffset(), 0, String.valueOf(getConnector()) + " ()"); //$NON-NLS-1$
- } else {
- replaceText(this, getStartOffset() + 1, 0, "()"); //$NON-NLS-1$
- }
-
- endRecording(this);
- }
-
- public void delete(Object requestor, DTDNode child) {
- Object[] children = getChildren();
-
- if (children.length == 1 && getFirstChild() == child) {
- replaceText(requestor, child.getStartOffset(), child.getNodeLength(), null);
- return;
- }
-
- for (int i = 0; i < children.length - 1; i++) {
- DTDNode childA = (DTDNode) children[i];
- DTDNode childB = (DTDNode) children[i + 1];
-
- boolean childADeleted = childA == child;
- boolean childBDeleted = childB == child;
- if (childADeleted || childBDeleted) {
- // we found the child
- int startOffset = childADeleted ? childA.getStartOffset() : childA.getEndOffset();
- int endOffset = childADeleted ? childB.getStartOffset() : childB.getEndOffset();
- replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- removeChild(child);
- break;
- }
- }
- }
-
- /**
- * Get the value of connector.
- *
- * @return value of connector.
- */
- public char getConnector() {
- Object[] children = getChildren();
- for (int i = 0; i < children.length - 1; i++) {
- DTDNode childA = (DTDNode) children[i];
- DTDNode childB = (DTDNode) children[i + 1];
-
- // create a stream between the two siblings and walk it
- // note that this stream includes the last region of the first
- // sibling and the first region of the next sibling.
- // both these should be ignored
- RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
- // stream.setFirstRegion(childA.getLastRegion());
- // stream.setLastRegion(childB.getFirstRegion());
- // Iterator iter = stream.iterator();
- // skip the first region which is the last region of childA
- //do we need this now ?
- // iter.next();
- ITextRegion currentRegion = null;
- while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
- connector = getStructuredDTDDocumentRegion().getText(currentRegion).charAt(0);
- return connector;
- }
- }
- }
- return connector;
- }
-
- public Image getImage() {
- DTDPlugin resourcePlugin = DTDPlugin.getInstance();
- switch (getConnector()) {
- case SEQUENCE :
- return resourcePlugin.getImage(DTDResource.ONESEQUENCEICON);
- /*
- * switch (getOccurrence()) { case ONCE : return
- * resourcePlugin.getImage(DTDResource.ONESEQUENCEICON); case
- * OPTIONAL : return
- * resourcePlugin.getImage(DTDResource.OPTIONALSEQUENCEICON); case
- * ONE_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ONEORMORESEQUENCEICON);
- * case ZERO_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ZEROORMORESEQUENCEICON); }
- */
- case CHOICE :
- return resourcePlugin.getImage(DTDResource.ONECHOICEICON);
- /*
- * switch (getOccurrence()) { case ONCE : return
- * resourcePlugin.getImage(DTDResource.ONECHOICEICON); case OPTIONAL :
- * return resourcePlugin.getImage(DTDResource.OPTIONALCHOICEICON);
- * case ONE_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ONEORMORECHOICEICON); case
- * ZERO_OR_MORE : return
- * resourcePlugin.getImage(DTDResource.ZEROORMORECHOICEICON); }
- */
- }
- return null;
- }
-
- public String getName() {
- return ""; //$NON-NLS-1$
- }
-
- // returns the occurrenceregion, or the last region where the occurrence
- // region should appear after
- public ITextRegion getOccurrenceRegion() {
- int nesting = 0;
-
- // we skip past the first left paren we see since that is the
- // beginning of our own node
- RegionIterator iter = iterator();
- // we assume the first region is the '('
- iter.next();
- ITextRegion currentRegion = null;
- while (iter.hasNext() && nesting >= 0) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.LEFT_PAREN) {
- nesting++;
- }
- if (currentRegion.getType() == DTDRegionTypes.RIGHT_PAREN) {
- nesting--;
- }
- }
- if (nesting < 0) {
- // This means we have passed over the right paren that marks the
- // end of our grouping.
- // Look for an occurrence region
- while (iter.hasNext()) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return currentRegion;
- }
- }
- }
- // if we're here, this means that there is no occur region. return the
- // last region
- return iter.previous();
- }
-
- public String getType() {
- if (isRootElementContent()) {
- if (getFirstChild() != null) {
- CMNode node = (CMNode) getFirstChild();
- if (node.getType().equals(PCDATA)) {
- return MIXED;
- } else {
- return CHILDREN;
- }
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- public void insertChildNode(Object requestor, String nodeText, int position) {
- Object[] children = getChildren();
-
- int startOffset = 0;
- boolean isLastChild = position == children.length;
- String newText = ""; //$NON-NLS-1$
- if (position < children.length) {
- DTDNode reference = (DTDNode) children[position];
- startOffset = reference.getStartOffset();
- newText = nodeText + " " + String.valueOf(getConnector()) + " "; //$NON-NLS-1$ //$NON-NLS-2$
- } else if (position == children.length) {
- // add to end
- DTDNode reference = (DTDNode) children[position - 1];
- startOffset = reference.getEndOffset();
- newText = " " + String.valueOf(getConnector()) + " " + nodeText; //$NON-NLS-1$ //$NON-NLS-2$
- }
- replaceText(requestor, startOffset, 0, newText);
- }
-
- public void insertChildNode(String nodeText, int position) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_GRP_NODE_INSERT_ELEMENT")); //$NON-NLS-1$
- insertChildNode(this, nodeText, position);
- endRecording(this);
- }
-
- public void insertIntoModel(Object requestor, CMNode reference, CMNode node, boolean isAfter) {
- String nodeText = node.getNodeText();
- List children = getChildrenList();
-
- int index = children.indexOf(reference);
- if (index == -1) {
- // no reference node, add it to the end??
- index = children.size();
- } else {
- // got an index. if we want to add after, increase by 1
- index = isAfter ? index + 1 : index;
- }
- insertChildNode(requestor, nodeText, index);
- }
-
- public void resolveRegions() {
- int nesting = 0;
- // children.clear();
- removeChildNodes();
- // we skip past the first left paren we see since that is the
- // beginning of our own node
- boolean isConnectorSet = false;
- DTDNode currentGroupNode = null;
- CMBasicNode currentReferenceNode = null;
- RegionIterator iter = iterator();
- // we assume the first region is the '('
- iter.next();
- while (iter.hasNext() && nesting >= 0) {
- ITextRegion currentRegion = iter.next();
- if (nesting == 0) {
- if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
- currentGroupNode = currentReferenceNode = null;
- DTDNode pcData = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- pcData.addRegion(currentRegion);
- appendChild(pcData);
- // children.add(pcData);
- } else if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
- // we have hit a new reference node. Make sure we reset
- // the groupnode var so it doesn't collect more regions
- currentGroupNode = null;
- currentReferenceNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- currentReferenceNode.addRegion(currentRegion);
- appendChild(currentReferenceNode);
- // children.add(currentReferenceNode);
- } else if (currentRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- // we could potentially flag an error here if we hit an
- // occurrence type and currentRefNode and currentGroupNode
- // are null
- if (currentReferenceNode != null) {
- // currentReferenceNode.setOccurrence(currentRegion.getText().toCharArray()[0]);
- currentReferenceNode.addRegion(currentRegion);
- currentReferenceNode = null;
- }
- } else if (currentRegion.getType().equals(DTDRegionTypes.CONNECTOR)) {
- // note that if connector is already set and it is
- // different from the current connector region, then we
- // have an error!
- // setConnector(currentRegion.getText().toCharArray()[0]);
- } else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- if (currentGroupNode == null) {
- // we have hit a new group. Make sure we reset the
- // referencenode var so it doesn't collect any more
- // regions
- currentReferenceNode = null;
- currentGroupNode = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
- appendChild(currentGroupNode);
- // children.add(currentGroupNode);
- }
- }
- }
-
- if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- nesting++;
- }
- if (currentRegion.getType().equals(DTDRegionTypes.RIGHT_PAREN)) {
- nesting--;
- if (nesting == 0 && currentGroupNode != null) {
- currentGroupNode.addRegion(currentRegion);
- // peek at next region to see if it is an occur region. if
- // so, add it to the groupnode
- if (iter.hasNext()) {
- ITextRegion nextRegion = iter.next();
- if (nextRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- currentGroupNode.addRegion(nextRegion);
- } else {
- // Otherwise, push it back as the next item to be
- // retrieved by a future next() call
- iter.previous();
- }
- }
- currentGroupNode = null;
- }
- }
- if (currentGroupNode != null) {
- currentGroupNode.addRegion(currentRegion);
- }
- }
-
- if (nesting < 0) {
- // This means we have passed over the right paren that marks the
- // end of our grouping.
- // Look for an occurrence region
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- // setOccurrence(currentRegion.getText().toCharArray()[0]);
- }
- } // end of while ()
- }
-
- // for (org.w3c.dom.Node child = getFirstChild(); child != null; child
- // = child.getNextSibling())
- // {
- // System.out.println("child found = " + child);
- // }
-
- Object[] children = getChildren();
- // System.out.println("children legnth = " + children.length);
-
- for (int i = 0; i < children.length; i++) {
- DTDNode currentNode = (DTDNode) children[i];
- currentNode.resolveRegions();
- } // end of while ()
-
- }
-
- /**
- * Set the value of connector.
- *
- * @param v
- * Value to assign to connector.
- */
- public void setConnector(char v) {
- if (connector != v) {
- connector = v;
- // walk through our kids and see if there is a connector between
- // each sibling. if not, create one and set the connector. if
- // there is
- // then just change the text of the connector
- Object[] children = getChildren();
- if (children.length <= 1) {
- // there won't be any connector existing between the children
- // just notify a change in the node and return;
- getDTDFile().notifyNodeChanged(this);
- return;
- }
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_GRP_NODE_CONNECTOR")); //$NON-NLS-1$
- for (int i = 0; i < children.length - 1; i++) {
- DTDNode childA = (DTDNode) children[i];
- DTDNode childB = (DTDNode) children[i + 1];
-
- // create a stream between the two siblings and walk it
- // note that this stream includes the last region of the first
- // sibling and the first region of the next sibling.
- // both these should be ignored
- RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
- // skip the first region which is the last region of childA
-
- // do we still need this
- // iter.next();
- ITextRegion currentRegion = null;
- boolean foundConnector = false;
- while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
- currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
- foundConnector = true;
- // Region oldRegion = currentRegion.createCopy();
- // found a connector! on to the next sibling pair
- // currentRegion.updateText(String.valueOf(v));
- replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(currentRegion), 1, String.valueOf(connector));
- //changeStructuredDocument(oldRegion, currentRegion);
- break;
- }
- }
-
- if (!foundConnector) {
- //if we're here, that means we need to insert a new
- // connector region after childA
- replaceText(this, childA.getEndOffset(), 0, String.valueOf(connector));
- // DTDRegion connectorRegion = new
- // DTDRegion(DTDRegionTypes.CONNECTOR,
- // childA.getEndOffset(), 1);
- // insertIntoStructuredDocument(connectorRegion);
- }
- }
- endRecording(this);
- }
- }
-
- // public Object[] getChildren()
- // {
- // return children.toArray();
- // }
-}// CMGroupNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMNode.java
deleted file mode 100644
index 168cefd2d8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMNode.java
+++ /dev/null
@@ -1,133 +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.dtd.core;
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-// base class for an Element's contentmodel
-public abstract class CMNode extends DTDNode {
- public static final String ANY = DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_ANY"); //$NON-NLS-1$
- public static final String CHILDREN = DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_CHILD_CONTENT"); //$NON-NLS-1$
-
- public static final String EMPTY = DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_EMPTY"); //$NON-NLS-1$
- public static final String MIXED = DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_MIX_CONTENT"); //$NON-NLS-1$
- public static final String PCDATA = DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_PCDATA"); //$NON-NLS-1$
-
-
- boolean rootElementContent;
-
- public CMNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- // this is only valid to ask if the content is a root element content
- abstract public String getType();
-
- /**
- * Get the value of rootElementContent. This tells us whether this element
- * content's parent is a direct decendent of the containing element
- *
- * @return value of rootElementContent.
- */
- public boolean isRootElementContent() {
- return rootElementContent;
- }
-
- // if this is a root element, change the content to children
- // ie . (child1)
- public void setChildrenContent(String newChild) {
- if (isRootElementContent()) {
- if (!newChild.equals("")) { //$NON-NLS-1$
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_SET_CHILD_CONTENT")); //$NON-NLS-1$
- replaceText(this, getStartOffset(), getNodeLength(), "(" + newChild + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- endRecording(this);
- return;
- }
-
- if (!getType().equals(CHILDREN)) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_SET_CHILD_CONTENT")); //$NON-NLS-1$
- if (this instanceof CMBasicNode) {
- replaceText(this, getStartOffset(), getNodeLength(), "(newChild)"); //$NON-NLS-1$
- } else {
- // now must convert from mixed content to this one. must
- // preserve the remaining children
- CMGroupNode group = (CMGroupNode) this;
- CMNode firstChild = (CMNode) group.getFirstChild();
- if (firstChild.getType().equals(PCDATA)) {
- group.delete(firstChild);
- }
- }
-
- endRecording(this);
- }
- }
- }
-
- public void setContent(String content) {
- if (isRootElementContent()) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_SET") + " " + content + " " + DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_CONTENT")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- replaceText(this, getStartOffset(), getNodeLength(), content);
- endRecording(this);
- }
- }
-
- // if this is a root element, change the content to mixed
- // ie . (#PCDATA, child1)
- public void setMixedContent() {
- if (isRootElementContent()) {
- if (!getType().equals(MIXED)) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_NODE_SET_MIX_CONTENT")); //$NON-NLS-1$
- if (this instanceof CMBasicNode) {
- replaceText(this, getStartOffset(), getNodeLength(), "(#PCDATA | newChild)*"); //$NON-NLS-1$
- } else {
- // now must convert from children content to this one.
- // must
- // preserve the children
- CMGroupNode group = (CMGroupNode) this;
- group.setConnector(CMGroupNode.CHOICE);
- group.setOccurrence(CMRepeatableNode.ZERO_OR_MORE);
- CMNode firstChild = (CMNode) group.getFirstChild();
- if (!firstChild.getType().equals(PCDATA)) {
- group.insertChildNode("#PCDATA", 0); //$NON-NLS-1$
- }
- }
- endRecording(this);
- }
- }
- }
-
- /**
- * Set the value of rootElementContent.
- *
- * @param v
- * Value to assign to rootElementContent.
- */
- public void setRootElementContent(boolean v) {
- this.rootElementContent = v;
- }
-
- // public void delete()
- // {
- // if (isRootElementContent())
- // {
- // // then the superclasses delete will be fine
- // super.delete();
- // return;
- // }
-
- // CMGroupNode parent = (CMGroupNode) getParentNode();
- // parent.removeChildNode(this);
- // }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java
deleted file mode 100644
index 2c7f94ae62..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java
+++ /dev/null
@@ -1,79 +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.dtd.core;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public abstract class CMRepeatableNode extends CMNode {
-
- public static final char ONCE = '1';
- public static final char ONE_OR_MORE = '+';
- public static final char OPTIONAL = '?';
- public static final char ZERO_OR_MORE = '*';
-
-
- public CMRepeatableNode(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public Image getImage() {
- DTDPlugin resourcePlugin = DTDPlugin.getInstance();
- return resourcePlugin.getImage(DTDResource.ELEMENTREFICON);
- }
-
- public char getOccurrence() {
- ITextRegion occurRegion = getOccurrenceRegion();
- if (occurRegion != null && occurRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return getStructuredDTDDocumentRegion().getText(occurRegion).charAt(0);
- }
- return CMRepeatableNode.ONCE;
- }
-
- // returns the occurrenceregion, or the last region where the occurrence
- // region should appear after
- abstract public ITextRegion getOccurrenceRegion();
-
- public void setOccurrence(char occurrence) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_CM_REP_NODE_CHG_OCCUR")); //$NON-NLS-1$
- setOccurrence(this, occurrence);
- endRecording(this);
- }
-
- public void setOccurrence(Object requestor, char occurrence) {
- if (getOccurrence() != occurrence) {
- ITextRegion region = getOccurrenceRegion();
- if (region != null) {
- if (region.getType().equals(DTDRegionTypes.OCCUR_TYPE)) {
- if (occurrence == CMRepeatableNode.ONCE) {
- // we need to remove the occur region from the flat
- // model;
- getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, ""); //$NON-NLS-1$
- } else {
- // Region oldOccur = region.createCopy();
- getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, String.valueOf(occurrence));
- // changeStructuredDocument(oldOccur, region);
- }
- } else if (occurrence != CMRepeatableNode.ONCE) {
- // System.out.println(getString());
- // we need to create an occurrenceRegion
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(region), 0, String.valueOf(occurrence));
- }
- }
- }
- }
-
-}// CMRepeatableNode
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java
deleted file mode 100644
index 7ade3e4cee..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java
+++ /dev/null
@@ -1,75 +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.dtd.core;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class Comment extends NamedTopLevelNode {
-
- public class StartEndPair {
- public int startOffset, endOffset;
- }
-
- public Comment(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.COMMENT_START);
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.COMMENTICON);
- }
-
- public String getName() {
- String text = getText();
- if (text.length() <= 30) {
- return text;
- } else {
- return text.substring(0, 29) + "..."; //$NON-NLS-1$
- }
- }
-
- private void getStartAndEndOffsetForText(StartEndPair pair) {
- RegionIterator iter = iterator();
- ITextRegion commentStartTag = getStartTag(iter);
- ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
- pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
- if (commentStartTag != null) {
- pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
- }
- if (endCommentTag != null) {
- pair.endOffset = getStructuredDTDDocumentRegion().getStartOffset(endCommentTag);
- }
- }
-
- public String getText() {
- String text = getStructuredDTDDocumentRegion().getText();
- int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
- }
-
- public void setText(String newText) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_COMMENT_CHG")); //$NON-NLS-1$
- int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
- endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java
deleted file mode 100644
index e6bd2643e8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java
+++ /dev/null
@@ -1,667 +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.dtd.core;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.event.NodesEvent;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.util.DTDExternalReferenceRemover;
-import org.eclipse.wst.dtd.core.util.DTDModelUpdater;
-import org.eclipse.wst.dtd.core.util.DTDNotationReferenceRemover;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.events.NewDocumentEvent;
-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.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;
-
-
-public class DTDFile implements IndexedRegion {
- protected NodeList attlistList = new NodeList(this, DTDRegionTypes.ATTLIST_TAG);
- protected NodeList commentList = new NodeList(this, DTDRegionTypes.COMMENT_START);
-
- boolean creatingNewModel = false;
- protected DTDModelImpl dtdModel;
-
- protected NodeList elementList = new NodeList(this, DTDRegionTypes.ELEMENT_TAG);
- protected NodeList entityList = new NodeList(this, DTDRegionTypes.ENTITY_TAG);
-
- protected ArrayList folderList = null;
- protected IStructuredDocument fStructuredDocument;
-
- private boolean isMovingNode = false;
-
- protected ArrayList lists = new ArrayList();
-
- protected ArrayList modelListeners = new ArrayList();
-
- protected ArrayList nodeList = new ArrayList();
- protected NodeList notationList = new NodeList(this, DTDRegionTypes.NOTATION_TAG);
- protected NodeList unrecognizedList = new NodeList(this, DTDRegionTypes.UNKNOWN_CONTENT);
-
- public DTDFile(DTDModelImpl dtdModel) {
- this.dtdModel = dtdModel;
- this.fStructuredDocument = dtdModel.getStructuredDocument();
- }
-
- public void addDTDFileListener(IDTDFileListener listener) {
- modelListeners.add(listener);
- }
-
- protected void addNode(DTDNode node) {
- addNode(nodeList.size(), node);
- }
-
- protected void addNode(int index, DTDNode node) {
- nodeList.add(index, node);
- /*
- * if (index < nodeList.size()) { insertBefore(node, (DTDNode)
- * nodeList.get(index)); } else { appendChild(node); }
- */
- }
-
- public DTDNode buildNode(IStructuredDocumentRegion flatNode) {
- // ITextRegionList regions = flatNode.getRegions();
- DTDNode node = null;
- if (isElement(flatNode)) {
- // then this is an element
- node = new Element(this, flatNode);
- } else if (isEntity(flatNode)) {
- node = new Entity(this, flatNode);
- } else if (isNotation(flatNode)) {
- node = new Notation(this, flatNode);
- } else if (isAttributeList(flatNode)) {
- node = new AttributeList(this, flatNode);
- } else if (isComment(flatNode)) {
- node = new Comment(this, flatNode);
- } else if (isParameterEntityReference(flatNode)) {
- node = new ParameterEntityReference(this, flatNode);
- } else if (!flatNode.getText().trim().equals("")) { //$NON-NLS-1$
- node = new Unrecognized(this, flatNode);
- }
- if (node != null) {
- insertNode(node);
- node.resolveRegions();
- }
- return node;
- }
-
- public void buildNodes(IStructuredDocumentRegionList list) {
- NodesEvent addedDTDNodes = new NodesEvent();
-
- Enumeration flatNodes = list.elements();
- TopLevelNode previousNode = null;
- while (flatNodes.hasMoreElements()) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) flatNodes.nextElement();
- TopLevelNode node = (TopLevelNode) buildNode(flatNode);
- // if we don't create a node, then we assume that the flat
- // node was whitespace. Tack it on to a previous toplevel
- // node
- if (node != null) {
- previousNode = node;
- addedDTDNodes.add(node);
- } else {
- if (previousNode != null) {
- previousNode.addWhitespaceStructuredDocumentRegion(flatNode);
- }
- }
-
- }
- if (addedDTDNodes.getNodes().size() > 0)// &&
- // creatingNewModel == false)
- {
- // now tell people about the additions
- notifyNodesAdded(addedDTDNodes);
- }
- }
-
- // Implements IndexedRegion
-
- public boolean contains(int testPosition) {
- return getStartOffset() <= testPosition && testPosition <= getEndOffset();
- }
-
- public void createAttributeList(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_ADD_ATTR_LIST")); //$NON-NLS-1$
- DTDNode topLevelNode = null;
- String newStream = "<!ATTLIST " + name + ">\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createComment(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_ADD_COMMENT")); //$NON-NLS-1$
- DTDNode topLevelNode = null;
- String newStream = "<!-- " + name + " -->\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createElement(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_ADD_ELEMENT")); //$NON-NLS-1$
- DTDNode topLevelNode = null;
- String newStream = "<!ELEMENT " + name + " EMPTY>\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createEntity(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_ADD_ENTITY")); //$NON-NLS-1$
- DTDNode topLevelNode = null;
- String newStream = "<!ENTITY " + name + " \"\">\n"; //$NON-NLS-1$//$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createNotation(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_ADD_NOTATION")); //$NON-NLS-1$
- DTDNode topLevelNode = null;
- String newStream = "<!NOTATION " + name + " SYSTEM \"\">\n"; //$NON-NLS-1$ //$NON-NLS-2$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void createParameterEntityReference(DTDNode node, String name, boolean isAfter) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_ADD_PARM_ENTITY_REF")); //$NON-NLS-1$
- DTDNode topLevelNode = null;
- String newStream = name + "\n"; //$NON-NLS-1$
- int offset = getInsertOffset(node, isAfter);
- getStructuredDocument().replaceText(this, offset, 0, newStream);
- getDTDModel().endRecording(this);
- }
-
- public void deleteNode(DTDNode node) {
- getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_DELETE")); //$NON-NLS-1$
- deleteNode(this, node);
- getDTDModel().endRecording(this);
- }
-
- public void deleteNode(Object requestor, DTDNode node) {
- DTDNode parent = (DTDNode) node.getParentNode();
- if (parent != null) {
- parent.delete(requestor, node);
- } else {
- if (!isMovingNode) {
- DTDModelUpdater updater = new DTDModelUpdater();
- updater.objectAboutToBeDeleted(requestor, node);
- if (node instanceof ParameterEntityReference) {
- Entity referencedEntity = ((ParameterEntityReference) node).getEntityObject();
- if (referencedEntity != null) {
- // remove references to all elements and parm entities
- // contained in our current model
- DTDExternalReferenceRemover remover = new DTDExternalReferenceRemover();
- remover.externalReferenceAboutToChange(requestor, referencedEntity);
- }
- } else if (node instanceof Notation) {
- Notation notation = ((Notation) node);
- DTDNotationReferenceRemover remover = new DTDNotationReferenceRemover();
- remover.notationAboutToBeDeleted(requestor, notation);
- }
- }
-
- // no parent? then delete up until the start of the next node
- // if it is a top level node
- int startOffset = node.getStartOffset();
- int endOffset = node.getWhitespaceEndOffset();
- if (node instanceof TopLevelNode) {
- endOffset = getInsertOffset(node, true);
- }
- getStructuredDocument().replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- }
- }
-
- public NodeList getComments() {
- return commentList;
- }
-
- public DTDModelImpl getDTDModel() {
- return dtdModel;
- }
-
- public NodeList getElementsAndParameterEntityReferences() {
- return elementList;
- }
-
- public int getEndOffset() {
- IStructuredDocumentRegion region = getStructuredDocument().getFirstStructuredDocumentRegion();
- if (region != null)
- return region.getEndOffset();
- else
- return 1;
- }
-
- public NodeList getEntities() {
- return entityList;
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.DTDFILEICON);
- }
-
-
-
- public int getInsertOffset(DTDNode node, boolean isAfter) {
- int offset = 0;
- if (node != null) {
- if (isAfter) {
- // then get the next node and use it's start offset
- int index = getNodes().indexOf(getNode(node.getStructuredDTDDocumentRegion()));
-
- DTDNode afterNode = null;
- if (index + 1 < getNodes().size()) {
- afterNode = (DTDNode) getNodes().get(index + 1);
- }
- if (afterNode != null) {
- offset = afterNode.getStructuredDTDDocumentRegion().getStartOffset();
- } else {
- // add to end
- if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
- offset = getStructuredDocument().getLastStructuredDocumentRegion().getEndOffset();
- }
- }
- } else {
- offset = node.getStructuredDTDDocumentRegion().getStartOffset();
- }
- } else {
- // add to end
- if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
- offset = getStructuredDocument().getLastStructuredDocumentRegion().getEndOffset();
- }
- }
- return offset;
- }
-
- public String getName() {
- org.eclipse.core.runtime.Path path = new org.eclipse.core.runtime.Path(getDTDModel().getId().toString());
- return path.lastSegment();
- }
-
- public DTDNode getNode(IStructuredDocumentRegion flatNode) {
- for (int i = 0; i < nodeList.size(); i++) {
- DTDNode node = (DTDNode) nodeList.get(i);
- if (node.getStructuredDTDDocumentRegion() == flatNode) {
- return node;
- }
- }
- return null;
- }
-
- public IndexedRegion getNodeAt(int offset) {
- DTDNode node = getTopLevelNodeAt(offset);
- if (node != null) {
- return node.getDeepestNode(offset);
- }
- return null;
- }
-
- public IndexedRegion getNodeAt(int startOffset, int endOffset) {
- DTDNode node = getTopLevelNodeAt(startOffset);
- if (node != null) {
- return node.getDeepestNode(startOffset, endOffset);
- }
- return null;
- }
-
- public ArrayList getNodeLists() {
- if (folderList == null) {
- folderList = new ArrayList();
- folderList.add(notationList);
- folderList.add(entityList);
- folderList.add(elementList);
- // http://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4200
- //folderList.add(attlistList);
- //folderList.add(commentList);
- folderList.add(unrecognizedList);
- }
- return folderList;
- }
-
- public ArrayList getNodes() {
- return nodeList;
- }
-
- public NodeList getNotations() {
- return notationList;
- }
-
- public int getStartOffset() {
- IStructuredDocumentRegion region = getStructuredDocument().getFirstStructuredDocumentRegion();
- if (region != null)
- return region.getStartOffset();
- else
- return 1;
- }
-
- public IStructuredDocument getStructuredDocument() {
- return fStructuredDocument;
- }
-
- public DTDNode getTopLevelNodeAt(int offset) {
- for (int i = 0; i < nodeList.size(); i++) {
- DTDNode node = (DTDNode) nodeList.get(i);
- if (node.contains(offset)) {
- return node;
- }
- }
- return null;
- }
-
- public NodeList getUnrecognized() {
- return unrecognizedList;
- }
-
- public void insertIntoModel(Object requestor, DTDNode reference, DTDNode node, boolean isAfter) {
- String nodeText = ""; //$NON-NLS-1$
- if (node instanceof TopLevelNode) {
- nodeText = ((TopLevelNode) node).getFullText();
- } else {
- nodeText = node.getNodeText();
- }
- int offset = getInsertOffset(reference, isAfter);
- getStructuredDocument().replaceText(requestor, offset, 0, nodeText);
- }
-
-
- public void insertNode(DTDNode node) {
- int startOffset = node.getStartOffset();
- int insertIndex = -1;
- // System.out.println("startoffset = " + startOffset);
- for (int i = 0; i < getNodes().size(); i++) {
- DTDNode currentNode = (DTDNode) getNodes().get(i);
- // System.out.println("currentNode endOffset = "
- // +currentNode.getEndOffset());
-
- if (currentNode.getEndOffset() > startOffset) {
- // System.out.println("endoffset " +
- // currentNode.getEndOffset() + " > " + startOffset);
- insertIndex = i;
- break;
- }
- }
- if (insertIndex == -1) {
- insertIndex = getNodes().size();
- }
-
-
- // System.out.println("insert index = " + insertIndex);
-
- addNode(insertIndex, node);
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isAttributeList(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ATTLIST_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isComment(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 2) {
- ITextRegion region = flatNode.getRegions().get(1);
- if (region.getType().equals(DTDRegionTypes.COMMENT_START)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isElement(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ELEMENT_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isEntity(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.ENTITY_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isNotation(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() >= 3) {
- ITextRegion second = flatNode.getRegions().get(1);
- ITextRegion third = flatNode.getRegions().get(2);
- if (second.getType().equals(DTDRegionTypes.EXCLAMATION) && third.getType().equals(DTDRegionTypes.NOTATION_TAG)) {
- return true;
- }
- }
- return false;
- }
-
- // it is assumed that flatnode contains at least 3 regions
- public boolean isParameterEntityReference(IStructuredDocumentRegion flatNode) {
- if (flatNode.getRegions().size() == 1) {
- ITextRegion region = flatNode.getRegions().get(0);
- if (region.getType().equals(DTDRegionTypes.ENTITY_PARM)) {
- return true;
- }
- }
- return false;
- }
-
- boolean isSameTopLevelType(DTDNode affectedNode) {
- IStructuredDocumentRegion flatNode = affectedNode.getStructuredDTDDocumentRegion();
- // return true if the flatnode still matches what the affectedNode
- // is representing
- if (affectedNode instanceof Element && isElement(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Entity && isEntity(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Comment && isComment(flatNode)) {
- return true;
- }
- if (affectedNode instanceof AttributeList && isAttributeList(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Notation && isNotation(flatNode)) {
- return true;
- }
- if (affectedNode instanceof Unrecognized && isUnrecognized(flatNode)) {
- return true;
- }
- return false;
- }
-
- public boolean isUnrecognized(IStructuredDocumentRegion flatNode) {
- return !isElement(flatNode) && !isEntity(flatNode) && !isNotation(flatNode) && !isParameterEntityReference(flatNode) && !isAttributeList(flatNode) && !isComment(flatNode);
- }
-
- public void moveNode(Object requestor, DTDNode referenceNode, DTDNode nodeToMove, boolean isAfter) {
- isMovingNode = true;
-
- deleteNode(requestor, nodeToMove);
- insertIntoModel(requestor, referenceNode, nodeToMove, isAfter);
- isMovingNode = false;
- }
-
- public void newModel(NewDocumentEvent event) {
- creatingNewModel = true;
- nodeList.clear();
- NodesEvent removeEvent = new NodesEvent();
- removeEvent.getNodes().addAll(nodeList);
- notifyNodesRemoved(removeEvent);
- /* removeChildNodes(); */
-
- if (fStructuredDocument != null && fStructuredDocument.getRegionList() != null) {
- buildNodes(fStructuredDocument.getRegionList());
- }
- creatingNewModel = false;
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- IStructuredDocumentRegionList oldNodes = event.getOldStructuredDocumentRegions();
- NodesEvent removedDTDNodes = new NodesEvent();
- for (int i = 0; i < oldNodes.getLength(); i++) {
- IStructuredDocumentRegion flatNode = oldNodes.item(i);
-
- for (Iterator iter = getNodes().iterator(); iter.hasNext();) {
- DTDNode node = (DTDNode) iter.next();
- if (node.getStructuredDTDDocumentRegion() == flatNode) {
- removedDTDNodes.add(node);
- }
- }
- }
-
- buildNodes(event.getNewStructuredDocumentRegions());
-
- if (removedDTDNodes.getNodes().size() > 0) {
- notifyNodesRemoved(removedDTDNodes);
- removeNodes(removedDTDNodes.getNodes());
- }
- }
-
- public void notifyNodeChanged(DTDNode node) {
- Iterator iter = modelListeners.iterator();
- while (iter.hasNext()) {
- IDTDFileListener listener = (IDTDFileListener) iter.next();
- listener.nodeChanged(node);
- }
- }
-
- public void notifyNodesAdded(NodesEvent addedNodes) {
- Iterator iter = modelListeners.iterator();
- while (iter.hasNext()) {
- IDTDFileListener listener = (IDTDFileListener) iter.next();
- listener.nodesAdded(addedNodes);
- }
- }
-
- protected void notifyNodesRemoved(NodesEvent event) {
- Iterator iter = modelListeners.iterator();
- while (iter.hasNext()) {
- IDTDFileListener listener = (IDTDFileListener) iter.next();
- listener.nodesRemoved(event);
- }
- }
-
- public void rebuildNodes(List nodes) {
- // remove the old nodes
- removeNodes(nodes);
-
- // now rebuild them
- NodesEvent addedDTDNodes = new NodesEvent();
- Iterator dtdNodes = nodes.iterator();
- while (dtdNodes.hasNext()) {
- DTDNode dtdNode = (DTDNode) dtdNodes.next();
- // System.out.println("rebuilding " +
- // dtdNode.getStructuredDocumentRegion().getText());
-
- DTDNode node = buildNode(dtdNode.getStructuredDTDDocumentRegion());
- if (node != null) {
- addedDTDNodes.add(node);
- }
- }
- if (addedDTDNodes.getNodes().size() > 0) {
- // now tell people about the additions
- notifyNodesAdded(addedDTDNodes);
- }
- }
-
- public void regionChanged(RegionChangedEvent event) {
- ITextRegion changedRegion = event.getRegion();
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- DTDNode affectedNode = (DTDNode) getNodeAt(flatNode.getStartOffset(changedRegion), flatNode.getEndOffset(changedRegion));
- if (affectedNode != null) {
- // no need to resolve regions as it is just a change
- // affectedNode.resolveRegions();
- notifyNodeChanged(affectedNode);
- }
- }
-
- public void regionsReplaced(RegionsReplacedEvent event) {
- List nodesToRebuild = new ArrayList();
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- DTDNode affectedNode = getNode(flatNode);
-
- if (!isSameTopLevelType(affectedNode)) {
- nodesToRebuild.add(affectedNode);
- rebuildNodes(nodesToRebuild);
- } else {
- affectedNode.resolveRegions();
- notifyNodeChanged(affectedNode);
- // now try and determine which ones were added
- NodesEvent addedDTDNodes = new NodesEvent();
- ITextRegionList newRegions = event.getNewRegions();
- int size = newRegions.size();
- for (int i = 0; i < size; i++) {
- ITextRegion region = newRegions.get(i);
- DTDNode deepestNode = affectedNode.getDeepestNode(flatNode.getStartOffset(region), flatNode.getEndOffset(region));
- if (!addedDTDNodes.getNodes().contains(deepestNode)) {
- addedDTDNodes.add(deepestNode);
- }
- }
- if (addedDTDNodes.getNodes().size() > 0) {
- notifyNodesAdded(addedDTDNodes);
- }
- }
- }
-
- public void removeDTDFileListener(IDTDFileListener listener) {
- modelListeners.remove(listener);
- }
-
- protected void removeNodes(List nodes) {
- getNodes().removeAll(nodes);
- /*
- * for (int i = 0; i < nodes.size(); i++) {
- * removeChild((DTDNode)nodes.get(i)); } // end of for ()
- */
- }
-
- /**
- * Sets the flatModel.
- *
- * @param flatModel
- * The flatModel to set
- */
- public void setStructuredDocument(IStructuredDocument flatModel) {
- this.fStructuredDocument = flatModel;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java
deleted file mode 100644
index a51b6b9542..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java
+++ /dev/null
@@ -1,333 +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.dtd.core;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.IFactoryRegistry;
-import org.eclipse.wst.sse.core.IndexedRegion;
-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.xml.core.internal.document.NodeContainer;
-
-
-public abstract class DTDNode extends NodeContainer implements IndexedRegion {
-
- // these are characteroffsets
- protected DTDFile dtdFile;
-
- // flat node that contains this node
- protected IStructuredDocumentRegion flatNode;
-
- protected TextRegionListImpl regions = new TextRegionListImpl();
-
- protected TextRegionListImpl whitespace = new TextRegionListImpl();
-
- public DTDNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
- this.dtdFile = dtdFile;
- this.flatNode = flatNode;
- }
-
- public void addRegion(ITextRegion region) {
- /*
- * if (startRegion == null) { startRegion = region; } endRegion =
- * region;
- */
- regions.add(region);
- }
-
- public void addWhitespaceRegion(ITextRegion region) {
- whitespace.add(region);
- }
-
- public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException {
- // System.out.println("appendchild called with " + newChild);
- return super.appendChild(newChild);
- }
-
- public void beginRecording(Object requestor, String label) {
- getDTDFile().getDTDModel().beginRecording(requestor, label);
- }
-
- public org.w3c.dom.Node cloneNode(boolean deepest) {
- return null;
- }
-
- public boolean contains(int testPosition) {
- return containsRange(testPosition, testPosition);
- }
-
- public boolean containsRange(int start, int end) {
- return getStartOffset() <= start && end <= getEndOffset();
- }
-
- public void delete(DTDNode child) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_NODE_DELETE")); //$NON-NLS-1$
- delete(this, child);
- endRecording(this);
- }
-
- public void delete(Object requestor, DTDNode child) {
- replaceText(requestor, child.getStartOffset(), child.getFullNodeLength(), ""); //$NON-NLS-1$
- }
-
- public void endRecording(Object requestor) {
- getDTDFile().getDTDModel().endRecording(requestor);
- }
-
- public Object[] getChildren() {
- return getChildrenList().toArray();
- }
-
- public List getChildrenList() {
- org.w3c.dom.Node child = getFirstChild();
- if (child != null) {
- List children = new ArrayList();
- for (; child != null; child = child.getNextSibling()) {
- children.add(child);
- }
- return children;
- } else {
- return Collections.EMPTY_LIST;
- }
- }
-
- public DTDNode getDeepestNode(int offset) {
- if (contains(offset)) {
- // now see if a child contains this offset
- Object[] children = getChildren();
- for (int i = 0; i < children.length; i++) {
- DTDNode child = (DTDNode) children[i];
- DTDNode deepest = child.getDeepestNode(offset);
- if (deepest != null) {
- return deepest;
- }
- } // end of for ()
- return this;
- }
- return null;
- }
-
- public DTDNode getDeepestNode(int start, int end) {
- if (containsRange(start, end)) {
- // now see if a child contains this offset
- Object[] children = getChildren();
- for (int i = 0; i < children.length; i++) {
- DTDNode child = (DTDNode) children[i];
- DTDNode deepest = child.getDeepestNode(start, end);
- if (deepest != null) {
- return deepest;
- }
- } // end of for ()
- return this;
- }
- return null;
- }
-
- public DTDFile getDTDFile() {
- return dtdFile;
- }
-
- public int getEndOffset() {
- return getStructuredDTDDocumentRegion().getEndOffset(getEndRegion());
- }
-
- public ITextRegion getEndRegion() {
- return regions.get(regions.size() - 1);// endRegion;
- }
-
- /**
- */
- public IFactoryRegistry getFactoryRegistry() {
- DTDModelImpl model = dtdFile.getDTDModel();
- if (model != null) {
- IFactoryRegistry reg = model.getFactoryRegistry();
- if (reg != null)
- return reg;
- }
- return null;
- }
-
- public int getFullNodeLength() {
- return getWhitespaceEndOffset() - getStartOffset();
- }
-
- public String getFullNodeText() {
- String text = getNodeText();
- if (whitespace.size() > 0) {
- RegionIterator iter = new RegionIterator(whitespace);
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- text += getStructuredDTDDocumentRegion().getText(region);
- }
- }
- return text;
- }
-
- abstract public Image getImage();
-
- public String getName() {
- ITextRegion region = getNameRegion();
- if (region != null) {
- return getStructuredDTDDocumentRegion().getText(region);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getNameRegion() {
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType() == DTDRegionTypes.NAME) {
- return region;
- }
- }
- return null;
- }
-
- // return the first token containing the specified token type
- public ITextRegion getNextRegion(RegionIterator iter, String type) {
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(type)) {
- return region;
- }
- }
- return null;
- }
-
- public int getNodeLength() {
- return getEndOffset() - getStartOffset();
- }
-
- public String getNodeName() {
- return getName();
- }
-
- public String getNodeText() {
- StringBuffer sb = new StringBuffer();
-
- RegionIterator iter = iterator();
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- sb.append(getStructuredDTDDocumentRegion().getText(region));
- }
- return sb.toString();
- }
-
- public short getNodeType() {
- return -1;
- }
-
- public int getStartOffset() {
- return getStructuredDTDDocumentRegion().getStartOffset(getStartRegion());
- }
-
- // private Region startRegion,endRegion;
- public ITextRegion getStartRegion() {
- return regions.get(0);
- // return startRegion;
- }
-
- /**
- * Get the value of flatNode.
- *
- * @return value of flatNode.
- *
- * ISSUE:named changed not to be confused with default access protected
- * super class method, but should re-think if this is correct technique.
- * Perhaps getFirstRegion?
- */
- public IStructuredDocumentRegion getStructuredDTDDocumentRegion() {
- return flatNode;
- }
-
- // return end offset including whitespace
- // or just the end offset if there is no whitespace
- public int getWhitespaceEndOffset() {
- if (whitespace.size() > 0) {
- ITextRegion region = whitespace.get(whitespace.size() - 1);
- return getStructuredDTDDocumentRegion().getEndOffset(region);
- }
-
- return getEndOffset();
- }
-
- public boolean hasTrailingWhitespace() {
- return whitespace.size() > 0;
- }
-
- public RegionIterator iterator() {
- // System.out.println("create region iter " + this.getClass() + " with
- // start , end = " + getStartOffset() + ", " +getEndOffset());
- return new RegionIterator(regions);
- }
-
- public void replaceText(Object requestor, int start, int length, String newText) {
- getDTDFile().getStructuredDocument().replaceText(requestor, start, length, newText);
- }
-
- public void resolveRegions() {
- }
-
- public void setName(Object requestor, String name) {
- if (!getName().equals(name)) {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- // nameToken.updateText(name);
- getDTDFile().getDTDModel().getReferenceUpdater().nameAboutToChange(requestor, this, name);
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(nameRegion), nameRegion.getLength(), name);
- }
- }
- }
-
- public void setName(String name) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_NODE_NAME_CHG")); //$NON-NLS-1$
- setName(this, name);
- endRecording(this);
- }
-
- /**
- * Set the value of flatNode.
- *
- * @param v
- * Value to assign to flatNode. ISSUE:named changed not to be
- * confused with default access protected super class method,
- * but should re-think if this is correct technique
- */
- void setStructuredDTDDocumentRegion(IStructuredDocumentRegion v) {
- this.flatNode = v;
- }
-
- // skips past next name token in the iterator
- protected void skipPastName(RegionIterator iter) {
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
- if (currentRegion.getType() == DTDRegionTypes.NAME) {
- break;
- }
- }
- }
-
- public boolean supports(java.lang.String feature, java.lang.String version) {
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDPlugin.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDPlugin.java
deleted file mode 100644
index 6a9d11f3c7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDPlugin.java
+++ /dev/null
@@ -1,108 +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.dtd.core;
-
-import java.text.MessageFormat;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class DTDPlugin extends AbstractUIPlugin {
- private static DTDPlugin instance;
-
- public static Image getDTDImage(String iconName) {
- return getInstance().getImage(iconName);
- }
-
- public static ImageDescriptor getDTDImageDescriptor(String iconName) {
- String thisID = getInstance().getBundle().getSymbolicName();
- return AbstractUIPlugin.imageDescriptorFromPlugin(thisID, iconName);
- }
-
- public static String getDTDString(String key) {
- // In case it is invoked from a command line
- if (getInstance() == null) {
- return ""; //$NON-NLS-1$
- }
-
- return getInstance().getString(key);
- }
-
- public synchronized static DTDPlugin getInstance() {
- return instance;
- }
-
- public static DTDPlugin getPlugin() {
- return instance;
- }
-
- private ResourceBundle resourceBundle;
-
- public DTDPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- instance = this;
- try {
- resourceBundle = descriptor.getResourceBundle();
- } catch (java.util.MissingResourceException exception) {
- //B2BUtilPlugin.getPlugin().getMsgLogger().write(B2BUtilPlugin.getGUIString("_WARN_PLUGIN_PROPERTIES_MISSING")
- // + descriptor.getLabel());
- resourceBundle = null;
- }
- }
-
- public Image getImage(String iconName) {
- ImageRegistry imageRegistry = getImageRegistry();
- Image image = imageRegistry.get(iconName);
-
- if (image == null) {
- String thisID = getInstance().getBundle().getSymbolicName();
- imageRegistry.put(iconName, imageDescriptorFromPlugin(thisID, iconName));
- image = imageRegistry.get(iconName);
- }
-
- return image;
- }
-
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- /**
- * This gets the string resource.
- */
- public String getString(String key) {
- return getResourceBundle().getString(key);
- }
-
- /**
- * This gets the string resource and does one substitution.
- */
- public String getString(String key, Object s1) {
- return MessageFormat.format(getString(key), new Object[]{s1});
- }
-
- /**
- * This gets the string resource and does two substitutions.
- */
- public String getString(String key, Object s1, Object s2) {
- return MessageFormat.format(getString(key), new Object[]{s1, s2});
- }
-
- public void startup() {
- instance = this;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDResource.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDResource.java
deleted file mode 100644
index 0f1d053020..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDResource.java
+++ /dev/null
@@ -1,57 +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.dtd.core;
-
-
-public interface DTDResource {
- //Enumeration Constants
- public static final String ANYICON = "icons/full/obj16/any.gif"; //$NON-NLS-1$
- public static final String ATTRIBUTEICON = "icons/full/obj16/attribute.gif"; //$NON-NLS-1$
- public static final String ATTRIBUTELISTICON = "icons/full/obj16/attribute_list.gif"; //$NON-NLS-1$
- public static final String COMMENTICON = "icons/full/obj16/comment.gif"; //$NON-NLS-1$
-
- public static final String DTDFILEICON = "icons/full/obj16/DTDFile.gif"; //$NON-NLS-1$
- public static final String ELEMENTICON = "icons/full/obj16/element.gif"; //$NON-NLS-1$
- public static final String ELEMENTREFICON = "icons/full/obj16/element_ref.gif"; //$NON-NLS-1$
- public static final String EMPTYICON = "icons/full/obj16/emptycontent.gif"; //$NON-NLS-1$
- public static final String ENTITYICON = "icons/full/obj16/entity.gif"; //$NON-NLS-1$
- public static final String ENTITYREFERENCEICON = "icons/full/obj16/entity_reference.gif"; //$NON-NLS-1$
- public static final String FLDR_ATTLIST = "icons/full/obj16/folder_attlist_obj.gif"; //$NON-NLS-1$
- public static final String FLDR_COMM = "icons/full/obj16/folder_comments_obj.gif"; //$NON-NLS-1$
-
- public static final String FLDR_EL = "icons/full/obj16/fldr_el.gif"; //$NON-NLS-1$
- public static final String FLDR_ENT = "icons/full/obj16/fldr_ent.gif"; //$NON-NLS-1$
- public static final String FLDR_NOT = "icons/full/obj16/fldr_not.gif"; //$NON-NLS-1$
- public static final String FLDR_UNREC = "icons/full/obj16/fldr_unrec.gif"; //$NON-NLS-1$
-
- public static final String NEWDTD = "icons/full/obj16/newdtd_wiz.gif"; //$NON-NLS-1$
- public static final String NEWHTMLFORM = "icons/full/obj16/genhtmform_wiz.gif"; //$NON-NLS-1$
- public static final String NOTATIONICON = "icons/full/obj16/notation.gif"; //$NON-NLS-1$
-
- public static final String ONECHOICEICON = "icons/full/obj16/onechoice.gif"; //$NON-NLS-1$
-
- public static final String ONEICON = "icons/full/obj16/one.gif"; //$NON-NLS-1$
- public static final String ONEORMORECHOICEICON = "icons/full/obj16/oneormorechoice.gif"; //$NON-NLS-1$
- public static final String ONEORMOREICON = "icons/full/obj16/oneormore.gif"; //$NON-NLS-1$
- public static final String ONEORMORESEQUENCEICON = "icons/full/obj16/oneormoresequence.gif"; //$NON-NLS-1$
-
- public static final String ONESEQUENCEICON = "icons/full/obj16/onesequence.gif"; //$NON-NLS-1$
- public static final String OPTIONALCHOICEICON = "icons/full/obj16/optionalchoice.gif"; //$NON-NLS-1$
- public static final String OPTIONALICON = "icons/full/obj16/optional.gif"; //$NON-NLS-1$
- public static final String OPTIONALSEQUENCEICON = "icons/full/obj16/optionalsequence.gif"; //$NON-NLS-1$
- public static final String PCDATAICON = "icons/full/obj16/txtext.gif"; //$NON-NLS-1$
- public static final String UNRECOGNIZEDICON = "icons/full/obj16/unrecognized_content.gif"; //$NON-NLS-1$
- public static final String ZEROORMORECHOICEICON = "icons/full/obj16/zeroormorechoice.gif"; //$NON-NLS-1$
- public static final String ZEROORMOREICON = "icons/full/obj16/zeroormore.gif"; //$NON-NLS-1$
- public static final String ZEROORMORESEQUENCEICON = "icons/full/obj16/zeroormoresequence.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java
deleted file mode 100644
index f8f9d9311c..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java
+++ /dev/null
@@ -1,197 +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.dtd.core;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.w3c.dom.Node;
-
-
-public class Element extends NamedTopLevelNode {
-
- List attListList = new ArrayList();
-
- List attributes = new ArrayList();
-
- protected CMNode contentModel;
-
- public Element(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
- super(dtdFile, flatNode, DTDRegionTypes.ELEMENT_TAG);
- }
-
- public void addAttribute(String name) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ELEMENT_ADD_ATTR")); //$NON-NLS-1$
- List attLists = getAttributeLists();
- if (attLists.size() == 0) {
- getDTDFile().createAttributeList(this, getName(), true);
- attLists = getAttributeLists();
- }
- if (attLists.size() > 0) {
- AttributeList attList = (AttributeList) attLists.get(attLists.size() - 1);
- attList.addAttribute(name);
- }
- endRecording(this);
- }
-
- public void addChild() {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ELEMENT_ADD_CHILD")); //$NON-NLS-1$
- addContent(this, " EMPTY"); //$NON-NLS-1$
- endRecording(this);
- }
-
- protected void addContent(Object requestor, String content) {
- ITextRegion whitespace = getWhitespaceAfterName();
- int startOffset = 0;
- int length = 0;
- if (whitespace != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(whitespace);
- length = whitespace.getLength() >= 2 ? 1 : 0;
- } else {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
- } else {
- ITextRegion elementTag = getNextRegion(iterator(), DTDRegionTypes.ELEMENT_TAG);
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(elementTag);
- }
- }
- replaceText(requestor, startOffset, length, content);
- }
-
- public void addGroup() {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ELEMENT_ADD_GRP")); //$NON-NLS-1$
- addContent(this, " ()"); //$NON-NLS-1$
- endRecording(this);
- }
-
- public Node cloneNode(boolean deep) {
- return new Element(dtdFile, flatNode);
- }
-
- public List getAttributeLists() {
- attListList.clear();
- String elementName = getName();
- Iterator iter = dtdFile.getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof AttributeList && node.getName().equals(elementName)) {
- attListList.add(node);
- }
- }
- return attListList;
- }
-
-
-
- public CMNode getContentModel() {
- // Object[] children = getChildren()
- return (CMNode) getFirstChild();//contentModel;
- }
-
- public List getElementAttributes() {
- attributes.clear();
- Iterator attLists = getAttributeLists().iterator();
- while (attLists.hasNext()) {
- AttributeList attList = (AttributeList) attLists.next();
-
- Object[] children = attList.getChildren();
- for (int i = 0; i < children.length; i++) {
- attributes.add(children[i]);
- }
- }
- return attributes;
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.ELEMENTICON);
- }
-
- public short getNodeType() {
- return Node.ELEMENT_NODE;
- }
-
- public void replaceContentModel(Object requestor, CMNode node) {
- int offset = 0;
- int length = 0;
- String nodeText = node.getNodeText();
- CMNode contentModel = getContentModel();
- if (contentModel != null) {
- offset = contentModel.getStartOffset();
- length = contentModel.getWhitespaceEndOffset() - offset;
- replaceText(requestor, offset, length, nodeText);
- } else {
- addContent(requestor, nodeText);
- }
- }
-
- public void resolveRegions() {
- // System.out.println("element node stream = " +
- // tokenStream.getString());
- contentModel = null;
- removeChildNodes();
- RegionIterator iter = iterator();
-
- if (getNameRegion() != null) {
- // we skip past the name token is our name
- skipPastName(iter);
- }
-
- CMBasicNode basicNode = null;
- while (iter.hasNext()) {
- ITextRegion currentRegion = iter.next();
-
- if (contentModel == null) {
- if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
- contentModel = basicNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- } else if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
- contentModel = basicNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
- } else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- contentModel = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
- }
- }
-
- if (contentModel != null) {
- if (!currentRegion.getType().equals(DTDRegionTypes.END_TAG)) {
- // content model gets all regions except for the '>'
- contentModel.addRegion(currentRegion);
- } else {
- // if it is equal to the end tag, then don't add anymore
- // regions
- // for the content model
- break;
- }
-
- }
-
- }
- if (contentModel != null) {
- appendChild(contentModel);
- // this is the root element content so set it true
- contentModel.setRootElementContent(true);
- // now tell the content model to resolve it's regions
- contentModel.resolveRegions();
-
- }
- }
-
- public void setContentModel(CMNode contentModel) {
- this.contentModel = contentModel;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java
deleted file mode 100644
index b3445e2d69..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java
+++ /dev/null
@@ -1,324 +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.dtd.core;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-// external node contains code to help set and get public ids
-public class Entity extends ExternalNode {
-
- private static String setExternalEntity = DTDPlugin.getDTDString("_UI_LABEL_ENTITY_SET_EXT_ENTITY"); //$NON-NLS-1$
- private static String setGeneralEntity = DTDPlugin.getDTDString("_UI_LABEL_ENTITY_SET_GENERAL_ENTITY"); //$NON-NLS-1$
- private static String setInternalEntity = DTDPlugin.getDTDString("_UI_LABEL_ENTITY_SET_INT_ENTITY"); //$NON-NLS-1$
-
- private static String setParameterEntity = DTDPlugin.getDTDString("_UI_LABEL_ENTITY_SET_PARM_ENTITY"); //$NON-NLS-1$
-
- public Entity(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.ENTITY_TAG);
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.ENTITYICON);
- }
-
-
- /**
- * Get the value of notationName.
- *
- * @return value of notationName.
- */
- public String getNotationName() {
- ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
- if (ndataRegion != null) {
- return getStructuredDTDDocumentRegion().getText(ndataRegion);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getPercentRegion() {
- return getNextRegion(iterator(), DTDRegionTypes.PERCENT);
- }
-
- /**
- * Get the value of value.
- *
- * @return value of value.
- */
- public String getValue() {
- if (!isExternalEntity()) {
- ITextRegion valueRegion = getNextQuotedLiteral(iterator());
- if (valueRegion != null) {
- return getValueFromQuotedRegion(valueRegion);
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Get the value of externalEntity.
- *
- * @return value of externalEntity.
- */
- public boolean isExternalEntity() {
- return getPublicKeywordRegion(iterator()) != null || getSystemKeywordRegion(iterator()) != null;
- }
-
- /**
- * Get the value of isParameterEntity.
- *
- * @return value of isParameterEntity.
- */
- public boolean isParameterEntity() {
- return getPercentRegion() != null;
- }
-
- private void removeNData(Object requestor) {
- ITextRegion ndataRegion = null;
-
- // see if we have an NDATA keyword
- ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_KEYWORD);
- int startOffset = 0, endOffset = 0;
- if (ndataRegion != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(ndataRegion);
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataRegion);
- }
- ITextRegion value = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
- if (value != null) {
- if (startOffset == 0) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(value);
- }
- endOffset = getStructuredDTDDocumentRegion().getEndOffset(value);
- }
- replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- }
-
- /**
- * Set the value of externalEntity.
- *
- * @param v
- * Value to assign to externalEntity.
- */
- public void setExternalEntity(boolean isExternalEntity) {
- if (isExternalEntity() != isExternalEntity) {
- // externalEntity = v;
- beginRecording(this, isExternalEntity ? setExternalEntity : setInternalEntity);
- if (isExternalEntity) {
- // we need to get rid of the value literal
- ITextRegion quote = getNextRegion(iterator(), DTDRegionTypes.SINGLEQUOTED_LITERAL);
- if (quote == null) {
- quote = getNextRegion(iterator(), DTDRegionTypes.DOUBLEQUOTED_LITERAL);
- }
- if (quote != null) {
- replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(quote), quote.getLength(), ""); //$NON-NLS-1$
- }
- setSystemID(""); //$NON-NLS-1$
- } else {
- // we need to get rid of text between end of name region and
- // the last double quoted literal
- RegionIterator iter = iterator();
- ITextRegion keyword = getSystemKeywordRegion(iter);
- int startOffset = 0;
- int length = 0;
- if (keyword == null) {
- // reset the iterator
- iter = iterator();
- keyword = getPublicKeywordRegion(iter);
- }
- if (keyword != null) {
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(keyword);
- // start with a length just equal to the keyword for now
- length = keyword.getLength();
- } else {
- // reset the iterator since we didn't find the keyword
- iter = iterator();
- // just go from after the name
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(getNameRegion());
- }
-
- // now that we have the start, look for the end
- ITextRegion lastRegion = null;
-
- if (lastRegion == null) {
- // then look for last quoted literal
- while (iter.hasNext()) {
- ITextRegion literal = getNextQuotedLiteral(iter);
- if (literal != null) {
- lastRegion = literal;
- }
- }
- }
-
- if (lastRegion != null) {
- length = getStructuredDTDDocumentRegion().getEndOffset(lastRegion) - startOffset;
- }
- replaceText(this, startOffset, length, "\"\""); //$NON-NLS-1$
- removeNData(this);
- }
- endRecording(this);
- }
- }
-
- public void setNotationName(Object requestor, String newNotation) {
- if (!getNotationName().equals(newNotation)) {
- if (!newNotation.equals("")) { //$NON-NLS-1$
- //
- ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
- if (ndataRegion != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(ndataRegion), ndataRegion.getLength(), newNotation);
- } else {
- // time to create one
- int startOffset = 0;
- String string = ""; //$NON-NLS-1$
- RegionIterator iter = iterator();
- ITextRegion ndataKeyword = getNextRegion(iter, DTDRegionTypes.NDATA_KEYWORD);
- if (ndataKeyword == null) {
- // we'll need to create one after the last quoted
- // literal
- // Reset iterator
- string += " NDATA "; //$NON-NLS-1$
- iter = iterator();
- ITextRegion lastQuotedLiteral = null;
- while (iter.hasNext()) {
- ITextRegion literal = getNextQuotedLiteral(iter);
- if (literal != null) {
- lastQuotedLiteral = literal;
- }
- }
- if (lastQuotedLiteral != null) {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(lastQuotedLiteral);
- } else {
- // created after the system or public keyword
- ITextRegion keyword = getPublicKeywordRegion(iterator());
- if (keyword == null) {
- keyword = getSystemKeywordRegion(iterator());
- }
- // we shouldn't be null here since we check if we
- // were external already
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(keyword);
- }
-
- } else {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataKeyword);
- }
- replaceText(requestor, startOffset, 0, string + newNotation);
- }
- } else {
- // need to remove the ndata stuff
- removeNData(requestor);
- }
- }
- }
-
- /**
- * Set the value of notationName.
- *
- * @param newNotation
- * Value to assign to notationName.
- */
- public void setNotationName(String newNotation) {
- beginRecording(this, "NDATA " + DTDPlugin.getDTDString("_UI_LABEL_ENTITY_NDATA_CHANGE")); //$NON-NLS-1$ //$NON-NLS-2$
- setNotationName(this, newNotation);
- endRecording(this);
- }
-
- /**
- * Set the value of isParameterEntity.
- *
- * @param v
- * Value to assign to isParameterEntity.
- */
- public void setParameterEntity(boolean v) {
- if (isParameterEntity() != v) {
- beginRecording(this, v ? setParameterEntity : setGeneralEntity);
- if (v) {
- RegionIterator iter = iterator();
- ITextRegion startTag = getNextRegion(iter, DTDRegionTypes.ENTITY_TAG);
- int startOffset = 0, length = 0;
-
- if (iter.hasNext()) {
- ITextRegion region = iter.next();
- startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
- if (region.getType() == DTDRegionTypes.WHITESPACE && region.getLength() > 1) {
- length = 1;
- }
- } else {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(startTag);
- }
- replaceText(this, startOffset, length, " %"); //$NON-NLS-1$
- // now get rid of any NData since it is only allowed if the
- // entity is a general entity and not a parameter entity
- removeNData(this);
- } else {
- // get rid of percent region
- ITextRegion percentRegion = getPercentRegion();
- replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(percentRegion), percentRegion.getLength(), ""); //$NON-NLS-1$
- }
-
- endRecording(this);
- }
- }
-
- /**
- * Set the value of value.
- *
- * @param v
- * Value to assign to value.
- */
- public void setValue(Object requestor, String v) {
- if (!isExternalEntity()) {
- if (!getValue().equals(v)) {
- // then it makes sense to change the value
- ITextRegion valueRegion = getNextQuotedLiteral(iterator());
- String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (valueRegion != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(valueRegion), valueRegion.getLength(), quoteChar + v + quoteChar);
- } else {
- int startOffset = 0, length = 0;
- RegionIterator iter = iterator();
- ITextRegion region = getNextRegion(iter, DTDRegionTypes.NAME);
- if (region == null) {
- // create it after the percent if there is one
- region = getPercentRegion();
- }
- if (region == null) {
- // if still null, then create it after the element tag
- region = getStartTag(iterator());
- }
-
- if (region != null) {
- startOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
- replaceText(requestor, startOffset, 0, quoteChar + v + quoteChar);
- }
- }
- }
- }
- }
-
- /**
- * Set the value of value.
- *
- * @param v
- * Value to assign to value.
- */
- public void setValue(String v) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_ENTITY_VALUE_CHG")); //$NON-NLS-1$
- setValue(this, v);
- endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java
deleted file mode 100644
index ec9b5da5b8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java
+++ /dev/null
@@ -1,242 +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.dtd.core;
-
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-// base class for nodes that can contain external content
-public abstract class ExternalNode extends NamedTopLevelNode {
-
- String publicID;
-
- String systemID;
-
- public ExternalNode(DTDFile file, IStructuredDocumentRegion flatNode, String tagType) {
- super(file, flatNode, tagType);
- }
-
- public ITextRegion getNextQuotedLiteral(RegionIterator iter) {
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || region.getType().equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- return region;
- }
- }
- return null;
- }
-
- /**
- * Get the value of publicID.
- *
- * @return value of publicID.
- */
- public String getPublicID() {
- ITextRegion publicValue = getPublicValueRegion();
- if (publicValue != null) {
- return getValueFromQuotedRegion(publicValue);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getPublicKeywordRegion(RegionIterator iter) {
- return getNextRegion(iter, DTDRegionTypes.PUBLIC_KEYWORD);
- }
-
- public ITextRegion getPublicValueRegion() {
- RegionIterator iter = iterator();
-
- ITextRegion publicKeyword = getPublicKeywordRegion(iter);
-
- if (publicKeyword != null && iter.hasNext()) {
- ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null) {
- return quotedLiteral;
- }
- }
- return null;
- }
-
- /**
- * Get the value of systemID.
- *
- * @return value of systemID.
- */
- public String getSystemID() {
- ITextRegion systemValue = getSystemValueRegion();
- if (systemValue != null) {
- return getValueFromQuotedRegion(systemValue);
- }
- return ""; //$NON-NLS-1$
- }
-
- public ITextRegion getSystemKeywordRegion(RegionIterator iter) {
- return getNextRegion(iter, DTDRegionTypes.SYSTEM_KEYWORD);
- }
-
- public ITextRegion getSystemValueRegion() {
- RegionIterator iter = iterator();
-
- ITextRegion systemKeyword = getSystemKeywordRegion(iter);
- if (systemKeyword != null && iter.hasNext()) {
- ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null) {
- return quotedLiteral;
- }
- } else {
- // try and see if there is a second quoted literal after a public
- // keyword
- iter = iterator();
- ITextRegion publicKeyword = getPublicKeywordRegion(iter);
-
- if (publicKeyword != null && iter.hasNext()) {
- ITextRegion quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null && iter.hasNext()) {
- // now get the second quoted literal
- quotedLiteral = getNextQuotedLiteral(iter);
- if (quotedLiteral != null) {
- // got it!
- return quotedLiteral;
- }
- }
- }
- }
- return null;
- }
-
- public String getValueFromQuotedRegion(ITextRegion region) {
- String type = region.getType();
- if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- String text = getStructuredDTDDocumentRegion().getText(region);
- return text.substring(1, text.length() - 1);
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Set the value of publicID.
- *
- * @param v
- * Value to assign to publicID.
- */
- public void setPublicID(Object requestor, String v) {
- if (!v.equals(publicID)) {
- publicID = v;
- ITextRegion publicValue = getPublicValueRegion();
- ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
- ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
- ITextRegion systemValue = getSystemValueRegion();
-
- if (v.equals("")) { //$NON-NLS-1$
- if (publicKeyword != null) {
- // time to get rid of the public keyword and value
- // and replace it with the system one
- int startOffset = getStructuredDTDDocumentRegion().getStartOffset(publicKeyword);
- String newString = "SYSTEM"; //$NON-NLS-1$
- if (systemValue == null) {
- newString += " \"\""; //$NON-NLS-1$
- }
- replaceText(requestor, startOffset, getStructuredDTDDocumentRegion().getEndOffset(publicValue) - startOffset, newString);
- }
- } else {
- // here were setting a non empty value
- String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- if (publicValue != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(publicValue), publicValue.getLength(), quoteChar + publicID + quoteChar);
- } else {
- // time to create stuff
- if (publicKeyword != null) {
- // then just put our new value after the keyword
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
- } else {
- // we need the public keyword as well
- if (systemKeyword != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemKeyword), systemKeyword.getLength(), "PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
- } else {
- ITextRegion nameRegion = getNameRegion();
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
-
-
- /**
- * Set the value of publicID.
- *
- * @param v
- * Value to assign to publicID.
- */
- public void setPublicID(String v) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_EXT_NODE_PUBLIC_ID_CHG")); //$NON-NLS-1$
- setPublicID(this, v);
- endRecording(this);
- }
-
- /**
- * Set the value of systemID.
- *
- * @param v
- * Value to assign to systemID.
- */
- public void setSystemID(Object requestor, String v) {
- if (!v.equals(systemID) || (getPublicKeywordRegion(iterator()) == null && getSystemKeywordRegion(iterator()) == null)) {
- systemID = v;
- String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITextRegion systemValue = getSystemValueRegion();
- if (systemValue != null) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemValue), systemValue.getLength(), quoteChar + systemID + quoteChar);
- } else {
- ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
-
- // time to create stuff
- if (systemKeyword != null) {
- // then just put our new value after the keyword
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(systemKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
- } else {
- // see if we have a public keyword
- ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
- if (publicKeyword == null) {
- ITextRegion nameRegion = getNameRegion();
-
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " SYSTEM " + quoteChar + v + quoteChar); //$NON-NLS-1$
- } else {
- // put it after the public value region
- ITextRegion publicValueRegion = getPublicValueRegion();
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicValueRegion), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
- }
-
- }
- }
-
- }
- }
-
-
- /**
- * Set the value of systemID.
- *
- * @param v
- * Value to assign to systemID.
- */
- public void setSystemID(String v) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_EXT_NODE_SYSTEM_ID_CHG")); //$NON-NLS-1$
- setSystemID(this, v);
- endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Logger.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Logger.java
deleted file mode 100644
index f2b58c3459..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Logger.java
+++ /dev/null
@@ -1,132 +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.dtd.core;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-
-/**
- * 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 {
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- private static Plugin fPlugin = DTDPlugin.getInstance();
- private static final String fPluginId = fPlugin.getDescriptor().getUniqueIdentifier();
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * 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 (!fPlugin.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;
- }
- Status statusObj = new Status(severity, fPluginId, severity, message, exception);
- fPlugin.getLog().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 (!fPlugin.isDebugging())
- return;
-
- String traceFilter = Platform.getDebugOption(fPluginId + 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)) {
- Status statusObj = new Status(IStatus.OK, fPluginId, IStatus.OK, message, exception);
- fPlugin.getLog().log(statusObj);
- return;
- }
- }
- }
- }
-
- 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 trace(String category, String message) {
- _trace(category, message, null);
- }
-
- 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);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java
deleted file mode 100644
index 5967273597..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java
+++ /dev/null
@@ -1,134 +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.dtd.core;
-
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-// interface for nodes that can exist at the top level in a dtdfile
-// eg. entity, notation, element, comment, attlist, or unrecognized stuff (ie
-// <junk dkfjdl>
-public abstract class NamedTopLevelNode extends TopLevelNode {
-
- private String tagStartType;
-
- public NamedTopLevelNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode, String type) {
- super(dtdFile, flatNode);
- tagStartType = type;
- }
-
- public ITextRegion getNameRegion() {
- // name region is located after the whitespace (which is after
- // the elementtag
- RegionIterator iter = iterator();
- ITextRegion startTag = getNextRegion(iter, tagStartType);
-
- if (!iter.hasNext()) {
- return null;
- }
-
- ITextRegion region = iter.next();
- if (!region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- return null;
- }
-
- if (!iter.hasNext()) {
- return null;
- }
-
- region = iter.next();
- if (region.getType().equals(DTDRegionTypes.NAME)) {
- return region;
- }
-
- // we normally stop here, but for entities, we have to see if we are
- // at a '%'. if so, we skip that and find the name after the
- // whitespace again
- if (tagStartType == DTDRegionTypes.ENTITY_TAG && region.getType().equals(DTDRegionTypes.PERCENT) && iter.hasNext()) {
- region = iter.next();
-
- if (!region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- return null;
- }
-
- if (!iter.hasNext()) {
- return null;
- }
-
- region = iter.next();
- if (region.getType().equals(DTDRegionTypes.NAME)) {
- return region;
- }
- }
-
- return null;
- }
-
- public ITextRegion getStartTag(RegionIterator iter) {
- return getNextRegion(iter, tagStartType);
- }
-
- public ITextRegion getWhitespaceAfterName() {
- ITextRegion nameRegion = getNameRegion();
- RegionIterator iter = iterator();
- // skip past the element tag region
- ITextRegion elementTagRegion = getNextRegion(iter, tagStartType);
- boolean foundName = false;
- while (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (!foundName && nameRegion != null && region == nameRegion) {
- foundName = true;
- }
-
- if (region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- // there is no name region or we have already passed it
- if (nameRegion == null || foundName) {
- return region;
- }
- }
- }
- return null;
- }
-
- public void setName(Object requestor, String name) {
- ITextRegion nameRegion = getNameRegion();
- if (nameRegion != null) {
- super.setName(requestor, name);
- } else {
- RegionIterator iter = iterator();
- ITextRegion elementTagRegion = getNextRegion(iter, tagStartType);
- int replaceLength = 0;
- if (iter.hasNext()) {
- ITextRegion region = iter.next();
- if (region.getType().equals(DTDRegionTypes.WHITESPACE)) {
- if (region.getLength() >= 2) {
- // there are 2 spaces between 'ELEMENT' and the
- // content
- // Change replace length to 1 so that the new name and
- // the content are separated by a single space
- replaceLength = 1;
- }
- }
- }
-
- // beginRecording(requestor, "Name Change");
- String newText = " " + name; //$NON-NLS-1$
- replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(elementTagRegion), replaceLength, newText);
- // endRecording(requestor);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NodeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NodeList.java
deleted file mode 100644
index 863dfb78bf..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NodeList.java
+++ /dev/null
@@ -1,93 +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.dtd.core;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-
-
-public class NodeList {
- protected DTDFile dtdFile;
-
- ArrayList listNodes = new ArrayList();
-
- protected String listType;
-
- public NodeList(DTDFile dtdFile, String tokenType) {
- listType = tokenType;
- this.dtdFile = dtdFile;
- }
-
- public Image getImage() {
- if (listType == DTDRegionTypes.ELEMENT_TAG) {
- return DTDPlugin.getInstance().getImage(DTDResource.FLDR_EL);
- } else if (listType == DTDRegionTypes.ENTITY_TAG) {
- return DTDPlugin.getInstance().getImage(DTDResource.FLDR_ENT);
- } else if (listType == DTDRegionTypes.NOTATION_TAG) {
- return DTDPlugin.getInstance().getImage(DTDResource.FLDR_NOT);
- } else if (listType == DTDRegionTypes.COMMENT_START) {
- return DTDPlugin.getInstance().getImage(DTDResource.FLDR_COMM);
- } else if (listType == DTDRegionTypes.ATTLIST_TAG) {
- return DTDPlugin.getInstance().getImage(DTDResource.FLDR_ATTLIST);
- } else if (listType == DTDRegionTypes.UNKNOWN_CONTENT) {
- return DTDPlugin.getInstance().getImage(DTDResource.FLDR_UNREC);
- } else
- return null;
- }
-
- public String getListType() {
- return listType;
- }
-
- public String getName() {
- if (listType == DTDRegionTypes.ELEMENT_TAG) {
- return DTDPlugin.getDTDString("_UI_LABEL_NODE_LIST_ELEMENTS"); //$NON-NLS-1$
- } else if (listType == DTDRegionTypes.ENTITY_TAG) {
- return DTDPlugin.getDTDString("_UI_LABEL_NODE_LIST_ENTITIES"); //$NON-NLS-1$
- } else if (listType == DTDRegionTypes.NOTATION_TAG) {
- return DTDPlugin.getDTDString("_UI_LABEL_NODE_LIST_NOTATIONS"); //$NON-NLS-1$
- } else if (listType == DTDRegionTypes.COMMENT_START) {
- return DTDPlugin.getDTDString("_UI_LABEL_NODE_LIST_COMMENTS"); //$NON-NLS-1$
- } else if (listType == DTDRegionTypes.ATTLIST_TAG) {
- return DTDPlugin.getDTDString("_UI_LABEL_NODE_LIST_ATTRIBUTES"); //$NON-NLS-1$
- } else if (listType == DTDRegionTypes.UNKNOWN_CONTENT) {
- return DTDPlugin.getDTDString("_UI_LABEL_NODE_LIST_OTHER"); //$NON-NLS-1$
- }
- return ""; //$NON-NLS-1$
- }
-
- public ArrayList getNodes() {
- listNodes.clear();
- Iterator iter = dtdFile.getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (listType == DTDRegionTypes.ELEMENT_TAG && (node instanceof Element || node instanceof ParameterEntityReference)) {
- listNodes.add(node);
- } else if (listType == DTDRegionTypes.ATTLIST_TAG && node instanceof AttributeList) {
- listNodes.add(node);
- } else if (listType == DTDRegionTypes.ENTITY_TAG && node instanceof Entity) {
- listNodes.add(node);
- } else if (listType == DTDRegionTypes.NOTATION_TAG && node instanceof Notation) {
- listNodes.add(node);
- } else if (listType == DTDRegionTypes.COMMENT_START && node instanceof Comment) {
- listNodes.add(node);
- } else if (listType == DTDRegionTypes.UNKNOWN_CONTENT && node instanceof Unrecognized) {
- listNodes.add(node);
- }
- }
- return listNodes;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Notation.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Notation.java
deleted file mode 100644
index 05d75df819..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Notation.java
+++ /dev/null
@@ -1,29 +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.dtd.core;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-
-public class Notation extends ExternalNode {
-
- public Notation(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.NOTATION_TAG);
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.NOTATIONICON);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java
deleted file mode 100644
index a8b37a6dc7..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java
+++ /dev/null
@@ -1,113 +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.dtd.core;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class ParameterEntityReference extends NamedTopLevelNode {
-
-
-
- public class StartEndPair {
- public int startOffset, endOffset;
- }
-
- private Entity cachedEntity = null;
-
- public ParameterEntityReference(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode, DTDRegionTypes.COMMENT_START);
- }
-
- public Entity getEntityObject() {
- if (cachedEntity != null && !cachedEntity.getName().equals(getReferencedEntity())) {
- // if we have a cached entity, but the name doesnt match,
- // null it now, so we perform a lookup
- cachedEntity = null;
- }
-
- if (cachedEntity == null) {
- List nodes = getDTDFile().getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode node = (DTDNode) nodes.get(i);
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- if (entity.isParameterEntity() && entity.getName().equals(getReferencedEntity())) {
- cachedEntity = entity;
- }
- }
- }
- }
- return cachedEntity;
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.ENTITYREFERENCEICON);
- }
-
- public String getName() {
- return getStructuredDTDDocumentRegion().getText();
- }
-
- public String getReferencedEntity() {
- String text = getName();
- return getName().substring(1, text.length() - 1);
- }
-
- private void getStartAndEndOffsetForText(StartEndPair pair) {
- RegionIterator iter = iterator();
- ITextRegion commentStartTag = getStartTag(iter);
- ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
- pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
- if (commentStartTag != null) {
- pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
- }
- if (endCommentTag != null) {
- pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset(endCommentTag);
- }
- }
-
- public String getText() {
- String text = getStructuredDTDDocumentRegion().getText();
- int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
- }
-
- public void setReferencedEntity(Object requestor, String name) {
- replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(), getStructuredDTDDocumentRegion().getLength(), "%" + name + ";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void setReferencedEntity(String name) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_PARM_ENTITY_REF_CHG_ENTITY_REF")); //$NON-NLS-1$
- setReferencedEntity(this, name);
- endRecording(this);
- }
-
- public void setText(String newText) {
- beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG")); //$NON-NLS-1$
- int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
- StartEndPair pair = new StartEndPair();
- getStartAndEndOffsetForText(pair);
- replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
- endRecording(this);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/TopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/TopLevelNode.java
deleted file mode 100644
index 44e67b456a..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/TopLevelNode.java
+++ /dev/null
@@ -1,84 +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.dtd.core;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.wst.dtd.core.internal.text.RegionIterator;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-// interface for nodes that can exist at the top level in a dtdfile
-// eg. entity, notation, element, comment, attlist, or unrecognized stuff (ie
-// <junk dkfjdl>
-public abstract class TopLevelNode extends DTDNode {
-
- private ArrayList flatNodes = new ArrayList();
-
- public TopLevelNode(DTDFile dtdFile, IStructuredDocumentRegion flatNode) {
- super(dtdFile, flatNode);
- flatNodes.add(flatNode);
- }
-
- public void addWhitespaceStructuredDocumentRegion(IStructuredDocumentRegion node) {
- flatNodes.add(node);
- }
-
- // specialize this so we delete the objects flat node range
- // AND any whitespace
- public void delete() {
- beginRecording(getDTDFile(), DTDPlugin.getDTDString("_UI_LABEL_TOP_LEVEL_NODE_DELETE")); //$NON-NLS-1$
- IStructuredDocumentRegion first = (IStructuredDocumentRegion) flatNodes.get(0);
- IStructuredDocumentRegion last = (IStructuredDocumentRegion) flatNodes.get(flatNodes.size() - 1);
- int startOffset = first.getStartOffset();
- int endOffset = last.getEndOffset();
-
- replaceText(getDTDFile(), startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
- endRecording(getDTDFile());
- }
-
- public ITextRegion getEndRegion() {
- int size = flatNode.getRegions().size();
- if (size > 0) {
- return flatNode.getRegions().get(size - 1);
- }
- return null;
- }
-
- // includes what gettext gives us plus any whitespace
- // trailing it
- public String getFullText() {
- StringBuffer sb = new StringBuffer();
- Iterator iter = flatNodes.iterator();
- while (iter.hasNext()) {
- IStructuredDocumentRegion fNode = (IStructuredDocumentRegion) iter.next();
- sb.append(fNode.getText());
- }
- return sb.toString();
- }
-
- public ITextRegion getStartRegion() {
- if (flatNode.getRegions().size() > 0) {
- return flatNode.getRegions().get(0);
- }
- return null;
- }
-
- public RegionIterator iterator() {
- // System.out.println("create region iter " + this.getClass() + " with
- // start , end = " + getStartOffset() + ", " +getEndOffset());
- return new RegionIterator(flatNode, getStartOffset(), getEndOffset());
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java
deleted file mode 100644
index bf9aa3647b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.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.dtd.core;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-
-public class Unrecognized extends TopLevelNode {
-
- public Unrecognized(DTDFile file, IStructuredDocumentRegion flatNode) {
- super(file, flatNode);
- }
-
- public Image getImage() {
- return DTDPlugin.getInstance().getImage(DTDResource.UNRECOGNIZEDICON);
- }
-
- public String getName() {
- String text = getStructuredDTDDocumentRegion().getText();
- if (text.length() <= 30) {
- return text;
- } else {
- return text.substring(0, 29) + "..."; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/builder/delegates/DTDTaskTagSeeker.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/builder/delegates/DTDTaskTagSeeker.java
deleted file mode 100644
index 558534cb9e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/builder/delegates/DTDTaskTagSeeker.java
+++ /dev/null
@@ -1,25 +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.dtd.core.builder.delegates;
-
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.participants.TaskTagSeeker;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class DTDTaskTagSeeker extends TaskTagSeeker {
- protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
- return textRegion.getType().equals(DTDRegionTypes.COMMENT_CONTENT);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/content/ContentDescriberForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/content/ContentDescriberForDTD.java
deleted file mode 100644
index fa4c73197f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/content/ContentDescriberForDTD.java
+++ /dev/null
@@ -1,30 +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.dtd.core.content;
-
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.common.encoding.AbstractContentDescriber;
-import org.eclipse.wst.common.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.xml.core.contenttype.XMLResourceEncodingDetector;
-
-
-
-
-public class ContentDescriberForDTD extends AbstractContentDescriber implements ITextContentDescriber {
-
- // same rules as for XML
- protected IResourceCharsetDetector getDetector() {
- return new XMLResourceEncodingDetector();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModel.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModel.java
deleted file mode 100644
index b04cf2ca70..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModel.java
+++ /dev/null
@@ -1,29 +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
- *
- *******************************************************************************/
-/*
- * Created on 28-Aug-03
- *
- * 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.wst.dtd.core.document;
-
-/**
- * @author kboo
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public interface DTDModel {
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModelImpl.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModelImpl.java
deleted file mode 100644
index 9c066346de..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/document/DTDModelImpl.java
+++ /dev/null
@@ -1,273 +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.dtd.core.document;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Entity;
-import org.eclipse.wst.dtd.core.NodeList;
-import org.eclipse.wst.dtd.core.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.event.NodesEvent;
-import org.eclipse.wst.dtd.core.util.DTDReferenceUpdater;
-import org.eclipse.wst.dtd.core.util.LabelValuePair;
-import org.eclipse.wst.sse.core.AbstractStructuredModel;
-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.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-
-public final class DTDModelImpl extends AbstractStructuredModel implements IStructuredDocumentListener, DTDModel {
-
- public static boolean deleteFile(String fileName) {
- boolean result = false;
-
- // create the temp File object
- File file = new File(fileName);
- if (file.exists())
- result = file.delete();
- return result;
- }
-
- private DTDFile document;
-
- //private List errorMessages = new ArrayList();
-
- // entity reference names found in the conditional IGNORE sections
- private Vector ignoredEntityRefs;
-
- private boolean refreshRequired = false;
-
- protected DTDReferenceUpdater refUpdater = new DTDReferenceUpdater();
-
- public DTDModelImpl() {
- super();
- document = new DTDFile(this);
- document.addDTDFileListener(new IDTDFileListener() {
-
- public void nodeChanged(DTDNode node) {
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- if (entity.isParameterEntity() && entity.isExternalEntity()) {
- // just say they have changed for now
- setReferencedModelsChanged();
- }
- }
- }
-
- public void nodesAdded(NodesEvent event) {
- checkIfExternalReferencesChanged(event);
- }
-
- public void nodesRemoved(NodesEvent event) {
- checkIfExternalReferencesChanged(event);
- }
- });
- }
-
- public void beginRecording(Object requester, String label) {
- super.beginRecording(requester, label);
- // clear reference updater cache
- getReferenceUpdater().clearCache();
- }
-
- private void checkIfExternalReferencesChanged(NodesEvent event) {
- Iterator iter = event.getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- if (entity.isParameterEntity() && entity.isExternalEntity()) {
- // just say they have changed for now
- setReferencedModelsChanged();
- }
- }
- }
- }
-
- //
- // The following function helps determine the list of things that
- // can be used in a parameter entity reference content
- // Optional parameter is to allow the currently used DTDEntity to
- // be included in the combobox.
- //
- public LabelValuePair[] createParmEntityContentItems(Entity entity) {
- NodeList entities = getDTDFile().getEntities();
-
- Vector items = new Vector();
-
- if (entity != null) {
- String name = "%" + entity.getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- items.addElement(new LabelValuePair(name, name));
- }
-
- for (Iterator i = entities.getNodes().iterator(); i.hasNext();) {
- Entity entityAt = (Entity) i.next();
- if (entityAt.isParameterEntity() && entityAt.isExternalEntity()) {
- String name = "%" + entityAt.getName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- items.addElement(new LabelValuePair(name, name));
- }
- }
- LabelValuePair[] comboArray = new LabelValuePair[items.size()];
- items.copyInto(comboArray);
- return comboArray;
- }
-
- public void endRecording(Object requester) {
- super.endRecording(requester);
- // clear reference updater cache
- getReferenceUpdater().clearCache();
- }
-
-
- public DTDFile getDTDFile() {
- return document;
- }
-
- // Returns entity reference names that are in
- // the conditional IGNORE sections.
- public Vector getIgnoredEntityRefs() {
- if (ignoredEntityRefs == null)
- ignoredEntityRefs = new Vector();
- return ignoredEntityRefs;
- }
-
- public IndexedRegion getIndexedRegion(int offset) {
- if (this.document == null)
- return null;
- // System.out.println("getNode at " + offset + " returning = " +
- // this.document.getNodeAt(offset));
-
- return this.document.getNodeAt(offset);
- }
-
- public DTDReferenceUpdater getReferenceUpdater() {
- return refUpdater;
- }
-
- public boolean isReferencedModelsChanged() {
- return refreshRequired;
- }
-
- public boolean isRefreshRequired() {
- return refreshRequired;
- }
-
- public void newModel(NewDocumentEvent flatModelEvent) {
- document.newModel(flatModelEvent);
- // System.out.println("\nnewmodel");
- outputStructuredDocument(flatModelEvent);
- }
-
- public void noChange(NoChangeEvent flatModelEvent) {
- // System.out.println("\nnochange");
- outputStructuredDocument(flatModelEvent);
-
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent flatModelEvent) {
- // System.out.println("\nnodesreplaced");
- document.nodesReplaced(flatModelEvent);
- outputStructuredDocument(flatModelEvent);
-
- }
-
- public void outputStructuredDocument(StructuredDocumentEvent flatModelEvent) {
- // System.out.println("structuredDocument source = '" +
- // flatModelEvent.getStructuredDocument().getText() + "'");
- // System.out.println("new String = '" +
- // flatModelEvent.getOriginalChanges() +"'");
- // System.out.println("deleted String = '" +
- // flatModelEvent.getDeletedText() +"'");
- // Enumeration e =
- // flatModelEvent.getStructuredDocument().getNodes().elements();
- // int i = 0;
- // for (; e.hasMoreElements(); i++)
- // {
- // BasicStructuredDocumentRegion node =
- // (BasicStructuredDocumentRegion) e.nextElement();
- // outputStructuredDocumentRegion(node);
- // System.out.println(" " + i +". " + node.hashCode() + " '"
- // +node.getText() + "'");
- // }
- }
-
- public void outputStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- // int size = flatNode.getNumberOfRegions();
- // for (int i = 0; i < size; i++)
- // {
- // Region region = (Region) flatNode.getRegions().get(i);
- // System.out.println(i + ". " + region.getType());
-
- // } // end of for ()
-
- }
-
- public void regionChanged(RegionChangedEvent flatModelEvent) {
- // System.out.println("\nregion changed");
- document.regionChanged(flatModelEvent);
- // System.out.println("= " +
- // flatModelEvent.getStructuredDocumentRegion().getText());
- // System.out.println("region changed " +
- // flatModelEvent.getRegion().hashCode() + " = " +
- // flatModelEvent.getRegion());
-
- outputStructuredDocument(flatModelEvent);
- }
-
- public void regionsReplaced(RegionsReplacedEvent flatModelEvent) {
- // System.out.println("\nregion replaced");
- document.regionsReplaced(flatModelEvent);
- outputStructuredDocument(flatModelEvent);
- }
-
- public void setReferencedModelsChanged() {
- refreshRequired = true;
- }
-
- public void setRefreshRequired(boolean value) {
- refreshRequired = value;
- }
-
-
- /**
- * @param newStructuredDocument
- * org.eclipse.wst.sse.core.text.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);
- document.setStructuredDocument(newStructuredDocument);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentCharsetDetector.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentCharsetDetector.java
deleted file mode 100644
index 9cd2207f75..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentCharsetDetector.java
+++ /dev/null
@@ -1,61 +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
- *
- *******************************************************************************/
-/*
- * Created on 28-Aug-03
- *
- * 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.wst.dtd.core.encoding;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.common.encoding.AbstractResourceEncodingDetector;
-import org.eclipse.wst.sse.core.document.DocumentReader;
-import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector;
-import org.eclipse.wst.xml.core.encoding.XMLDocumentCharsetDetector;
-
-
-/**
- * @author kboo
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public final class DTDDocumentCharsetDetector extends AbstractResourceEncodingDetector implements IDocumentCharsetDetector {
-
- public String getSpecDefaultEncoding() {
- // by default, UTF-8 as per XML spec
- final String enc = "UTF-8"; //$NON-NLS-1$
- return enc;
- }
-
- /**
- *
- */
-
- protected void parseInput() throws IOException {
- IDocumentCharsetDetector documentEncodingDetector = new XMLDocumentCharsetDetector();
- documentEncodingDetector.set(fReader);
- fEncodingMemento = documentEncodingDetector.getEncodingMemento();
-
- }
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
-
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentLoader.java
deleted file mode 100644
index 6767d396f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/encoding/DTDDocumentLoader.java
+++ /dev/null
@@ -1,64 +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.dtd.core.encoding;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentReParser;
-import org.eclipse.wst.dtd.core.parser.DTDRegionParser;
-import org.eclipse.wst.dtd.core.rules.StructuredTextPartitionerForDTD;
-import org.eclipse.wst.sse.core.document.AbstractDocumentLoader;
-import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-
-
-public final class DTDDocumentLoader extends AbstractDocumentLoader {
-
- public DTDDocumentLoader() {
- super();
- }
-
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForDTD();
- }
-
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new DTDDocumentCharsetDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- public RegionParser getParser() {
- return new DTDRegionParser();
- }
-
- protected String getSpecDefaultEncoding() {
- String enc = "UTF-8"; //$NON-NLS-1$
- return enc;
- }
-
- protected IEncodedDocument newEncodedDocument() {
- IStructuredDocument document = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- DTDStructuredDocumentReParser reParser = new DTDStructuredDocumentReParser();
- reParser.setStructuredDocument(document);
- if (document instanceof BasicStructuredDocument) {
- ((BasicStructuredDocument) document).setReParser(reParser);
- }
- return document;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/IDTDFileListener.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/IDTDFileListener.java
deleted file mode 100644
index 235b60af6f..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/IDTDFileListener.java
+++ /dev/null
@@ -1,24 +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.dtd.core.event;
-
-import org.eclipse.wst.dtd.core.DTDNode;
-
-public interface IDTDFileListener {
-
- public void nodeChanged(DTDNode node);
-
- public void nodesAdded(NodesEvent event);
-
- public void nodesRemoved(NodesEvent event);
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/NodesEvent.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/NodesEvent.java
deleted file mode 100644
index ceaca1fce8..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/event/NodesEvent.java
+++ /dev/null
@@ -1,32 +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.dtd.core.event;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.DTDNode;
-
-
-public final class NodesEvent {
- private ArrayList changedNodes = new ArrayList();
-
- public void add(DTDNode changedNode) {
- changedNodes.add(changedNode);
- }
-
- public List getNodes() {
- return changedNodes;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java
deleted file mode 100644
index b4d24ea328..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.internal.text;
-
-import org.eclipse.wst.sse.core.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredTextReParser;
-
-
-public class DTDStructuredDocumentReParser extends StructuredDocumentReParser {
-
- public StructuredDocumentEvent checkForCrossStructuredDocumentRegionBoundryCases() {
- IStructuredDocumentRegion startNode = fStructuredDocument.getRegionAtCharacterOffset(fStart);
- IStructuredDocumentRegion endNode = fStructuredDocument.getRegionAtCharacterOffset(fStart + fLengthToReplace - 1);
- return reparse(startNode.getStart(), endNode.getEnd());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser#newInstance()
- */
- public IStructuredTextReParser newInstance() {
- return new DTDStructuredDocumentReParser();
- }
-
- protected StructuredDocumentEvent reparse(IStructuredDocumentRegion dirtyStart, IStructuredDocumentRegion dirtyEnd) {
- return super.reparse(dirtyStart, dirtyEnd);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java
deleted file mode 100644
index 816ffac5ea..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,33 +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.dtd.core.internal.text;
-
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-
-public class DTDStructuredDocumentRegionFactory {
- public static final int DTD_GENERIC = 5;
-
- public static IStructuredDocumentRegion createStructuredDocumentRegion(int type) {
- IStructuredDocumentRegion instance = null;
- switch (type) {
- case DTD_GENERIC :
- instance = new BasicStructuredDocumentRegion();
- break;
- default :
- break;
- }
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java
deleted file mode 100644
index c363a21589..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java
+++ /dev/null
@@ -1,84 +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.dtd.core.internal.text;
-
-import java.util.NoSuchElementException;
-
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.ITextRegionList;
-
-
-public class RegionIterator {
-
- private int currentIndex;
-
- //private IStructuredDocumentRegion flatNode;
- private ITextRegionList regions;
- //private int startOffset, endOffset;
- private ITextRegion startRegion, endRegion;
-
- public RegionIterator(IStructuredDocumentRegion node) {
- this(node, node.getStart(), node.getEnd());
- }
-
- public RegionIterator(IStructuredDocumentRegion node, int startOffset, int endOffset) {
- regions = node.getRegions();
- startRegion = node.getRegionAtCharacterOffset(startOffset);
- endRegion = node.getRegionAtCharacterOffset(endOffset - 1);
-
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (startRegion == region) {
- currentIndex = i;
- break;
- }
- }
- }
-
- public RegionIterator(ITextRegionList regions) {
- this.regions = regions;
- startRegion = regions.get(0);
- endRegion = regions.get(regions.size() - 1);
- currentIndex = 0;
- // this(node, node.getStart(), node.getEnd());
- }
-
- public boolean hasNext() {
- if (currentIndex < regions.size()) {
- return currentIndex <= regions.indexOf(endRegion);
- }
- return false;
- }
-
- public boolean hasPrevious() {
- if (currentIndex >= 0) {
- return currentIndex >= regions.indexOf(startRegion);
- }
- return false;
- }
-
- public ITextRegion next() {
- if (hasNext()) {
- return regions.get(currentIndex++);
- }
- throw new NoSuchElementException();
- }
-
- public ITextRegion previous() {
- if (hasPrevious()) {
- return regions.get(--currentIndex);
- }
- throw new NoSuchElementException();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelDumper.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelDumper.java
deleted file mode 100644
index abdf741b05..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelDumper.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.modelhandler;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.ModelDumper;
-
-
-public final class DTDModelDumper implements ModelDumper {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.ModelDumper#dump(org.eclipse.wst.sse.core.IStructuredModel,
- * java.io.OutputStream, org.eclipse.wst.common.encoding.EncodingRule,
- * org.eclipse.core.resources.IFile)
- */
- public void dump(IStructuredModel model, OutputStream outputStream, EncodingRule encodingRule, IFile iFile) throws UnsupportedEncodingException, IOException, CoreException {
- // TODO Auto-generated method stub
- System.out.println("Implement DTDModelDumper.dump()"); //$NON-NLS-1$
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelLoader.java
deleted file mode 100644
index 896c24de43..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/DTDModelLoader.java
+++ /dev/null
@@ -1,47 +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.dtd.core.modelhandler;
-
-import org.eclipse.wst.dtd.core.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.encoding.DTDDocumentLoader;
-import org.eclipse.wst.sse.core.AbstractModelLoader;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.ModelLoader;
-import org.eclipse.wst.sse.core.document.IDocumentLoader;
-
-
-
-public final class DTDModelLoader extends AbstractModelLoader {
- public DTDModelLoader() {
- super();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new DTDDocumentLoader();
- }
- return documentLoaderInstance;
- }
-
- public ModelLoader newInstance() {
- return new DTDModelLoader();
- }
-
- public IStructuredModel newModel() {
- IStructuredModel model = new DTDModelImpl();
- // now done in create
- //model.setStructuredDocument(createNewStructuredDocument());
- //model.setFactoryRegistry(defaultFactoryRegistry());
- return model;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/ModelHandlerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/ModelHandlerForDTD.java
deleted file mode 100644
index b1f4dc1ac0..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/modelhandler/ModelHandlerForDTD.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.core.modelhandler;
-
-import org.eclipse.wst.dtd.core.encoding.DTDDocumentCharsetDetector;
-import org.eclipse.wst.dtd.core.encoding.DTDDocumentLoader;
-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.modelhandler.IModelHandler;
-
-
-public final class ModelHandlerForDTD extends AbstractModelHandler implements IModelHandler {
- private static String AssociatedContentTypeId = "org.eclipse.wst.dtd.core.dtdsource"; //$NON-NLS-1$
- private static String ModelHandlerID = "org.eclipse.wst.dtd.core.modelhandler"; //$NON-NLS-1$
-
- public ModelHandlerForDTD() {
- super();
- setId(ModelHandlerID);
- setAssociatedContentTypeId(AssociatedContentTypeId);
- }
-
- public IDocumentLoader getDocumentLoader() {
- return new DTDDocumentLoader();
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new DTDDocumentCharsetDetector();
- }
-
- public ModelLoader getModelLoader() {
- return new DTDModelLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegion.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegion.java
deleted file mode 100644
index 69efada651..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegion.java
+++ /dev/null
@@ -1,32 +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.dtd.core.parser;
-
-import org.eclipse.wst.sse.core.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-
-
-
-public class DTDRegion extends ContextRegion {
-
-
- public DTDRegion(String newContext, int newStart, int newLength) {
- super(newContext, newStart, newLength, newLength);
- }
-
-
- public StructuredDocumentEvent updateModel(Object requester, IStructuredDocumentRegion flatnode, String changes, int requestStart, int requestLength) {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionFactory.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionFactory.java
deleted file mode 100644
index fbcdef4de5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionFactory.java
+++ /dev/null
@@ -1,26 +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.dtd.core.parser;
-
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-public class DTDRegionFactory implements DTDRegionTypes {
- public static ITextRegion createRegion(String tokenKind, int start, int length) {
- ITextRegion region = null;
- if (tokenKind != null) {
- region = new DTDRegion(tokenKind, start, length);
- }
- return region;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionParser.java
deleted file mode 100644
index c6a2b993b5..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionParser.java
+++ /dev/null
@@ -1,262 +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.dtd.core.parser;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentRegionFactory;
-import org.eclipse.wst.dtd.core.tokenizer.DTDTokenizer;
-import org.eclipse.wst.dtd.core.tokenizer.Token;
-import org.eclipse.wst.sse.core.parser.RegionParser;
-import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-
-
-public class DTDRegionParser implements RegionParser {
- private Vector cachedRegions = null;
- private DTDTokenizer tokenizer = null;
- private IStructuredDocumentRegion cachedNode = null; // top of node chain
-
- public RegionParser newInstance() {
- return new DTDRegionParser();
- }
-
- private IStructuredDocumentRegion addNewNodes(IStructuredDocumentRegion lastNode, Vector regions) {
- IStructuredDocumentRegion leadingSpaceNode = null;
- IStructuredDocumentRegion contentNode = null;
- IStructuredDocumentRegion trailingSpaceNode = null;
- LinkedList nodeSeeds = new LinkedList();
- int nRegions = regions.size();
- int leadingSpaceEnd = -1;
- int trailingSpaceBegin = nRegions;
-
- // find leading space
- nodeSeeds.clear();
- for (int i = 0; i < nRegions; i++) {
- ITextRegion region = (ITextRegion) regions.get(i);
- String type = region.getType();
- if (isBlankRegion(type)) {
- leadingSpaceEnd = i;
- nodeSeeds.addLast(region);
- } else {
- break;
- }
- }
- if (!nodeSeeds.isEmpty()) {
- leadingSpaceNode = createNode(nodeSeeds);
- if (lastNode != null) {
- lastNode.setNext(leadingSpaceNode);
- leadingSpaceNode.setPrevious(lastNode);
- }
- lastNode = leadingSpaceNode;
- }
-
- // find trailing space
- if (leadingSpaceEnd < nRegions - 1) {
- nodeSeeds.clear();
- for (int i = nRegions - 1; 0 <= i; i--) {
- ITextRegion region = (ITextRegion) regions.get(i);
- String type = ((ITextRegion) regions.get(i)).getType();
- if (isBlankRegion(type)) {
- trailingSpaceBegin = i;
- nodeSeeds.addFirst(region);
- } else {
- break;
- }
- }
- if (!nodeSeeds.isEmpty()) {
- trailingSpaceNode = createNode(nodeSeeds);
- }
-
- nodeSeeds.clear();
- for (int i = leadingSpaceEnd + 1; i < trailingSpaceBegin; i++) {
- nodeSeeds.addLast(regions.get(i));
- }
- if (!nodeSeeds.isEmpty()) {
- contentNode = createNode(nodeSeeds);
- if (lastNode != null) {
- lastNode.setNext(contentNode);
- contentNode.setPrevious(lastNode);
- }
- lastNode = contentNode;
- }
- if (trailingSpaceNode != null) {
- lastNode.setNext(trailingSpaceNode);
- trailingSpaceNode.setPrevious(lastNode);
- lastNode = trailingSpaceNode;
- }
- }
-
- return lastNode;
- }
-
- private IStructuredDocumentRegion createNode(LinkedList regions) {
- if (regions.size() == 0) {
- return null;
- }
-
- IStructuredDocumentRegion node = DTDStructuredDocumentRegionFactory.createStructuredDocumentRegion(DTDStructuredDocumentRegionFactory.DTD_GENERIC);
- int start = ((ITextRegion) regions.getFirst()).getStart();
- int length = ((ITextRegion) regions.getLast()).getEnd() - start;
- node.setStart(start);
- node.setLength(length);
- for (ListIterator i = regions.listIterator(0); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- node.addRegion(region);
- region.adjustStart(-start);
- }
- node.setEnded(true);
-
- return node;
- }
-
- private IStructuredDocumentRegion createNodeChain(List regions) {
- IStructuredDocumentRegion headNode = null;
- IStructuredDocumentRegion lastNode = null;
- Vector nodeSeeds = new Vector();
-
- for (Iterator e = regions.iterator(); e.hasNext();) {
- ITextRegion region = (ITextRegion) e.next();
- String type = region.getType();
- // If the following regions appear,
- // a previous node is closed in front of it.
- if (!nodeSeeds.isEmpty() && isBeginningRegion(type)) {
- lastNode = addNewNodes(lastNode, nodeSeeds);
- nodeSeeds.clear();
- }
- nodeSeeds.addElement(region);
-
- // The following regions close the current node.
- if (!nodeSeeds.isEmpty() && isEndingRegion(type)) {
- lastNode = addNewNodes(lastNode, nodeSeeds);
- nodeSeeds.clear();
- }
-
- if (headNode == null && lastNode != null) {
- headNode = findFirstNode(lastNode);
- }
- }
-
- // close current node forcibly.
- if (!nodeSeeds.isEmpty()) {
- lastNode = addNewNodes(lastNode, nodeSeeds);
- if (headNode == null && lastNode != null) {
- headNode = findFirstNode(lastNode);
- }
- }
- return headNode;
- }
-
- private IStructuredDocumentRegion findFirstNode(IStructuredDocumentRegion node) {
- IStructuredDocumentRegion firstNode = node;
- IStructuredDocumentRegion prevNode = null;
- while ((prevNode = firstNode.getPrevious()) != null) {
- firstNode = prevNode;
- }
- return firstNode;
- }
-
- public IStructuredDocumentRegion getDocumentRegions() {
- if (cachedNode != null) {
- return cachedNode;
- }
-
- List regions = getRegions();
- IStructuredDocumentRegion headNode = createNodeChain(regions);
- cachedNode = headNode;
-
- return headNode;
- }
-
- public List getRegions() {
- if (cachedRegions != null) {
- return cachedRegions;
- }
-
- Vector regions = new Vector();
- Token currentToken = null;
- do {
- try {
- currentToken = (Token) tokenizer.yylex();
- if (currentToken != null) {
- ITextRegion region = DTDRegionFactory.createRegion(currentToken.getType(), currentToken.getStartOffset(), currentToken.getLength());
- regions.add(region);
- }
- } catch (java.io.FileNotFoundException e) {
- System.out.println("File not found"); //$NON-NLS-1$
- } catch (java.io.IOException e) {
- System.out.println("Error opening file"); //$NON-NLS-1$
- }
- } while (currentToken != null);
-
- cachedRegions = regions;
- return regions;
- }
-
- public void reset(Reader reader) {
- if (tokenizer == null) {
- try {
- tokenizer = new DTDTokenizer(reader);
- } catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java DTDTokenizer <inputfile>"); //$NON-NLS-1$
- }
- } else {
- try {
- tokenizer.yyreset(reader);
- } catch (java.io.IOException e) {
- System.out.println("Error opening file"); //$NON-NLS-1$
- }
- }
-
- cachedNode = null;
- cachedRegions = null;
- }
-
- /**
- * An additional offset for use with any position-dependant parsing rules
- */
- public void reset(Reader reader, int offset) {
- reset(reader);
- }
-
- public void reset(String input) {
- reset(new StringReader(input));
- }
-
- public void reset(String input, int offset) {
- reset(input);
- }
-
- // never used
- DTDTokenizer getTokenizer() {
- return tokenizer;
- }
-
- private boolean isBeginningRegion(String type) {
- return (type == DTDRegionTypes.START_TAG) || (type == DTDRegionTypes.ENTITY_PARM);
- }
-
- private boolean isBlankRegion(String type) {
- return (type == DTDRegionTypes.WHITESPACE);
- }
-
- private boolean isEndingRegion(String type) {
- return (type == DTDRegionTypes.END_TAG) || (type == DTDRegionTypes.ENTITY_PARM) || (type == DTDRegionTypes.COMMENT_END);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionTypes.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionTypes.java
deleted file mode 100644
index f65e56b97d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/parser/DTDRegionTypes.java
+++ /dev/null
@@ -1,76 +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.dtd.core.parser;
-
-public interface DTDRegionTypes {
- public static final String regionPrefix = "org.eclipse.wst.dtd.core.util.parser.DTDRegionTypes."; //$NON-NLS-1$
-
- public static final String NAME = regionPrefix + "NAME"; //$NON-NLS-1$
- public static final String START_TAG = regionPrefix + "START_TAG"; //$NON-NLS-1$
- public static final String END_TAG = regionPrefix + "END_TAG"; //$NON-NLS-1$
- public static final String LEFT_PAREN = regionPrefix + "LEFT_PAREN"; //$NON-NLS-1$
- public static final String RIGHT_PAREN = regionPrefix + "RIGHT_PAREN"; //$NON-NLS-1$
- public static final String WHITESPACE = regionPrefix + "WHITESPACE"; //$NON-NLS-1$
- public static final String CONNECTOR = regionPrefix + "CONNECTOR"; //$NON-NLS-1$
-
- public static final String OCCUR_TYPE = regionPrefix + "OCCUR_TYPE"; //$NON-NLS-1$
- public static final String EXCLAMATION = regionPrefix + "EXCLAMATION"; //$NON-NLS-1$
- public static final String PERCENT = regionPrefix + "PERCENT"; //$NON-NLS-1$
- public static final String SEMICOLON = regionPrefix + "SEMICOLON"; //$NON-NLS-1$
- public static final String COMMENT_START = regionPrefix + "COMMENT"; //$NON-NLS-1$
- public static final String COMMENT_CONTENT = regionPrefix + "COMMENT_CONTENT"; //$NON-NLS-1$
- public static final String COMMENT_END = regionPrefix + "COMMENT_END"; //$NON-NLS-1$
-
- public static final String NOTATION_TAG = regionPrefix + "NOTATION_TAG"; //$NON-NLS-1$
- public static final String NOTATION_CONTENT = regionPrefix + "NOTATION_CONTENT"; //$NON-NLS-1$
-
- public static final String ENTITY_TAG = regionPrefix + "ENTITY_TAG"; //$NON-NLS-1$
- public static final String ENTITY_PARM = regionPrefix + "ENTITY_PARM"; //$NON-NLS-1$
- public static final String ENTITY_CONTENT = regionPrefix + "ENTITY_CONTENT"; //$NON-NLS-1$
- public static final String NDATA_VALUE = regionPrefix + "NDATA_VALUE"; //$NON-NLS-1$
-
- public static final String ELEMENT_TAG = regionPrefix + "ELEMENT_TAG"; //$NON-NLS-1$
- public static final String ELEMENT_CONTENT = regionPrefix + "ELEMENT_CONTENT"; //$NON-NLS-1$
- public static final String CONTENT_EMPTY = regionPrefix + "CONTENT_EMPTY"; //$NON-NLS-1$
- public static final String CONTENT_ANY = regionPrefix + "CONTENT_ANY"; //$NON-NLS-1$
- public static final String CONTENT_PCDATA = regionPrefix + "CONTENT_PCDATA"; //$NON-NLS-1$
-
- public static final String ATTLIST_TAG = regionPrefix + "ATTLIST_TAG"; //$NON-NLS-1$
-
- public static final String SYSTEM_KEYWORD = regionPrefix + "SYSTEM_KEYWORD"; //$NON-NLS-1$
- public static final String PUBLIC_KEYWORD = regionPrefix + "PUBLIC_KEYWORD"; //$NON-NLS-1$
- public static final String NDATA_KEYWORD = regionPrefix + "NDATA_KEYWORD"; //$NON-NLS-1$
- public static final String SINGLEQUOTED_LITERAL = regionPrefix + "SINGLEQUOTED_LITERAL"; //$NON-NLS-1$
- public static final String DOUBLEQUOTED_LITERAL = regionPrefix + "DOUBLEQUOTED_LITERAL"; //$NON-NLS-1$
- public static final String UNKNOWN_CONTENT = regionPrefix + "UNKNOWN_CONTENT"; //$NON-NLS-1$
-
- public static final String ATTRIBUTE_NAME = regionPrefix + "ATTRIBUTE_NAME"; //$NON-NLS-1$
-
- // attribute type keywords
- public static final String CDATA_KEYWORD = regionPrefix + "CDATA_KEYWORD"; //$NON-NLS-1$
- public static final String ID_KEYWORD = regionPrefix + "ID_KEYWORD"; //$NON-NLS-1$
- public static final String IDREF_KEYWORD = regionPrefix + "IDREF_KEYWORD"; //$NON-NLS-1$
- public static final String IDREFS_KEYWORD = regionPrefix + "IDREFS_KEYWORD"; //$NON-NLS-1$
- public static final String ENTITY_KEYWORD = regionPrefix + "ENTITY_KEYWORD"; //$NON-NLS-1$
- public static final String ENTITIES_KEYWORD = regionPrefix + "ENTITIES_KEYWORD"; //$NON-NLS-1$
- public static final String NMTOKEN_KEYWORD = regionPrefix + "NMTOKEN_KEYWORD"; //$NON-NLS-1$
- public static final String NMTOKENS_KEYWORD = regionPrefix + "NMTOKENS_KEYWORD"; //$NON-NLS-1$
- public static final String NOTATION_KEYWORD = regionPrefix + "NOTATION_KEYWORD"; //$NON-NLS-1$
- public static final String ENUM_CHOICE = regionPrefix + "ENUM_CHOICE"; //$NON-NLS-1$
- public static final String PARM_ENTITY_TYPE = regionPrefix + "PARM_ENTITY_TYPE"; //$NON-NLS-1$
-
- // attribute defaults keywords
- public static final String REQUIRED_KEYWORD = regionPrefix + "REQUIRED_KEYWORD"; //$NON-NLS-1$
- public static final String IMPLIED_KEYWORD = regionPrefix + "IMPLIED_KEYWORD"; //$NON-NLS-1$
- public static final String FIXED_KEYWORD = regionPrefix + "FIXED_KEYWORD"; //$NON-NLS-1$
-}// DTDRegionTypes
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/rules/StructuredTextPartitionerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/rules/StructuredTextPartitionerForDTD.java
deleted file mode 100644
index 725b371d78..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/rules/StructuredTextPartitionerForDTD.java
+++ /dev/null
@@ -1,42 +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.dtd.core.rules;
-
-import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
-
-public class StructuredTextPartitionerForDTD extends StructuredTextPartitioner {
-
- public static final String ST_DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$
-
- public StructuredTextPartitionerForDTD() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#getDefault()
- */
- public String getDefault() {
- return ST_DTD_DEFAULT;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#initLegalContentTypes()
- */
- protected void initLegalContentTypes() {
- fSupportedTypes = new String[]{ST_DTD_DEFAULT, ST_UNKNOWN_PARTITION};
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/DTDTokenizer.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/DTDTokenizer.java
deleted file mode 100644
index ad01b20412..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/DTDTokenizer.java
+++ /dev/null
@@ -1,1428 +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.dtd.core.tokenizer;
-
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-
-
-
-/**
- * This class is a scanner generated by <a href="http://www.jflex.de/">JFlex
- * </a> 1.3.5 on 05/04/02 11:38 AM from the specification file
- * <tt>dtd.flex</tt>
- */
-public class DTDTokenizer {
-
- /** This character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
- final private static int YY_BUFFERSIZE = 16384;
- final static String yy_NL = System.getProperty("line.separator");
-
- /** lexical states */
- final public static int ATTRIBUTE_ENUMERATION = 13;
- final public static int NOTATION_NAME = 6;
- final public static int ELEMENT_CHILD = 1;
- final public static int ENTITY_CONTENT = 4;
- final public static int COMMENT_CONTENT = 8;
- final public static int ATTLIST_NAME = 9;
- final public static int EXTERNALID_CONTENT = 7;
- final public static int ELEMENT_CONTENT = 1;
- final public static int ELEMENT_MIXED = 1;
- final public static int ELEMENT_MIXED_OR_CHILD = 1;
- final public static int ATTRIBUTE_CONTENT = 11;
- final public static int ENTITY_NAME = 3;
- final public static int ATTRIBUTE_DEFAULT = 12;
- final public static int ELEMENT_NAME = 2;
- final public static int YYINITIAL = 0;
- final public static int NDATA_CONTENT = 5;
- final public static int ATTLIST_CONTENT = 10;
- final public static int NODE = 1;
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed = "\10\0\1\0\1\5\1\3\1\0\1\0\1\2\22\0\1\5\1\6" + "\1\1\1\37\1\0\1\23\1\0\1\46\1\42\1\43\1\4\1\7" + "\1\45\1\12\1\0\1\0\12\0\1\0\1\10\1\11\1\0\1\13" + "\1\4\1\0\1\25\1\31\1\32\1\33\1\14\1\35\2\0\1\21" + "\1\0\1\36\1\15\1\16\1\17\1\24\1\27\1\40\1\34\1\26" + "\1\20\1\30\2\0\1\41\1\22\1\0\1\0\1\0\2\0\1\0" + "\1\0\32\0\1\0\1\44\uff83\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, 39, 78, 117, 156, 195, 234, 273, 312, 351, 390, 429, 468, 507, 546, 585, 624, 39, 39, 39, 663, 702, 741, 780, 819, 39, 39, 858, 897, 39, 39, 936, 936, 975, 1014, 1053, 1092, 1131, 1170, 1209, 1248, 1287, 1326, 1365, 1404, 1443, 39, 1482, 1521, 1560, 1599, 1638, 39, 1677, 1716, 1755, 1794, 1833, 1872, 39, 39, 1911, 1950, 1989, 2028, 2067, 2106, 39, 39, 39, 2145, 2184, 2223, 2262, 2301, 2340, 2379, 897, 2418, 975, 2457, 2496, 2535, 2574, 975, 2613, 2652, 2691, 2730, 1560, 2769, 2808, 2847, 2886, 2925, 2964, 3003, 3042, 3081, 3120, 1950, 3159, 3198, 3237, 3276, 3315, 1950, 39, 3354, 3393, 3432, 39, 3471, 3510, 3549, 39, 3588, 3627, 39, 3666, 3705, 3744, 39, 39, 3783, 3822, 3861, 3900, 3939, 3978, 4017, 4056, 39, 4095, 4134, 4173, 39, 4212, 4251, 4290, 4329, 4368, 4407, 4446, 4485, 4524, 4563, 4602, 4641, 4680, 4719, 4758, 4797, 4836, 4875, 4914, 4953, 4992, 5031, 5070, 5109, 5148, 5187, 5226, 5265, 5304, 5343, 975, 5382, 5421, 5460, 5499,
- 5538, 5577, 1560, 5616, 5655, 5694, 5733, 5772, 5811, 5850, 546, 5889, 5928, 5967, 6006, 975, 975, 975, 6045, 1560, 6084, 6123, 1560, 6162, 6201, 6240, 1950, 546, 6279, 546, 819, 6318, 6357, 6396, 6435, 6474, 6513, 546, 6552, 1560, 1560, 1560, 1950, 6591, 39, 1950};
-
- /**
- * The packed transition table of the DFA (part 0)
- */
- final private static String yy_packed0 = "\2\17\2\20\1\17\1\20\1\21\1\17\1\22\1\23" + "\1\17\1\24\1\25\2\17\1\26\3\17\1\27\1\17" + "\1\30\21\17\47\0\2\31\2\20\1\32\1\20\1\0" + "\1\32\1\31\1\33\1\31\1\33\23\31\1\34\2\31" + "\1\35\1\36\2\37\1\31\2\40\2\20\1\0\1\20" + "\3\40\1\33\1\40\1\33\7\40\1\41\16\40\4\0" + "\1\40\1\42\1\43\2\20\1\42\1\20\3\42\1\33" + "\1\42\1\33\12\42\1\44\1\45\16\42\1\46\2\47" + "\2\20\1\47\1\20\3\47\1\33\1\47\1\33\33\47" + "\2\50\2\20\1\0\1\20\2\0\1\50\1\33\1\50" + "\1\33\26\50\4\0\1\50\1\42\1\43\2\20\1\42" + "\1\20\3\42\1\33\1\42\1\33\3\42\1\51\6\42" + "\1\52\1\53\16\42\1\46\2\54\2\55\1\54\1\55" + "\4\54\1\56\1\57\33\54\2\60\2\20\1\42\1\20" + "\2\42\1\60\1\33\1\60\1\33\26\60\4\42\1\60" + "\2\61\2\20\1\42\1\20\2\42\1\61\1\33\1\61" + "\1\33\26\61\4\42\1\61\1\62\1\63\1\64\1\65" + "\1\62\1\66\3\62\1\33\1\62\1\33\1\67\2\62" + "\1\70\1\62\1\71\10\62\1\72\4\62\1\73\2\62" + "\1\74\2\75\1\62\1\76\1\77\1\100\2\20\1\77" + "\1\20\3\77\1\33\1\77\1\33\23\77\1\101\6\77"
- + "\1\102\2\103\2\20\1\103\1\20\3\103\1\33\1\103" + "\1\33\26\103\1\104\1\105\1\106\2\103\2\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0" + "\23\17\2\0\2\20\1\0\1\20\53\0\1\107\34\0" + "\2\17\2\0\1\17\2\0\1\17\2\0\1\17\1\0" + "\1\17\1\110\1\17\1\111\3\17\1\0\25\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0" + "\1\112\22\17\2\113\2\0\1\113\2\0\1\113\2\0" + "\1\113\1\0\7\113\1\0\23\113\2\17\2\0\1\17" + "\2\0\1\17\2\0\1\17\1\0\4\17\1\114\2\17" + "\1\0\23\17\2\31\6\0\1\31\1\0\1\31\1\0" + "\26\31\4\0\3\31\6\0\1\31\1\0\1\31\1\0" + "\13\31\1\115\12\31\4\0\1\31\2\0\2\116\1\0" + "\1\116\31\0\1\117\7\0\2\40\4\0\3\40\1\0" + "\1\40\1\0\26\40\4\0\1\40\2\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\33\42\1\43\1\120" + "\2\121\1\43\1\121\3\43\1\121\1\43\1\121\33\43" + "\2\42\2\0\1\42\1\0\3\42\1\0\1\42\1\0" + "\6\42\1\122\26\42\2\0\1\42\1\0\3\42\1\0" + "\1\42\1\0\14\42\1\123\16\42\2\46\2\124\1\46" + "\1\124\3\46\1\124\1\46\1\124\32\46\1\125\2\47"
- + "\2\0\1\47\1\0\3\47\1\0\1\47\1\0\33\47" + "\2\50\6\0\1\50\1\0\1\50\1\0\26\50\4\0" + "\1\50\2\42\2\0\1\42\1\0\3\42\1\0\1\42" + "\1\0\17\42\1\126\15\42\2\0\1\42\1\0\3\42" + "\1\0\1\42\1\0\6\42\1\127\26\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\14\42\1\130\16\42" + "\12\54\2\0\35\54\2\55\1\54\1\55\4\54\2\0" + "\33\54\12\0\1\131\34\0\2\60\2\0\1\42\1\0" + "\2\42\1\60\1\0\1\60\1\0\26\60\4\42\1\60" + "\2\61\2\0\1\42\1\0\2\42\1\61\1\0\1\61" + "\1\0\26\61\4\42\1\61\2\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\26\62\3\0\2\62\1\63" + "\1\132\2\133\1\63\1\133\3\63\1\133\1\63\1\133" + "\26\63\3\133\2\63\3\0\1\65\50\0\1\66\41\0" + "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0" + "\3\62\1\134\22\62\3\0\4\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\2\62\1\135\5\62\1\136" + "\15\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0" + "\1\62\1\0\17\62\1\137\6\62\3\0\4\62\2\0" + "\1\62\1\0\3\62\1\0\1\62\1\0\17\62\1\140" + "\6\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0" + "\1\62\1\0\5\62\1\141\12\62\1\142\1\143\4\62"
- + "\3\0\2\62\2\76\2\144\1\76\1\144\3\76\1\144" + "\1\76\1\144\26\76\3\144\1\76\1\132\2\77\2\0" + "\1\77\1\0\3\77\1\0\1\77\1\0\33\77\1\100" + "\1\145\2\146\1\100\1\146\3\100\1\146\1\100\1\146" + "\33\100\2\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\5\77\1\147\12\77\1\150\1\151\11\77\2\102" + "\2\152\1\102\1\152\3\102\1\152\1\102\1\152\32\102" + "\1\153\2\103\2\0\1\103\1\0\3\103\1\0\1\103" + "\1\0\26\103\3\0\2\103\12\0\1\154\34\0\2\17" + "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\1\155" + "\6\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0" + "\1\17\1\0\4\17\1\156\2\17\1\0\25\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\4\17\1\157" + "\2\17\1\0\23\17\2\113\2\0\1\113\2\0\1\113" + "\1\160\1\0\1\113\1\0\7\113\1\0\23\113\2\17" + "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\4\17" + "\1\161\2\17\1\0\23\17\2\31\6\0\1\31\1\0" + "\1\31\1\0\16\31\1\162\7\31\4\0\1\31\27\0" + "\1\163\17\0\1\121\1\164\45\121\2\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\12\42\1\165\22\42" + "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\15\42"
- + "\1\166\15\42\46\124\1\167\2\42\2\0\1\42\1\0" + "\3\42\1\0\1\42\1\0\11\42\1\170\23\42\2\0" + "\1\42\1\0\3\42\1\0\1\42\1\0\12\42\1\171" + "\22\42\2\0\1\42\1\0\3\42\1\0\1\42\1\0" + "\15\42\1\172\15\42\13\0\1\173\33\0\1\133\1\174" + "\45\133\2\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\4\62\1\175\21\62\3\0\4\62\2\0\1\62" + "\1\0\3\62\1\0\1\62\1\0\4\62\1\176\21\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\4\62\1\177\21\62\3\0\4\62\2\0\1\62" + "\1\0\3\62\1\0\1\62\1\0\20\62\1\200\5\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\11\62\1\201\14\62\3\0\4\62\2\0\1\62" + "\1\0\3\62\1\0\1\62\1\0\2\62\1\202\23\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\1\203\25\62\3\0\4\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\5\62\1\204\20\62\3\0" + "\2\62\46\144\1\174\1\146\1\205\45\146\2\77\2\0" + "\1\77\1\0\3\77\1\0\1\77\1\0\2\77\1\206" + "\32\77\2\0\1\77\1\0\3\77\1\0\1\77\1\0" + "\1\207\34\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\5\77\1\210\25\77\46\152\1\211\2\17\2\0"
- + "\1\17\2\0\1\17\2\0\1\17\1\0\2\17\1\212" + "\4\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0" + "\1\17\1\0\5\17\1\213\1\17\1\0\25\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0" + "\1\17\1\214\23\17\2\0\1\17\2\0\1\17\2\0" + "\1\17\1\0\1\17\1\215\5\17\1\0\23\17\2\31" + "\6\0\1\31\1\0\1\31\1\0\17\31\1\216\6\31" + "\4\0\1\31\32\0\1\217\14\0\2\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\4\42\1\220\30\42" + "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\1\42" + "\1\221\33\42\2\0\1\42\1\0\3\42\1\0\1\42" + "\1\0\4\42\1\222\30\42\2\0\1\42\1\0\3\42" + "\1\0\1\42\1\0\4\42\1\223\30\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\1\42\1\224\31\42" + "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0" + "\5\62\1\225\20\62\3\0\4\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\10\62\1\226\15\62\3\0" + "\4\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0" + "\11\62\1\227\14\62\3\0\4\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\1\230\25\62\3\0\4\62" + "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\4\62" + "\1\231\21\62\3\0\4\62\2\0\1\62\1\0\3\62"
- + "\1\0\1\62\1\0\13\62\1\232\12\62\3\0\4\62" + "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\24\62" + "\1\233\1\62\3\0\4\62\2\0\1\62\1\0\3\62" + "\1\0\1\62\1\0\25\62\1\234\3\0\2\62\2\77" + "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\13\77" + "\1\235\21\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\24\77\1\236\10\77\2\0\1\77\1\0\3\77" + "\1\0\1\77\1\0\25\77\1\237\5\77\2\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\1\240\6\17" + "\1\0\25\17\2\0\1\17\2\0\1\17\2\0\1\17" + "\1\0\4\17\1\241\2\17\1\0\25\17\2\0\1\17" + "\2\0\1\17\2\0\1\17\1\0\4\17\1\242\2\17" + "\1\0\25\17\2\0\1\17\2\0\1\17\2\0\1\17" + "\1\0\5\17\1\243\1\17\1\0\23\17\2\31\6\0" + "\1\31\1\0\1\31\1\0\11\31\1\244\14\31\4\0" + "\1\31\33\0\1\245\13\0\2\42\2\0\1\42\1\0" + "\3\42\1\0\1\42\1\0\1\246\34\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\5\42\1\247\27\42" + "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\11\42" + "\1\250\23\42\2\0\1\42\1\0\3\42\1\0\1\42" + "\1\0\1\251\34\42\2\0\1\42\1\0\3\42\1\0" + "\1\42\1\0\5\42\1\252\25\42\2\62\2\0\1\62"
- + "\1\0\3\62\1\0\1\62\1\0\4\62\1\253\21\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\22\62\1\254\3\62\3\0\4\62\2\0\1\62" + "\1\0\3\62\1\0\1\62\1\0\4\62\1\255\21\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\21\62\1\256\4\62\3\0\4\62\2\0\1\62" + "\1\0\3\62\1\0\1\62\1\0\11\62\1\257\14\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\1\62\1\260\24\62\3\0\4\62\2\0\1\62" + "\1\0\3\62\1\0\1\62\1\0\14\62\1\261\11\62" + "\3\0\4\62\2\0\1\62\1\0\3\62\1\0\1\62" + "\1\0\1\262\25\62\3\0\2\62\2\77\2\0\1\77" + "\1\0\3\77\1\0\1\77\1\0\1\77\1\263\33\77" + "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\14\77" + "\1\264\20\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\1\265\32\77\2\17\2\0\1\17\2\0\1\17" + "\2\0\1\17\1\0\3\17\1\266\3\17\1\0\25\17" + "\2\0\1\17\2\0\1\17\2\0\1\17\1\0\6\17" + "\1\267\1\0\25\17\2\0\1\17\2\0\1\17\2\0" + "\1\17\1\0\5\17\1\270\1\17\1\0\25\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\7\17\1\0" + "\2\17\1\271\20\17\2\31\6\0\1\31\1\0\1\31"
- + "\1\0\4\31\1\272\21\31\4\0\1\31\25\0\1\273" + "\21\0\2\42\2\0\1\42\1\0\3\42\1\0\1\42" + "\1\0\2\42\1\274\32\42\2\0\1\42\1\0\3\42" + "\1\0\1\42\1\0\16\42\1\274\16\42\2\0\1\42" + "\1\0\3\42\1\0\1\42\1\0\2\42\1\275\32\42" + "\2\0\1\42\1\0\3\42\1\0\1\42\1\0\16\42" + "\1\276\14\42\2\62\2\0\1\62\1\0\3\62\1\0" + "\1\62\1\0\5\62\1\277\1\300\17\62\3\0\4\62" + "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\1\301" + "\25\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0" + "\1\62\1\0\5\62\1\302\20\62\3\0\4\62\2\0" + "\1\62\1\0\3\62\1\0\1\62\1\0\12\62\1\303" + "\13\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0" + "\1\62\1\0\5\62\1\234\20\62\3\0\4\62\2\0" + "\1\62\1\0\3\62\1\0\1\62\1\0\5\62\1\304" + "\20\62\3\0\4\62\2\0\1\62\1\0\3\62\1\0" + "\1\62\1\0\17\62\1\132\6\62\3\0\2\62\2\77" + "\2\0\1\77\1\0\3\77\1\0\1\77\1\0\5\77" + "\1\305\27\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\5\77\1\306\27\77\2\0\1\77\1\0\3\77" + "\1\0\1\77\1\0\17\77\1\307\13\77\2\17\2\0" + "\1\17\2\0\1\17\2\0\1\17\1\0\4\17\1\310"
- + "\2\17\1\0\25\17\2\0\1\17\2\0\1\17\2\0" + "\1\17\1\0\7\17\1\0\1\311\24\17\2\0\1\17" + "\2\0\1\17\2\0\1\17\1\0\4\17\1\312\2\17" + "\1\0\23\17\2\31\6\0\1\31\1\0\1\31\1\0" + "\11\31\1\313\14\31\4\0\1\31\20\0\1\314\26\0" + "\2\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0" + "\1\315\25\62\3\0\4\62\2\0\1\62\1\0\3\62" + "\1\0\1\62\1\0\3\62\1\316\22\62\3\0\4\62" + "\2\0\1\62\1\0\3\62\1\0\1\62\1\0\10\62" + "\1\317\15\62\3\0\4\62\2\0\1\62\1\0\3\62" + "\1\0\1\62\1\0\20\62\1\234\5\62\3\0\2\62" + "\2\77\2\0\1\77\1\0\3\77\1\0\1\77\1\0" + "\1\320\34\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\20\77\1\321\12\77\2\17\2\0\1\17\2\0" + "\1\17\2\0\1\17\1\0\3\17\1\322\3\17\1\0" + "\23\17\25\0\1\323\21\0\2\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\12\62\1\324\13\62\3\0" + "\4\62\2\0\1\62\1\0\3\62\1\0\1\62\1\0" + "\12\62\1\325\13\62\3\0\4\62\2\0\1\62\1\0" + "\3\62\1\0\1\62\1\0\3\62\1\326\22\62\3\0" + "\2\62\2\77\2\0\1\77\1\0\3\77\1\0\1\77" + "\1\0\17\77\1\327\15\77\2\0\1\77\1\0\3\77"
- + "\1\0\1\77\1\0\1\330\32\77\2\0\2\323\1\0" + "\1\323\35\0\1\331\3\0\2\77\2\0\1\77\1\0" + "\3\77\1\0\1\77\1\0\17\77\1\332\13\77";
-
- /**
- * The transition table of the DFA
- */
- final private static int yytrans[] = yy_unpack();
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final 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"};
-
- /**
- * YY_ATTRIBUTE[aState] contains the attributes of state
- * <code>aState</code>
- */
- private final static byte YY_ATTRIBUTE[] = {0, 8, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 1, 1, 1, 1, 9, 9, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1, 9, 9, 9, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 9, 1, 1, 1, 9, 1, 1, 0, 9, 1, 1, 9, 1, 1, 1, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 9, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 9, 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[YY_BUFFERSIZE];
-
- /** 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
- */
- int yycolumn;
-
- /**
- * yy_atBOL == true <=>the scanner is currently at the beginning of a
- * line
- */
- boolean yy_atBOL = true;
-
- /** yy_atEOF == true <=>the scanner is at the EOF */
- private boolean yy_atEOF;
-
- /* user code: */
- int node_count = 0;
- String currentString;
-
- private Token createToken(String type) {
- return new Token(type, yytext(), yyline, yychar + startOffset, yylength());
- }
-
- private int startOffset = 0;
-
- public void setStartOffset(int startOffset) {
- this.startOffset = startOffset;
- }
-
- public void setLine(int line) {
- this.yyline = line;
- }
-
-
- /**
- * 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 DTDTokenizer(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 DTDTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the split, compressed DFA transition table.
- *
- * @return the unpacked transition table
- */
- private static int[] yy_unpack() {
- int[] trans = new int[6630];
- int offset = 0;
- offset = yy_unpack(yy_packed0, offset, trans);
- return trans;
- }
-
- /**
- * Unpacks the compressed DFA transition table.
- *
- * @param packed
- * the packed transition table
- * @return the index of the last entry
- */
- private static int yy_unpack(String packed, int offset, int[] trans) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do
- trans[j++] = value;
- while (--count > 0);
- }
- return j;
- }
-
- /**
- * 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 < 130) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do
- map[j++] = value;
- while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Refills the input buffer.
- *
- * @return <code>false</code>, iff there was new input.
- *
- * @exception java.io.IOException
- * if any I/O-Error occurs
- */
- private boolean yy_refill() throws java.io.IOException {
-
- /* 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 < 0) {
- return true;
- } else {
- yy_endRead += numRead;
- return false;
- }
- }
-
-
- /**
- * 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 */
-
- if (yy_reader != null)
- yy_reader.close();
- }
-
-
- /**
- * Closes the current stream, and resets the scanner to read from a new
- * input stream.
- *
- * All internal variables are reset, the old input stream <b>cannot </b>
- * be reused (internal buffer is discarded and lost). Lexical state is set
- * to <tt>YY_INITIAL</tt>.
- *
- * @param reader
- * the new input stream
- */
- final public void yyreset(java.io.Reader reader) throws java.io.IOException {
- yyclose();
- yy_reader = reader;
- yy_atBOL = true;
- yy_atEOF = false;
- yy_endRead = yy_startRead = 0;
- yy_currentPos = yy_markedPos = yy_pushbackPos = 0;
- yyline = yychar = yycolumn = 0;
- yy_lexical_state = YYINITIAL;
- }
-
-
- /**
- * 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 character at position <tt>pos</tt> from the matched text.
- *
- * It is equivalent to yytext().charAt(pos), but faster
- *
- * @param pos
- * the position of the character to fetch. A value from 0 to
- * yylength()-1.
- *
- * @return the character at position pos
- */
- final public char yycharat(int pos) {
- return yy_buffer[yy_startRead + pos];
- }
-
-
- /**
- * Returns the length of the matched text region.
- */
- final public int yylength() {
- return yy_markedPos - yy_startRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * In a wellformed scanner (no or only correct usage of yypushback(int)
- * and a match-all fallback rule) this method will only be called with
- * things that "Can't Possibly Happen". If this method is called,
- * something is seriously wrong (e.g. a JFlex bug producing a faulty
- * scanner etc.).
- *
- * Usual syntax/scanner level error handling should be done in error
- * fallback rules.
- *
- * @param errorCode
- * the code of the errormessage to display
- */
- private void yy_ScanError(int errorCode) {
- String message;
- try {
- message = YY_ERROR_MSG[errorCode];
- } catch (ArrayIndexOutOfBoundsException e) {
- message = YY_ERROR_MSG[YY_UNKNOWN_ERROR];
- }
-
- throw new Error(message);
- }
-
-
- /**
- * 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;
- }
-
-
- /**
- * 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 Yytoken yylex() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
- // cached fields:
- int yy_currentPos_l;
- int yy_startRead_l;
- int yy_markedPos_l;
- int yy_endRead_l = yy_endRead;
- char[] yy_buffer_l = yy_buffer;
- char[] yycmap_l = yycmap;
-
- int[] yytrans_l = yytrans;
- int[] yy_rowMap_l = yy_rowMap;
- byte[] yy_attr_l = YY_ATTRIBUTE;
-
- while (true) {
- yy_markedPos_l = yy_markedPos;
-
- yychar += yy_markedPos_l - yy_startRead;
-
- boolean yy_r = false;
- for (yy_currentPos_l = yy_startRead; yy_currentPos_l < yy_markedPos_l; yy_currentPos_l++) {
- switch (yy_buffer_l[yy_currentPos_l]) {
- case '\u000B' :
- case '\u000C' :
- case '\u0085' :
- case '\u2028' :
- case '\u2029' :
- yyline++;
- yy_r = false;
- break;
- case '\r' :
- yyline++;
- yy_r = true;
- break;
- case '\n' :
- if (yy_r)
- yy_r = false;
- else {
- yyline++;
- }
- break;
- default :
- yy_r = false;
- }
- }
-
- if (yy_r) {
- // peek one character ahead if it is \n (if we have counted
- // one line too much)
- boolean yy_peek;
- if (yy_markedPos_l < yy_endRead_l)
- yy_peek = yy_buffer_l[yy_markedPos_l] == '\n';
- else if (yy_atEOF)
- yy_peek = false;
- else {
- boolean eof = yy_refill();
- yy_markedPos_l = yy_markedPos;
- yy_buffer_l = yy_buffer;
- if (eof)
- yy_peek = false;
- else
- yy_peek = yy_buffer_l[yy_markedPos_l] == '\n';
- }
- if (yy_peek)
- yyline--;
- }
- yy_action = -1;
-
- yy_startRead_l = yy_currentPos_l = yy_currentPos = yy_startRead = yy_markedPos_l;
-
- yy_state = yy_lexical_state;
-
-
- yy_forAction : {
- while (true) {
-
- if (yy_currentPos_l < yy_endRead_l)
- yy_input = yy_buffer_l[yy_currentPos_l++];
- else if (yy_atEOF) {
- yy_input = YYEOF;
- break yy_forAction;
- } else {
- // store back cached positions
- yy_currentPos = yy_currentPos_l;
- yy_markedPos = yy_markedPos_l;
- boolean eof = yy_refill();
- // get translated positions and possibly new buffer
- yy_currentPos_l = yy_currentPos;
- yy_markedPos_l = yy_markedPos;
- yy_buffer_l = yy_buffer;
- yy_endRead_l = yy_endRead;
- if (eof) {
- yy_input = YYEOF;
- break yy_forAction;
- } else {
- yy_input = yy_buffer_l[yy_currentPos_l++];
- }
- }
- int yy_next = yytrans_l[yy_rowMap_l[yy_state] + yycmap_l[yy_input]];
- if (yy_next == -1)
- break yy_forAction;
- yy_state = yy_next;
-
- int yy_attributes = yy_attr_l[yy_state];
- if ((yy_attributes & 1) == 1) {
- yy_action = yy_state;
- yy_markedPos_l = yy_currentPos_l;
- if ((yy_attributes & 8) == 8)
- break yy_forAction;
- }
-
- }
- }
-
- // store back cached position
- yy_markedPos = yy_markedPos_l;
-
- switch (yy_action) {
-
- case 26 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [197] { yypushback(yylength());
- // yybegin(YYINITIAL); }");
- {
- yypushback(yylength());
- yybegin(YYINITIAL);
- }
- case 219 :
- break;
- case 89 :
- case 123 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [231] { yypushback(yylength());
- // yybegin(ATTRIBUTE_DEFAULT); }");
- {
- yypushback(yylength());
- yybegin(ATTRIBUTE_DEFAULT);
- }
- case 220 :
- break;
- case 12 :
- case 62 :
- case 63 :
- case 64 :
- case 65 :
- case 102 :
- case 103 :
- case 104 :
- case 133 :
- case 134 :
- case 135 :
- case 156 :
- case 157 :
- case 158 :
- case 178 :
- case 179 :
- case 180 :
- case 196 :
- case 197 :
- case 207 :
- case 208 :
- case 215 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [247] { yypushback(yylength());
- // yybegin(ATTLIST_CONTENT); }");
- {
- yypushback(yylength());
- yybegin(ATTLIST_CONTENT);
- }
- case 221 :
- break;
- case 51 :
- case 52 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [217] { yypushback(yylength());
- // yybegin(ATTLIST_CONTENT); }");
- {
- yypushback(yylength());
- yybegin(ATTLIST_CONTENT);
- }
- case 222 :
- break;
- case 205 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [227] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.NMTOKEN_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.NMTOKEN_KEYWORD);
- }
- case 223 :
- break;
- case 194 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [224] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.IDREFS_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.IDREFS_KEYWORD);
- }
- case 224 :
- break;
- case 191 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [225] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.ENTITY_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.ENTITY_KEYWORD);
- }
- case 225 :
- break;
- case 107 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [174] {
- // yybegin(COMMENT_CONTENT); return
- // createToken(DTDRegionTypes.COMMENT_START); }");
- {
- yybegin(COMMENT_CONTENT);
- return createToken(DTDRegionTypes.COMMENT_START);
- }
- case 226 :
- break;
- case 48 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [211] {
- // yybegin(ATTRIBUTE_CONTENT); return
- // createToken(DTDRegionTypes.ATTRIBUTE_NAME); }");
- {
- yybegin(ATTRIBUTE_CONTENT);
- return createToken(DTDRegionTypes.ATTRIBUTE_NAME);
- }
- case 227 :
- break;
- case 39 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [283] {
- // yybegin(EXTERNALID_CONTENT); return
- // createToken(DTDRegionTypes.NAME); }");
- {
- yybegin(EXTERNALID_CONTENT);
- return createToken(DTDRegionTypes.NAME);
- }
- case 228 :
- break;
- case 106 :
- case 136 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [245] {
- // yybegin(ATTLIST_CONTENT); return
- // createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }");
- {
- yybegin(ATTLIST_CONTENT);
- return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL);
- }
- case 229 :
- break;
- case 100 :
- case 132 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [246] {
- // yybegin(ATTLIST_CONTENT); return
- // createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }");
- {
- yybegin(ATTLIST_CONTENT);
- return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL);
- }
- case 230 :
- break;
- case 202 :
- case 216 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [189] { return
- // createToken(DTDRegionTypes.CONTENT_PCDATA); }");
- {
- return createToken(DTDRegionTypes.CONTENT_PCDATA);
- }
- case 231 :
- break;
- case 189 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [290] { return
- // createToken(DTDRegionTypes.PUBLIC_KEYWORD); }");
- {
- return createToken(DTDRegionTypes.PUBLIC_KEYWORD);
- }
- case 232 :
- break;
- case 188 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [289] { return
- // createToken(DTDRegionTypes.SYSTEM_KEYWORD); }");
- {
- return createToken(DTDRegionTypes.SYSTEM_KEYWORD);
- }
- case 233 :
- break;
- case 14 :
- case 20 :
- case 21 :
- case 23 :
- case 71 :
- case 72 :
- case 73 :
- case 75 :
- case 108 :
- case 109 :
- case 110 :
- case 112 :
- case 137 :
- case 138 :
- case 139 :
- case 140 :
- case 159 :
- case 160 :
- case 161 :
- case 162 :
- case 181 :
- case 183 :
- case 184 :
- case 200 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [182] { return
- // createToken(DTDRegionTypes.UNKNOWN_CONTENT); }");
- {
- return createToken(DTDRegionTypes.UNKNOWN_CONTENT);
- }
- case 234 :
- break;
- case 4 :
- case 33 :
- case 34 :
- case 35 :
- case 36 :
- case 37 :
- case 81 :
- case 82 :
- case 116 :
- case 117 :
- case 143 :
- case 144 :
- case 165 :
- case 166 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [275] { return
- // createToken(DTDRegionTypes.UNKNOWN_CONTENT); }");
- {
- return createToken(DTDRegionTypes.UNKNOWN_CONTENT);
- }
- case 235 :
- break;
- case 7 :
- case 40 :
- case 41 :
- case 42 :
- case 85 :
- case 86 :
- case 87 :
- case 119 :
- case 120 :
- case 121 :
- case 145 :
- case 146 :
- case 147 :
- case 168 :
- case 169 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [294] { return
- // createToken(DTDRegionTypes.UNKNOWN_CONTENT); }");
- {
- return createToken(DTDRegionTypes.UNKNOWN_CONTENT);
- }
- case 236 :
- break;
- case 9 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [205] { return
- // createToken(DTDRegionTypes.UNKNOWN_CONTENT); }");
- {
- return createToken(DTDRegionTypes.UNKNOWN_CONTENT);
- }
- case 237 :
- break;
- case 10 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [212] { return
- // createToken(DTDRegionTypes.UNKNOWN_CONTENT); }");
- {
- return createToken(DTDRegionTypes.UNKNOWN_CONTENT);
- }
- case 238 :
- break;
- case 43 :
- case 45 :
- case 46 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [309] { return
- // createToken(DTDRegionTypes.COMMENT_CONTENT); }");
- {
- return createToken(DTDRegionTypes.COMMENT_CONTENT);
- }
- case 239 :
- break;
- case 60 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [236] { return
- // createToken(DTDRegionTypes.UNKNOWN_CONTENT); }");
- {
- return createToken(DTDRegionTypes.UNKNOWN_CONTENT);
- }
- case 240 :
- break;
- case 198 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [244] { return
- // createToken(DTDRegionTypes.FIXED_KEYWORD); }");
- {
- return createToken(DTDRegionTypes.FIXED_KEYWORD);
- }
- case 241 :
- break;
- case 214 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [243] {
- // yybegin(ATTLIST_CONTENT); return
- // createToken(DTDRegionTypes.IMPLIED_KEYWORD); }");
- {
- yybegin(ATTLIST_CONTENT);
- return createToken(DTDRegionTypes.IMPLIED_KEYWORD);
- }
- case 242 :
- break;
- case 212 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [228] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.NMTOKENS_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.NMTOKENS_KEYWORD);
- }
- case 243 :
- break;
- case 211 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [226] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.ENTITIES_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.ENTITIES_KEYWORD);
- }
- case 244 :
- break;
- case 209 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [176] { yybegin(NOTATION_NAME);
- // return createToken(DTDRegionTypes.NOTATION_TAG); }");
- {
- yybegin(NOTATION_NAME);
- return createToken(DTDRegionTypes.NOTATION_TAG);
- }
- case 245 :
- break;
- case 201 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [177] { yybegin(ATTLIST_NAME);
- // return createToken(DTDRegionTypes.ATTLIST_TAG); }");
- {
- yybegin(ATTLIST_NAME);
- return createToken(DTDRegionTypes.ATTLIST_TAG);
- }
- case 246 :
- break;
- case 199 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [173] { yybegin(ELEMENT_NAME);
- // return createToken(DTDRegionTypes.ELEMENT_TAG); }");
- {
- yybegin(ELEMENT_NAME);
- return createToken(DTDRegionTypes.ELEMENT_TAG);
- }
- case 247 :
- break;
- case 182 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [175] { yybegin(ENTITY_NAME);
- // return createToken(DTDRegionTypes.ENTITY_TAG); }");
- {
- yybegin(ENTITY_NAME);
- return createToken(DTDRegionTypes.ENTITY_TAG);
- }
- case 248 :
- break;
- case 167 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [293] { yybegin(NDATA_CONTENT);
- // return createToken(DTDRegionTypes.NDATA_KEYWORD); }");
- {
- yybegin(NDATA_CONTENT);
- return createToken(DTDRegionTypes.NDATA_KEYWORD);
- }
- case 249 :
- break;
- case 111 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [179] { return
- // createToken(DTDRegionTypes.ENTITY_PARM); }");
- {
- return createToken(DTDRegionTypes.ENTITY_PARM);
- }
- case 250 :
- break;
- case 94 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [222] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.ID_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.ID_KEYWORD);
- }
- case 251 :
- break;
- case 25 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [194] { return
- // createToken(DTDRegionTypes.OCCUR_TYPE); }");
- {
- return createToken(DTDRegionTypes.OCCUR_TYPE);
- }
- case 252 :
- break;
- case 16 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [169] { return
- // createToken(DTDRegionTypes.EXCLAMATION); }");
- {
- return createToken(DTDRegionTypes.EXCLAMATION);
- }
- case 253 :
- break;
- case 15 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [184] { return
- // createToken(DTDRegionTypes.WHITESPACE); }");
- {
- return createToken(DTDRegionTypes.WHITESPACE);
- }
- case 254 :
- break;
- case 11 :
- case 49 :
- case 50 :
- case 54 :
- case 55 :
- case 56 :
- case 57 :
- case 58 :
- case 61 :
- case 91 :
- case 92 :
- case 93 :
- case 95 :
- case 96 :
- case 97 :
- case 98 :
- case 124 :
- case 125 :
- case 126 :
- case 127 :
- case 128 :
- case 129 :
- case 130 :
- case 131 :
- case 148 :
- case 149 :
- case 150 :
- case 151 :
- case 152 :
- case 153 :
- case 154 :
- case 155 :
- case 170 :
- case 171 :
- case 172 :
- case 175 :
- case 176 :
- case 177 :
- case 190 :
- case 192 :
- case 193 :
- case 195 :
- case 204 :
- case 206 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [235] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.PARM_ENTITY_TYPE); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.PARM_ENTITY_TYPE);
- }
- case 255 :
- break;
- case 28 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [192] { return
- // createToken(DTDRegionTypes.LEFT_PAREN); }");
- {
- return createToken(DTDRegionTypes.LEFT_PAREN);
- }
- case 256 :
- break;
- case 29 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [195] { return
- // createToken(DTDRegionTypes.RIGHT_PAREN); }");
- {
- return createToken(DTDRegionTypes.RIGHT_PAREN);
- }
- case 257 :
- break;
- case 44 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [308] { return
- // createToken(DTDRegionTypes.WHITESPACE); }");
- {
- return createToken(DTDRegionTypes.WHITESPACE);
- }
- case 258 :
- break;
- case 53 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [218] { return
- // createToken(DTDRegionTypes.WHITESPACE); }");
- {
- return createToken(DTDRegionTypes.WHITESPACE);
- }
- case 259 :
- break;
- case 59 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [234] { yypushback(yylength());
- // yybegin(ATTRIBUTE_ENUMERATION); }");
- {
- yypushback(yylength());
- yybegin(ATTRIBUTE_ENUMERATION);
- }
- case 260 :
- break;
- case 67 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [253] { return
- // createToken(DTDRegionTypes.LEFT_PAREN); }");
- {
- return createToken(DTDRegionTypes.LEFT_PAREN);
- }
- case 261 :
- break;
- case 68 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [255] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.RIGHT_PAREN); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.RIGHT_PAREN);
- }
- case 262 :
- break;
- case 69 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [254] { return
- // createToken(DTDRegionTypes.ENUM_CHOICE); }");
- {
- return createToken(DTDRegionTypes.ENUM_CHOICE);
- }
- case 263 :
- break;
- case 31 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [265] { yybegin(ENTITY_CONTENT);
- // return createToken(DTDRegionTypes.NAME); }");
- {
- yybegin(ENTITY_CONTENT);
- return createToken(DTDRegionTypes.NAME);
- }
- case 264 :
- break;
- case 47 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [204] {
- // yybegin(ATTLIST_CONTENT); return
- // createToken(DTDRegionTypes.NAME); }");
- {
- yybegin(ATTLIST_CONTENT);
- return createToken(DTDRegionTypes.NAME);
- }
- case 265 :
- break;
- case 187 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [272] { yypushback(yylength());
- // yybegin(EXTERNALID_CONTENT); }");
- {
- yypushback(yylength());
- yybegin(EXTERNALID_CONTENT);
- }
- case 266 :
- break;
- case 213 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [229] {
- // yybegin(ATTRIBUTE_ENUMERATION); return
- // createToken(DTDRegionTypes.NOTATION_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_ENUMERATION);
- return createToken(DTDRegionTypes.NOTATION_KEYWORD);
- }
- case 267 :
- break;
- case 174 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [220] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.CDATA_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.CDATA_KEYWORD);
- }
- case 268 :
- break;
- case 173 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [223] {
- // yybegin(ATTRIBUTE_DEFAULT); return
- // createToken(DTDRegionTypes.IDREF_KEYWORD); }");
- {
- yybegin(ATTRIBUTE_DEFAULT);
- return createToken(DTDRegionTypes.IDREF_KEYWORD);
- }
- case 269 :
- break;
- case 217 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [242] {
- // yybegin(ATTLIST_CONTENT); return
- // createToken(DTDRegionTypes.REQUIRED_KEYWORD); }");
- {
- yybegin(ATTLIST_CONTENT);
- return createToken(DTDRegionTypes.REQUIRED_KEYWORD);
- }
- case 270 :
- break;
- case 122 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [307] { yybegin(YYINITIAL);
- // return createToken(DTDRegionTypes.COMMENT_END); }");
- {
- yybegin(YYINITIAL);
- return createToken(DTDRegionTypes.COMMENT_END);
- }
- case 271 :
- break;
- case 84 :
- case 118 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [273] { return
- // createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }");
- {
- return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL);
- }
- case 272 :
- break;
- case 79 :
- case 115 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [274] { return
- // createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }");
- {
- return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL);
- }
- case 273 :
- break;
- case 24 :
- case 27 :
- case 76 :
- case 113 :
- case 141 :
- case 163 :
- case 185 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [190] { return
- // createToken(DTDRegionTypes.NAME); }");
- {
- return createToken(DTDRegionTypes.NAME);
- }
- case 274 :
- break;
- case 5 :
- case 38 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [300] { yybegin(YYINITIAL);
- // return createToken(DTDRegionTypes.NDATA_VALUE); }");
- {
- yybegin(YYINITIAL);
- return createToken(DTDRegionTypes.NDATA_VALUE);
- }
- case 275 :
- break;
- case 13 :
- case 66 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [256] { return
- // createToken(DTDRegionTypes.NAME); }");
- {
- return createToken(DTDRegionTypes.NAME);
- }
- case 276 :
- break;
- case 18 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [167] { return
- // createToken(DTDRegionTypes.START_TAG); }");
- {
- return createToken(DTDRegionTypes.START_TAG);
- }
- case 277 :
- break;
- case 17 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [171] { return
- // createToken(DTDRegionTypes.SEMICOLON); }");
- {
- return createToken(DTDRegionTypes.SEMICOLON);
- }
- case 278 :
- break;
- case 30 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [193] { return
- // createToken(DTDRegionTypes.CONNECTOR); }");
- {
- return createToken(DTDRegionTypes.CONNECTOR);
- }
- case 279 :
- break;
- case 22 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [170] { return
- // createToken(DTDRegionTypes.PERCENT); }");
- {
- return createToken(DTDRegionTypes.PERCENT);
- }
- case 280 :
- break;
- case 19 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [168] { return
- // createToken(DTDRegionTypes.END_TAG); }");
- {
- return createToken(DTDRegionTypes.END_TAG);
- }
- case 281 :
- break;
- case 32 :
- //System.out.println("line: "+(yyline+1)+" "+"match:
- // --"+yytext()+"--");
- //System.out.println("action [264] { return
- // createToken(DTDRegionTypes.PERCENT); }");
- {
- return createToken(DTDRegionTypes.PERCENT);
- }
- case 282 :
- break;
- default :
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- return null;
- } else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
- /**
- * Runs the scanner on input files.
- *
- * This main method is the debugging routine for the scanner. It prints
- * debugging information about 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[]) {
- if (argv.length == 0) {
- System.out.println("Usage : java DTDTokenizer <inputfile>");
- } else {
- for (int i = 0; i < argv.length; i++) {
- DTDTokenizer scanner = null;
- try {
- scanner = new DTDTokenizer(new java.io.FileReader(argv[i]));
- do {
- System.out.println(scanner.yylex());
- } while (!scanner.yy_atEOF);
-
- } catch (java.io.FileNotFoundException e) {
- System.out.println("File not found : \"" + argv[i] + "\"");
- } catch (java.io.IOException e) {
- System.out.println("IO error scanning file \"" + argv[i] + "\"");
- System.out.println(e);
- } catch (Exception e) {
- System.out.println("Unexpected exception:");
- e.printStackTrace();
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Token.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Token.java
deleted file mode 100644
index 4c8072d15e..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Token.java
+++ /dev/null
@@ -1,61 +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.dtd.core.tokenizer;
-
-public class Token extends Yytoken {
- public static final int COMMENT_START = 9;
- public static final int CONNECTOR = 6;
- public static final int CONTENT_ANY = 43;
- public static final int CONTENT_EMPTY = 42;
- public static final int CONTENT_PCDATA = 44;
- public static final int ELEMENT_CONTENT = 41;
-
- public static final int ELEMENT_TAG = 40;
- public static final int END_TAG = 2;
- public static final int ENTITY_CONTENT = 32;
- public static final int ENTITY_PARM = 31;
-
- public static final int ENTITY_TAG = 30;
- public static final int EXCLAMATION = 8;
- public static final int LEFT_PAREN = 3;
- public static final int NAME = 0;
- public static final int NOTATION_CONTENT = 21;
-
-
- public static final int NOTATION_TAG = 20;
-
- // public static final int CONNECT_CHOICE = 5;
- // public static final int CONNECT_SEQUENCE = 6;
- // public static final int OCCUR_OPTIONAL = 7;
- // public static final int OCCUR_ONE_OR_MORE = 8;
- // public static final int OCCUR_ZERO_OR_MORE = 9;
- public static final int OCCUR_TYPE = 7;
- public static final int RIGHT_PAREN = 4;
- public static final int START_TAG = 1;
- public static final int WHITESPACE = 5;
-
-
- public Token(String type) {
- super(type);
- }
-
- public Token(String type, String text, int line, int charBegin, int length) {
- super(type, text, line, charBegin, length);
- }
-
- public Token createCopy() {
- Token copy = new Token(getType(), getText(), getStartLine(), getStartOffset(), getLength());
- return copy;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Yytoken.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Yytoken.java
deleted file mode 100644
index ceead5f2ec..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/Yytoken.java
+++ /dev/null
@@ -1,90 +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.dtd.core.tokenizer;
-
-class Yytoken {
- public int m_charBegin;
- public int m_length;
- public int m_line;
- public String m_text;
- public String m_type;
-
- Yytoken(String type) {
- m_type = type;
- }
-
- Yytoken(String type, String text, int line, int charBegin, int length) {
- m_type = type;
- m_text = new String(text);
- m_line = line;
- m_charBegin = charBegin;
- m_length = length;
- }
-
- public void delete(int start, int length) {
- int stringStart = start - m_charBegin;
- String oldString = m_text;
- m_text = oldString.substring(0, stringStart);
- m_text += oldString.substring(stringStart + length);
-
- m_length = m_text.length();
- System.out.println("new string = " + m_text); //$NON-NLS-1$
-
- }
-
- public boolean equals(Yytoken other) {
- return m_type == other.getType() && m_text.equals(other.getText()) && m_line == other.getStartLine() && m_charBegin == other.getStartOffset() && m_length == other.getLength();
- }
-
- public int getEndOffset() {
- return m_charBegin + m_length;
- }
-
- public int getLength() {
- return m_length;
- }
-
- public int getStartLine() {
- return m_line;
- }
-
- public int getStartOffset() {
- return m_charBegin;
- }
-
- public String getText() {
- return m_text;
- }
-
- public String getType() {
- return m_type;
- }
-
- public void setStartOffset(int startOffset) {
- m_charBegin = startOffset;
- }
-
- public String toString() {
- return "Text : " + m_text + "\ntype : " + m_type + "\nline : " + m_line + "\ncBeg. : " + m_charBegin + "\ncEnd. : " + getEndOffset() + "\ncLength. : " + m_length; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- }
-
- public void updateOffset(int delta) {
- m_charBegin += delta;
- }
-
- public void updateText(String newText) {
- m_text = newText;
- m_length = newText.length();
- }
-}
-
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/dtd.flex b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/dtd.flex
deleted file mode 100644
index b29b7f8e04..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/tokenizer/dtd.flex
+++ /dev/null
@@ -1,312 +0,0 @@
-/* this is a scanner for DTD files */
-package org.eclipse.wst.dtd.core.tokenizer;
-
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-
-%%
-
-%{
- private int node_count = 0;
- private String currentString;
-
- private Token createToken(String type)
- {
- return new Token(type, yytext(), yyline, yychar + startOffset, yylength());
- }
-
- private int startOffset = 0;
- public void setStartOffset(int startOffset)
- {
- this.startOffset = startOffset;
- }
-
- public void setLine(int line)
- {
- this.yyline = line;
- }
-%}
-
-%class DTDTokenizer
-%public
-%unicode
-%debug
-%line
-%char
-%state NODE
-%state ELEMENT_NAME
-%state ELEMENT_CONTENT
-%state ELEMENT_MIXED_OR_CHILD
-%state ELEMENT_MIXED
-%state ELEMENT_CHILD
-%state ENTITY_NAME
-%state ENTITY_CONTENT
-%state NDATA_CONTENT
-
-%state NOTATION_NAME
-%state EXTERNALID_CONTENT
-
-%state COMMENT_CONTENT
-%state ATTLIST_NAME
-%state ATTLIST_CONTENT
-%state ATTRIBUTE_CONTENT
-%state ATTRIBUTE_DEFAULT
-%state ATTRIBUTE_ENUMERATION
-
-
-ALPHA=[A-Za-z]
-DIGIT=[0-9]
-NONNEWLINE_WHITE_SPACE_CHAR=[\ \t\b\012]
-STRING_TEXT=(\\\"|[^\n\r\"]|\\{WHITE_SPACE_CHAR}+\\)*
-COMMENT_TEXT=([^*/\n]|[^*\n]"/"[^*\n]|[^/\n]"*"[^/\n]|"*"[^/\n]|"/"[^*\n])*
-Ident = {ALPHA}({ALPHA}|{DIGIT}|_)*
-InputCharacter = [^\r\n]
-
-LineTerminator = \r|\n|\r\n
-
-/* 3 - White Space */
-S = (\x20 | \x09 | \x0D | \x0A)+
-NonLineTerminatorWhitespace = (\x20 | \x09)+
-
-WhiteSpace = {LineTerminator} | [ \t\f]
-
-/* 84 */
-/*Letter = {BaseChar} | {Ideographic}
-
-/* 85 */
-BaseChar = [\u0041-\u005A] | [\u0061-\u007A] | [\u00C0-\u00D6] | [\u00D8-\u00F6] | [\u00F8-\u00FF] | [\u0100-\u0131] | [\u0134-\u013E] | [\u0141-\u0148] | [\u014A-\u017E] | [\u0180-\u01C3] | [\u01CD-\u01F0] | [\u01F4-\u01F5] | [\u01FA-\u0217] | [\u0250-\u02A8] | [\u02BB-\u02C1] | \u0386 | [\u0388-\u038A] | \u038C | [\u038E-\u03A1] | [\u03A3-\u03CE] | [\u03D0-\u03D6] | \u03DA | \u03DC | \u03DE | \u03E0 | [\u03E2-\u03F3] | [\u0401-\u040C] | [\u040E-\u044F] | [\u0451-\u045C] | [\u045E-\u0481] | [\u0490-\u04C4] | [\u04C7-\u04C8] | [\u04CB-\u04CC] | [\u04D0-\u04EB] | [\u04EE-\u04F5] | [\u04F8-\u04F9] | [\u0531-\u0556] | \u0559 | [\u0561-\u0586] | [\u05D0-\u05EA] | [\u05F0-\u05F2] | [\u0621-\u063A] | [\u0641-\u064A] | [\u0671-\u06B7] | [\u06BA-\u06BE] | [\u06C0-\u06CE] | [\u06D0-\u06D3] | \u06D5 | [\u06E5-\u06E6] | [\u0905-\u0939] | \u093D | [\u0958-\u0961] | [\u0985-\u098C] | [\u098F-\u0990] | [\u0993-\u09A8] | [\u09AA-\u09B0] | \u09B2 | [\u09B6-\u09B9] | [\u09DC-\u09DD] | [\u09DF-\u09E1] | [\u09F0-\u09F1] | [\u0A05-\u0A0A] | [\u0A0F-\u0A10] | [\u0A13-\u0A28] | [\u0A2A-\u0A30] | [\u0A32-\u0A33] | [\u0A35-\u0A36] | [\u0A38-\u0A39] | [\u0A59-\u0A5C] | \u0A5E | [\u0A72-\u0A74] | [\u0A85-\u0A8B] | \u0A8D | [\u0A8F-\u0A91] | [\u0A93-\u0AA8] | [\u0AAA-\u0AB0] | [\u0AB2-\u0AB3] | [\u0AB5-\u0AB9] | \u0ABD | \u0AE0 | [\u0B05-\u0B0C] | [\u0B0F-\u0B10] | [\u0B13-\u0B28] | [\u0B2A-\u0B30] | [\u0B32-\u0B33] | [\u0B36-\u0B39] | \u0B3D | [\u0B5C-\u0B5D] | [\u0B5F-\u0B61] | [\u0B85-\u0B8A] | [\u0B8E-\u0B90] | [\u0B92-\u0B95] | [\u0B99-\u0B9A] | \u0B9C | [\u0B9E-\u0B9F] | [\u0BA3-\u0BA4] | [\u0BA8-\u0BAA] | [\u0BAE-\u0BB5] | [\u0BB7-\u0BB9] | [\u0C05-\u0C0C] | [\u0C0E-\u0C10] | [\u0C12-\u0C28] | [\u0C2A-\u0C33] | [\u0C35-\u0C39] | [\u0C60-\u0C61] | [\u0C85-\u0C8C] | [\u0C8E-\u0C90] | [\u0C92-\u0CA8] | [\u0CAA-\u0CB3] | [\u0CB5-\u0CB9] | \u0CDE | [\u0CE0-\u0CE1] | [\u0D05-\u0D0C] | [\u0D0E-\u0D10] | [\u0D12-\u0D28] | [\u0D2A-\u0D39] | [\u0D60-\u0D61] | [\u0E01-\u0E2E] | \u0E30 | [\u0E32-\u0E33] | [\u0E40-\u0E45] | [\u0E81-\u0E82] | \u0E84 | [\u0E87-\u0E88] | \u0E8A | \u0E8D | [\u0E94-\u0E97] | [\u0E99-\u0E9F] | [\u0EA1-\u0EA3] | \u0EA5 | \u0EA7 | [\u0EAA-\u0EAB] | [\u0EAD-\u0EAE] | \u0EB0 | [\u0EB2-\u0EB3] | \u0EBD | [\u0EC0-\u0EC4] | [\u0F40-\u0F47] | [\u0F49-\u0F69] | [\u10A0-\u10C5] | [\u10D0-\u10F6] | \u1100 | [\u1102-\u1103] | [\u1105-\u1107] | \u1109 | [\u110B-\u110C] | [\u110E-\u1112] | \u113C | \u113E | \u1140 | \u114C | \u114E | \u1150 | [\u1154-\u1155] | \u1159 | [\u115F-\u1161] | \u1163 | \u1165 | \u1167 | \u1169 | [\u116D-\u116E] | [\u1172-\u1173] | \u1175 | \u119E | \u11A8 | \u11AB | [\u11AE-\u11AF] | [\u11B7-\u11B8] | \u11BA | [\u11BC-\u11C2] | \u11EB | \u11F0 | \u11F9 | [\u1E00-\u1E9B] | [\u1EA0-\u1EF9] | [\u1F00-\u1F15] | [\u1F18-\u1F1D] | [\u1F20-\u1F45] | [\u1F48-\u1F4D] | [\u1F50-\u1F57] | \u1F59 | \u1F5B | \u1F5D | [\u1F5F-\u1F7D] | [\u1F80-\u1FB4] | [\u1FB6-\u1FBC] | \u1FBE | [\u1FC2-\u1FC4] | [\u1FC6-\u1FCC] | [\u1FD0-\u1FD3] | [\u1FD6-\u1FDB] | [\u1FE0-\u1FEC] | [\u1FF2-\u1FF4] | [\u1FF6-\u1FFC] | \u2126 | [\u212A-\u212B] | \u212E | [\u2180-\u2182] | [\u3041-\u3094] | [\u30A1-\u30FA] | [\u3105-\u312C] | [\uAC00-\uD7A3]
-
-/* 86 */
-Ideographic = [\u4E00-\u9FA5] | \u3007 | [\u3021-\u3029]
-
-/* 4 */ /* is '.' to be escaped?? */
-NameChar = {Letter} | {Digit} | . | - | _ | : | {CombiningChar} | {Extender}
-
-/* 5 */
-Name = ({Letter} | _ | :) {NameChar}*
-
-/* 87 */
-CombiningChar = [\u0300-\u0345] | [\u0360-\u0361] | [\u0483-\u0486] | [\u0591-\u05A1] | [\u05A3-\u05B9] | [\u05BB-\u05BD] | \u05BF | [\u05C1-\u05C2] | \u05C4 | [\u064B-\u0652] | \u0670 | [\u06D6-\u06DC] | [\u06DD-\u06DF] | [\u06E0-\u06E4] | [\u06E7-\u06E8] | [\u06EA-\u06ED] | [\u0901-\u0903] | \u093C | [\u093E-\u094C] | \u094D | [\u0951-\u0954] | [\u0962-\u0963] | [\u0981-\u0983] | \u09BC | \u09BE | \u09BF | [\u09C0-\u09C4] | [\u09C7-\u09C8] | [\u09CB-\u09CD] | \u09D7 | [\u09E2-\u09E3] | \u0A02 | \u0A3C | \u0A3E | \u0A3F | [\u0A40-\u0A42] | [\u0A47-\u0A48] | [\u0A4B-\u0A4D] | [\u0A70-\u0A71] | [\u0A81-\u0A83] | \u0ABC | [\u0ABE-\u0AC5] | [\u0AC7-\u0AC9] | [\u0ACB-\u0ACD] | [\u0B01-\u0B03] | \u0B3C | [\u0B3E-\u0B43] | [\u0B47-\u0B48] | [\u0B4B-\u0B4D] | [\u0B56-\u0B57] | [\u0B82-\u0B83] | [\u0BBE-\u0BC2] | [\u0BC6-\u0BC8] | [\u0BCA-\u0BCD] | \u0BD7 | [\u0C01-\u0C03] | [\u0C3E-\u0C44] | [\u0C46-\u0C48] | [\u0C4A-\u0C4D] | [\u0C55-\u0C56] | [\u0C82-\u0C83] | [\u0CBE-\u0CC4] | [\u0CC6-\u0CC8] | [\u0CCA-\u0CCD] | [\u0CD5-\u0CD6] | [\u0D02-\u0D03] | [\u0D3E-\u0D43] | [\u0D46-\u0D48] | [\u0D4A-\u0D4D] | \u0D57 | \u0E31 | [\u0E34-\u0E3A] | [\u0E47-\u0E4E] | \u0EB1 | [\u0EB4-\u0EB9] | [\u0EBB-\u0EBC] | [\u0EC8-\u0ECD] | [\u0F18-\u0F19] | \u0F35 | \u0F37 | \u0F39 | \u0F3E | \u0F3F | [\u0F71-\u0F84] | [\u0F86-\u0F8B] | [\u0F90-\u0F95] | \u0F97 | [\u0F99-\u0FAD] | [\u0FB1-\u0FB7] | \u0FB9 | [\u20D0-\u20DC] | \u20E1 | [\u302A-\u302F] | \u3099 | \u309A
-
-/* 88 */
-Digit = [\u0030-\u0039] | [\u0660-\u0669] | [\u06F0-\u06F9] | [\u0966-\u096F] | [\u09E6-\u09EF] | [\u0A66-\u0A6F] | [\u0AE6-\u0AEF] | [\u0B66-\u0B6F] | [\u0BE7-\u0BEF] | [\u0C66-\u0C6F] | [\u0CE6-\u0CEF] | [\u0D66-\u0D6F] | [\u0E50-\u0E59] | [\u0ED0-\u0ED9] | [\u0F20-\u0F29]
-
-/* 89 */
-Extender = \u00B7 | \u02D0 | \u02D1 | \u0387 | \u0640 | \u0E46 | \u0EC6 | \u3005 | [\u3031-\u3035] | [\u309D-\u309E] | [\u30FC-\u30FE]
-*/
-
-Letter = [a-zA-Z]
-NameChar = {Letter} | [0-9]
-//Name = ({Letter} | _ | :) {NameChar}*
-//Name = [^\x20\x09\x0D\x0A]+
-Name = [^\x20\x09\x0D\x0A\|,\!\?\+\*\(\)<>]+
-ElementRefName = [^\x20\x09\x0D\x0A\|,\?\+\*\(\)<>]+
-EntityName = [^\x20\x09\x0D\x0A\|,\?\*\(\)<>]+
-ParmEntityName = [^\x20\x09\x0D\x0A\!%;<>]+
-
-CommentStart = \!--
-CommentContent = [^->]+
-CommentEnd = -->
-ElementStart = ELEMENT
-ElementContent = [^<>]*
-
-EntityStart = ENTITY
-Entity_Parm = %{S}
-EntityContent = {S}[^<>]*
-
-NotationStart = NOTATION
-NotationContent = {S}[^<>]*
-AttList = ATTLIST
-ExternalParmEntityRef = %{ParmEntityName};
-EndTag = >
-StartTag = <
-System = SYSTEM
-Public = PUBLIC
-NData = NDATA
-
-// these are attribute type keywords
-// we reuse NOTATION from NotationStart
-// we reuse ENTITY from EntityStart
-CData = CDATA
-ID = ID
-IDRef = IDREF
-IDRefs = IDREFS
-Entities = ENTITIES
-NMToken = NMTOKEN
-NMTokens = NMTOKENS
-
-// these are attribute defaults keywords
-Required = #REQUIRED
-Implied = #IMPLIED
-Fixed = #FIXED
-
-
-Empty = EMPTY
-Any = ANY
-PcData = #PCDATA
-LeftParen = \(
-RightParen = \)
-
-Percent = %
-Semicolon = ;
-Plus = \+
-Choice = \|
-Sequence = ,
-Connector = {Choice}|{Sequence}
-OccurOptional = \?
-OccurOneOrMore = \+
-OccurZeroOrMore = \*
-OccurType = {OccurOptional}|{OccurOneOrMore}|{OccurZeroOrMore}
-Exclamation = \!
-SingleQuotedLiteral = '[^']*'
-DoubleQuotedLiteral = \"[^\"]*\"
-NonTagContent = [^\x20\x09\x0D\x0A<>]*
-NonEnumContent = [^\x20\x09\x0D\x0A<>\(\)\|]*
-%%
-
-<YYINITIAL> {
- {StartTag} { return createToken(DTDRegionTypes.START_TAG); }
- {EndTag} { return createToken(DTDRegionTypes.END_TAG); }
- {Exclamation} { return createToken(DTDRegionTypes.EXCLAMATION); }
- {Percent} { return createToken(DTDRegionTypes.PERCENT); }
- {Semicolon} { return createToken(DTDRegionTypes.SEMICOLON); }
-
- {ElementStart} { yybegin(ELEMENT_NAME); return createToken(DTDRegionTypes.ELEMENT_TAG); }
- {CommentStart} { yybegin(COMMENT_CONTENT); return createToken(DTDRegionTypes.COMMENT_START); }
- {EntityStart} { yybegin(ENTITY_NAME); return createToken(DTDRegionTypes.ENTITY_TAG); }
- {NotationStart} { yybegin(NOTATION_NAME); return createToken(DTDRegionTypes.NOTATION_TAG); }
- {AttList} { yybegin(ATTLIST_NAME); return createToken(DTDRegionTypes.ATTLIST_TAG); }
-
- {ExternalParmEntityRef} { return createToken(DTDRegionTypes.ENTITY_PARM); }
-// just a parmentityname by itself is no good. we use this
-// to capture garbage content at the top level
- {ParmEntityName} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
-
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
-}
-
-<ELEMENT_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {PcData}|\({S}*{PcData}{S}*\) { return createToken(DTDRegionTypes.CONTENT_PCDATA); }
- {Name} { return createToken(DTDRegionTypes.NAME); }
-
- {LeftParen} { return createToken(DTDRegionTypes.LEFT_PAREN); }
- {Connector} { return createToken(DTDRegionTypes.CONNECTOR); }
- {OccurType} { return createToken(DTDRegionTypes.OCCUR_TYPE); }
- {RightParen} { return createToken(DTDRegionTypes.RIGHT_PAREN); }
-
- {StartTag} { yypushback(yylength()); yybegin(YYINITIAL); }
- {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-// ******** <!ATTLIST...>
-<ATTLIST_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Name} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.NAME); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTLIST_CONTENT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Name} { yybegin(ATTRIBUTE_CONTENT); return createToken(DTDRegionTypes.ATTRIBUTE_NAME); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_CONTENT> {
- {LineTerminator} { yypushback(yylength()); yybegin(ATTLIST_CONTENT); }
- {NonLineTerminatorWhitespace}
- { return createToken(DTDRegionTypes.WHITESPACE); }
- {CData} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.CDATA_KEYWORD); }
-
- {ID} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ID_KEYWORD); }
- {IDRef} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREF_KEYWORD); }
- {IDRefs} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.IDREFS_KEYWORD); }
- {EntityStart} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITY_KEYWORD); }
- {Entities} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.ENTITIES_KEYWORD); }
- {NMToken} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKEN_KEYWORD); }
- {NMTokens} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.NMTOKENS_KEYWORD); }
- {NotationStart} { yybegin(ATTRIBUTE_ENUMERATION); return createToken(DTDRegionTypes.NOTATION_KEYWORD); }
-
- {Required} | {Implied} | {Fixed} | {SingleQuotedLiteral} | { DoubleQuotedLiteral}
- { yypushback(yylength()); yybegin(ATTRIBUTE_DEFAULT); }
-
- {LeftParen} { yypushback(yylength()); yybegin(ATTRIBUTE_ENUMERATION); }
- {NonEnumContent} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.PARM_ENTITY_TYPE); }
- {NonEnumContent}|{RightParen}|{Choice} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_DEFAULT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Required} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.REQUIRED_KEYWORD); }
- {Implied} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.IMPLIED_KEYWORD); }
- {Fixed} { return createToken(DTDRegionTypes.FIXED_KEYWORD); }
- {SingleQuotedLiteral} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- {DoubleQuotedLiteral} { yybegin(ATTLIST_CONTENT); return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- {NonTagContent} { yypushback(yylength()); yybegin(ATTLIST_CONTENT); } //return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ATTRIBUTE_ENUMERATION> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {LeftParen} { return createToken(DTDRegionTypes.LEFT_PAREN); }
- {Choice} { return createToken(DTDRegionTypes.ENUM_CHOICE); }
- {RightParen} { yybegin(ATTRIBUTE_DEFAULT); return createToken(DTDRegionTypes.RIGHT_PAREN); }
- {NonEnumContent} { return createToken(DTDRegionTypes.NAME); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!ENTITY...>
-<ENTITY_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Percent} { return createToken(DTDRegionTypes.PERCENT); }
- {EntityName} { yybegin(ENTITY_CONTENT); return createToken(DTDRegionTypes.NAME); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<ENTITY_CONTENT> {
-// {EntityContent} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.ENTITY_CONTENT); }
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {System} | {Public} { yypushback(yylength()); yybegin(EXTERNALID_CONTENT); }
- {SingleQuotedLiteral} { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- {DoubleQuotedLiteral} { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!NOTATION...>
-<NOTATION_NAME> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {Name} { yybegin(EXTERNALID_CONTENT); return createToken(DTDRegionTypes.NAME); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<EXTERNALID_CONTENT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {System} { return createToken(DTDRegionTypes.SYSTEM_KEYWORD); }
- {Public} { return createToken(DTDRegionTypes.PUBLIC_KEYWORD); }
- {SingleQuotedLiteral} { return createToken(DTDRegionTypes.SINGLEQUOTED_LITERAL); }
- {DoubleQuotedLiteral} { return createToken(DTDRegionTypes.DOUBLEQUOTED_LITERAL); }
- {NData} { yybegin(NDATA_CONTENT); return createToken(DTDRegionTypes.NDATA_KEYWORD); }
- {NonTagContent} { return createToken(DTDRegionTypes.UNKNOWN_CONTENT); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-<NDATA_CONTENT> {
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {NonTagContent} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.NDATA_VALUE); }
- {StartTag} | {EndTag} { yypushback(yylength()); yybegin(YYINITIAL); }
-}
-
-
-// ******** <!-- ...>
-<COMMENT_CONTENT> {
- {CommentEnd} { yybegin(YYINITIAL); return createToken(DTDRegionTypes.COMMENT_END); }
- {S} { return createToken(DTDRegionTypes.WHITESPACE); }
- {CommentContent} | "-" | ">" { return createToken(DTDRegionTypes.COMMENT_CONTENT); }
-}
-
-
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDBatchNodeDelete.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDBatchNodeDelete.java
deleted file mode 100644
index 9f7109d09b..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDBatchNodeDelete.java
+++ /dev/null
@@ -1,57 +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.dtd.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-
-
-public class DTDBatchNodeDelete {
- protected DTDFile dtdFile;
-
- protected List nodes = new ArrayList();
-
- public DTDBatchNodeDelete(DTDFile dtdFile) {
- this.dtdFile = dtdFile;
- }
-
- public void addNode(DTDNode node) {
- // first check if the node is contained by anyone
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
-
- if (currentNode.containsRange(node.getStartOffset(), node.getEndOffset())) {
- // then no need to add the node to the list to be deleted
- return;
- }
-
- if (node.getStartOffset() < currentNode.getStartOffset() && node.getEndOffset() <= currentNode.getStartOffset()) {
- nodes.add(i, node);
- return;
- }
- }
- // if we get here, then add it to the end
- nodes.add(node);
- }
-
- public void deleteNodes(Object requestor) {
- for (int i = nodes.size() - 1; i >= 0; i--) {
- DTDNode node = (DTDNode) nodes.get(i);
- dtdFile.deleteNode(requestor, (DTDNode) nodes.get(i));
- }
- nodes.clear();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDExternalReferenceRemover.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDExternalReferenceRemover.java
deleted file mode 100644
index 168cc09b05..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDExternalReferenceRemover.java
+++ /dev/null
@@ -1,145 +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.dtd.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.CMBasicNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.Entity;
-
-
-/*
- * This class is responsible for updating the model when items are deleted or
- * so that items referenced by it are cleaned up note that top level nodes are
- * queued up for deletion so that iteration over the list of nodes from the
- * dtdfile is not messed up. Note that when an external parmeter entity
- * changes, the client of the model (e.g. editor) must be a DTDFileListener
- * implementing the listener's interface to keep the model's referential
- * integrity (See DTDModelImpl for example).
- */
-
-public class DTDExternalReferenceRemover extends DTDVisitor {
-
- protected DTDBatchNodeDelete batchDelete;
- protected List externalElementsAndParmEntities = new ArrayList();
-
- protected boolean isParmEntity = false;
-
- protected boolean isUpdating = false;
- protected DTDNode nodeToDelete;
- protected String oldRefName = ""; //$NON-NLS-1$
- protected Object requestor;
-
- public DTDExternalReferenceRemover() {
-
- }
-
- public synchronized void externalReferenceAboutToChange(Object requestor, Entity entity) {
- if (isUpdating) {
- return;
- }
- if (!entity.isParameterEntity() || !entity.isExternalEntity()) {
- // if it is not an external parameter entity, ignore as well
- return;
- }
-
- isUpdating = true;
- this.requestor = requestor;
-
- DTDFile dtdFile = entity.getDTDFile();
- if (batchDelete == null) {
- batchDelete = new DTDBatchNodeDelete(dtdFile);
- }
-
- // See the comment at the head of this file regarding
- // external parameter entities.
- //externalElementsAndParmEntities =
- // dtdFile.getDTDModel().getExternalModels().getElementContentNames(entity.getPublicID(),
- // dtdFile.getDTDModel().resolveID(entity.getPublicID(),
- // entity.getSystemID()));
-
- visit(dtdFile);
-
- batchDelete.deleteNodes(requestor);
-
- isUpdating = false;
- }
-
- public boolean isMatchingName(String name) {
- return externalElementsAndParmEntities.contains(name);
- }
-
- public void visitAttribute(Attribute attr) {
- super.visitAttribute(attr);
- String attrName = attr.getName();
- String attrType = attr.getType();
-
- if (isParameterEntityRef(attrName)) {
- if (isMatchingName(attrName)) {
- attr.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- if (isParameterEntityRef(attrType)) {
- if (isMatchingName(attrType)) {
- attr.setType(requestor, Attribute.CDATA);
- }
- }
- }
-
- public void visitAttributeList(AttributeList attList) {
- super.visitAttributeList(attList);
- String attListName = attList.getName();
- if (isParameterEntityRef(attListName)) {
- if (isMatchingName(attListName)) {
- attList.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- }
-
- public void visitElement(Element element) {
- String elementName = element.getName();
- if (isParameterEntityRef(elementName)) {
- if (isMatchingName(elementName)) {
- element.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- super.visitElement(element);
- }
-
- public void visitReference(CMBasicNode node) {
- super.visitReference(node);
- String refName = node.getName();
- if (isMatchingName(refName)) {
- DTDNode parent = (DTDNode) node.getParentNode();
- batchDelete.addNode(node);
- // parent.delete(requestor, node);
- }
- }
-
- // public void
- // visitExternalParameterEntityReference(ParameterEntityReference
- // parmEntityRef)
- // {
- // super.visitExternalParameterEntityReference(parmEntityRef);
- // if (isParmEntity && parmEntityRef.getName().equals(oldRefName))
- // {
- // nodesToDelete.add(parmEntityRef);
- // }
- // }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDModelUpdater.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDModelUpdater.java
deleted file mode 100644
index fa2d0f9c8d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDModelUpdater.java
+++ /dev/null
@@ -1,135 +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.dtd.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.CMBasicNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.Entity;
-import org.eclipse.wst.dtd.core.ParameterEntityReference;
-
-
-// this class is responsible for updating the model when items
-// are deleted or a external parm entity changes so that
-// items referenced by it are cleaned up
-// note that top level nodes are queued up for deletion so that
-// iteration over the list of nodes from the dtdfile is not messed up
-public class DTDModelUpdater extends DTDVisitor {
-
- protected boolean isParmEntity = false;
-
- protected boolean isUpdating = false;
-
- protected List nodesToDelete = new ArrayList();
- protected DTDNode nodeToDelete;
- protected String oldRefName = ""; //$NON-NLS-1$
- protected Object requestor;
-
- public DTDModelUpdater() {
-
- }
-
- public synchronized void objectAboutToBeDeleted(Object requestor, DTDNode node) {
- if (isUpdating) {
- return;
- }
- if (!(node instanceof Entity || node instanceof Element)) {
- // just ignore if it is not one of these
- return;
- }
- if (node instanceof Entity && !((Entity) node).isParameterEntity()) {
- // if it is not a parameter entity, ignore as well
- return;
- }
-
-
- isUpdating = true;
- this.requestor = requestor;
- this.nodeToDelete = node;
- oldRefName = node.getName();
- isParmEntity = false;
- nodesToDelete.clear();
-
- if (node instanceof Entity) {
- Entity entity = (Entity) node;
- isParmEntity = true;
- oldRefName = "%" + oldRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- DTDFile dtdFile = node.getDTDFile();
- visit(dtdFile);
-
- for (int i = 0; i < nodesToDelete.size(); i++) {
- dtdFile.deleteNode(requestor, (DTDNode) nodesToDelete.get(i));
- }
-
- isUpdating = false;
- }
-
- public void visitAttribute(Attribute attr) {
- super.visitAttribute(attr);
- if (isParmEntity) {
- if (attr.getName().equals(oldRefName)) {
- attr.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- if (attr.getType().equals(oldRefName)) {
- attr.setType(requestor, Attribute.CDATA);
- }
- }
- // check the attr name and the attr type to see if it
- // needs updating
- }
-
- public void visitAttributeList(AttributeList attList) {
- super.visitAttributeList(attList);
- if (attList.getName().equals(oldRefName)) {
- if (isParmEntity) {
- attList.setName(requestor, "TempName"); //$NON-NLS-1$
- } else {
- // save up for later deletion
- nodesToDelete.add(attList);
- }
- }
- }
-
- public void visitElement(Element element) {
- if (isParmEntity) {
- if (element.getName().equals(oldRefName)) {
- element.setName(requestor, "TempName"); //$NON-NLS-1$
- }
- }
- super.visitElement(element);
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- super.visitExternalParameterEntityReference(parmEntityRef);
- if (isParmEntity && parmEntityRef.getName().equals(oldRefName)) {
- nodesToDelete.add(parmEntityRef);
- }
- }
-
- public void visitReference(CMBasicNode node) {
- super.visitReference(node);
-
- if (node.getName().equals(oldRefName)) {
- DTDNode parent = (DTDNode) node.getParentNode();
- parent.delete(requestor, node);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDNotationReferenceRemover.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDNotationReferenceRemover.java
deleted file mode 100644
index cbcb9edabb..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDNotationReferenceRemover.java
+++ /dev/null
@@ -1,92 +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.dtd.core.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeEnumList;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Entity;
-import org.eclipse.wst.dtd.core.Notation;
-
-
-public class DTDNotationReferenceRemover {
- protected Notation notation;
- protected String notationName;
-
- protected Object requestor;
-
- public DTDNotationReferenceRemover() {
-
- }
-
- public void notationAboutToBeDeleted(Object requestor, Notation notation) {
- this.requestor = requestor;
- this.notation = notation;
- notationName = notation.getName();
-
- visit(notation.getDTDFile());
- }
-
- public void visit(DTDFile file) {
- List nodes = file.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
- if (currentNode instanceof Entity) {
- visitEntity((Entity) currentNode);
- } else if (currentNode instanceof AttributeList) {
- visitAttributeList((AttributeList) currentNode);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- if (attr.getType().equals(Attribute.ENUMERATED_NOTATION)) {
- AttributeEnumList enumList = attr.getEnumList();
- List notationNames = enumList.getItems();
- Iterator iter = notationNames.iterator();
- boolean updateRequired = false;
- while (iter.hasNext()) {
- String notation = (String) iter.next();
- if (notation.equals(notationName)) {
- updateRequired = true;
- iter.remove();
- }
- }
- if (updateRequired) {
- String[] newItems = new String[notationNames.size()];
- notationNames.toArray(newItems);
- enumList.setItems(requestor, newItems);
- }
- }
- }
-
- public void visitAttributeList(AttributeList attList) {
- Attribute attr = (Attribute) attList.getFirstChild();
- while (attr != null) {
- visitAttribute(attr);
- attr = (Attribute) attr.getNextSibling();
- }
- }
-
- public void visitEntity(Entity entity) {
- if (entity.getNotationName().equals(notationName)) {
- entity.setNotationName(requestor, ""); //$NON-NLS-1$
- }
- }
-
-}// DTDNotationRemover
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDReferenceUpdater.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDReferenceUpdater.java
deleted file mode 100644
index 79bfcf2d1d..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDReferenceUpdater.java
+++ /dev/null
@@ -1,192 +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.dtd.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeEnumList;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.CMBasicNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.Entity;
-import org.eclipse.wst.dtd.core.Notation;
-import org.eclipse.wst.dtd.core.ParameterEntityReference;
-
-
-// this class is responsible for updating any dtd node in
-// response to a change in the node that they reference
-public class DTDReferenceUpdater extends DTDVisitor {
- protected boolean isNotation = false;
-
- protected boolean isParmEntity = false;
-
- protected boolean isUpdating = false;
- protected String newName = ""; //$NON-NLS-1$
- protected String oldRefName = "", newRefName = ""; //$NON-NLS-1$ //$NON-NLS-2$
- protected DTDNode referencedNode = null;
-
- // the references List is a cache of the DTDNodes that are changed
- // as a result of a call to nameAboutToChange(). The idea is that
- // if a subsequent call comes in that changes the name of the same
- // object for which this cache exists for, then we optimize the
- // path by just walking the cache
- private List references = new ArrayList();
- protected Object requestor;
-
- public DTDReferenceUpdater() {
-
- }
-
- public void clearCache() {
- referencedNode = null;
- references.clear();
- }
-
- public synchronized void nameAboutToChange(Object requestor, DTDNode referencedNode, String newName) {
- if (isUpdating) {
- return;
- }
- if (!(referencedNode instanceof Entity || referencedNode instanceof Element || referencedNode instanceof Notation)) {
- // just ignore if it is not one of these
- return;
- }
- if (referencedNode instanceof Entity && !((Entity) referencedNode).isParameterEntity()) {
- // if it is not a parameter entity, ignore as well
- return;
- }
-
- isUpdating = true;
- this.requestor = requestor;
- oldRefName = referencedNode.getName();
- this.newName = newRefName = newName;
- isParmEntity = false;
- isNotation = referencedNode instanceof Notation;
-
- if (referencedNode instanceof Entity) {
- Entity entity = (Entity) referencedNode;
- isParmEntity = true;
- oldRefName = "%" + oldRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- newRefName = "%" + newRefName + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if (this.referencedNode != null) {
- // check if the previous referenced node that was changed
- // is the same as the one that is coming in. if so, just
- // change the previous regions
- if (this.referencedNode == referencedNode) {
- quickUpdate();
- isUpdating = false;
- return;
- }
- }
-
- // clear the cache if we get here
- this.referencedNode = referencedNode;
- references.clear();
- DTDFile dtdFile = referencedNode.getDTDFile();
- visit(dtdFile);
- isUpdating = false;
- }
-
- protected void quickUpdate() {
- for (int i = 0; i < references.size(); i++) {
- DTDNode node = (DTDNode) references.get(i);
- if (node instanceof Element) {
- visitElement((Element) node);
- } else if (node instanceof AttributeList) {
- visitAttributeList((AttributeList) node);
- } else if (node instanceof Attribute) {
- visitAttribute((Attribute) node);
- } else if (node instanceof CMBasicNode) {
- visitReference((CMBasicNode) node);
- } else if (node instanceof ParameterEntityReference) {
- visitExternalParameterEntityReference((ParameterEntityReference) node);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- super.visitAttribute(attr);
- if (isParmEntity) {
- // check the attr name and the attr type to see if it
- // needs updating
- if (attr.getName().equals(oldRefName)) {
- attr.setName(requestor, newRefName);
- references.add(attr);
- }
- if (attr.getType().equals(oldRefName)) {
- attr.setType(requestor, newRefName);
- references.add(attr);
- }
- } else if (isNotation && attr.getType().equals(Attribute.ENUMERATED_NOTATION)) {
- AttributeEnumList enumList = attr.getEnumList();
- List items = enumList.getItems();
- boolean updateNeeded = false;
- for (int i = 0; i < items.size(); i++) {
- String notationName = (String) items.get(i);
- if (notationName.equals(oldRefName)) {
- updateNeeded = true;
- items.set(i, newName);
- }
- }
- if (updateNeeded) {
- String[] newItems = new String[items.size()];
-
- enumList.setItems((String[]) items.toArray(newItems));
- }
- }
-
- }
-
- public void visitAttributeList(AttributeList attList) {
- if (!isNotation && attList.getName().equals(oldRefName)) {
- attList.setName(requestor, newRefName);
- references.add(attList);
- }
- super.visitAttributeList(attList);
- }
-
- public void visitElement(Element element) {
- if (isParmEntity) {
- if (element.getName().equals(oldRefName)) {
- element.setName(requestor, newRefName);
- references.add(element);
- }
- }
- super.visitElement(element);
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- super.visitExternalParameterEntityReference(parmEntityRef);
- if (parmEntityRef.getName().equals(oldRefName)) {
- parmEntityRef.setReferencedEntity(requestor, newName);
- references.add(parmEntityRef);
- }
- }
-
- public void visitReference(CMBasicNode node) {
- super.visitReference(node);
- if (isParameterEntityRef(oldRefName) && !isParmEntity) {
- return;
- }
-
- if (node.getName().equals(oldRefName)) {
- node.setName(requestor, newRefName);
- references.add(node);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDSAXParser.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDSAXParser.java
deleted file mode 100644
index 04f0971a63..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDSAXParser.java
+++ /dev/null
@@ -1,170 +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.dtd.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.SAXParser;
-
-import org.xml.sax.Parser;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-
-/**
- * TODO: Kihup and Nitin, reevaluate the use and implementation of this class
- */
-
-//import org.apache.xerces.parsers.SAXParser;
-//import org.apache.xerces.xni.Augmentations;
-//import org.apache.xerces.xni.XMLLocator;
-//import org.apache.xerces.xni.XMLString;
-//import org.apache.xerces.xni.XNIException;
-public class DTDSAXParser extends SAXParser {
-
- private List ignoredEntityRefs = new ArrayList();
-
- // private XMLLocator locator;
- //
- public List getIgnoredEntityRefs() {
- return ignoredEntityRefs;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see javax.xml.parsers.SAXParser#getParser()
- */
- public Parser getParser() throws SAXException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.xml.parsers.SAXParser#getProperty(java.lang.String)
- */
- public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.xml.parsers.SAXParser#getXMLReader()
- */
- public XMLReader getXMLReader() throws SAXException {
- // TODO Auto-generated method stub
- return null;
- }
-
- //
- // public XMLLocator getLocator()
- // {
- // return locator;
- // }
- //
- // public void startDocument
- // (XMLLocator locator,
- // String encoding,
- // Augmentations augs)
- // {
- // this.locator = locator;
- // super.startDocument(locator,encoding,augs);
- // }
- //
- // public void ignoredCharacters(XMLString text, Augmentations augs)
- // throws XNIException
- // {
- // String s =
- // text.length > 0 ? new String(text.ch,text.offset,text.length) : "";
- // //System.out.println("ignoredCharacters: " + s);
- //
- // StringTokenizer tokenizer = new StringTokenizer(s,";");
- // try
- // {
- // String token = null;
- // while (tokenizer.hasMoreTokens())
- // {
- // token = tokenizer.nextToken();
- // if (isEntityRef(token))
- // registerEntityRef(token);
- // }
- // }
- // catch (NoSuchElementException e)
- // {
- // e.printStackTrace();
- // }
- // }
- //
- // TODO: never used
- boolean isEntityRef(String token) {
- // Looking for the pattern "nnnn%nnnnn".
- if (token.indexOf('%') != -1)
- return true; // candidate for entity reference
- else
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.xml.parsers.SAXParser#isNamespaceAware()
- */
- public boolean isNamespaceAware() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.xml.parsers.SAXParser#isValidating()
- */
- public boolean isValidating() {
- // TODO Auto-generated method stub
- return false;
- }
-
- // TODO: never used
- void registerEntityRef(String token) {
- int index = token.lastIndexOf('%');
- if (index == -1)
- return;
-
- String refName = token.substring(index, token.length());
- //System.out.println("entity ref name is: " + refName);
- if (refName.indexOf(' ') != -1 || refName.indexOf('\t') != -1 || refName.indexOf('\n') != -1)
- return;
- else
- // we found entity reference
- ignoredEntityRefs.add(refName + ";"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.xml.parsers.SAXParser#setProperty(java.lang.String,
- * java.lang.Object)
- */
- public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDUniqueNameHelper.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDUniqueNameHelper.java
deleted file mode 100644
index 1555c24238..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDUniqueNameHelper.java
+++ /dev/null
@@ -1,91 +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.dtd.core.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.CMBasicNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.Entity;
-import org.eclipse.wst.dtd.core.Notation;
-
-
-public class DTDUniqueNameHelper {
-
- static public String getName(Object obj) {
- if (obj instanceof Element) {
- return ((Element) obj).getName();
- } else if (obj instanceof Entity) {
- return ((Entity) obj).getName();
- } else if (obj instanceof Notation) {
- return ((Notation) obj).getName();
- } else if (obj instanceof Attribute) {
- return ((Attribute) obj).getName();
- } else if (obj instanceof CMBasicNode) // Model Group Content
- {
- return ((CMBasicNode) obj).getName();
- }
- return ""; //$NON-NLS-1$
- }
-
- static public String getUniqueAttributeName(Element element) {
- List attrs = element.getElementAttributes();
- return getUniqueName(attrs, "NewAttribute"); //$NON-NLS-1$
- }
-
- static public String getUniqueElementName(DTDFile dtdFile) {
- List elements = dtdFile.getElementsAndParameterEntityReferences().getNodes();
- return getUniqueName(elements, "NewElement"); //$NON-NLS-1$
- }
-
- static public String getUniqueEntityName(DTDFile dtdFile) {
- List entities = dtdFile.getEntities().getNodes();
- return getUniqueName(entities, "NewEntity"); //$NON-NLS-1$
- }
-
- static public String getUniqueName(List objs, String token) {
- int counter = 1;
-
- boolean uniqueName = false;
- while (!uniqueName) {
- String newName = token + new Integer(counter++);
- uniqueName = true;
- Iterator iter = objs.iterator();
- while (iter.hasNext()) {
- Object obj = iter.next();
- String objName = getName(obj);
- if (objName.equals(newName)) {
- uniqueName = false;
- break;
- }
- }
- if (uniqueName) {
- return newName;
- }
- }
- // we shouldn't get here
- return "No Name found"; //$NON-NLS-1$
- }
-
- static public String getUniqueNotationName(DTDFile dtdFile) {
- List notations = dtdFile.getNotations().getNodes();
- return getUniqueName(notations, "NewNotation"); //$NON-NLS-1$
- }
-
- public DTDUniqueNameHelper() {
- }
-
-} // DTDUniqueNameHelper
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDVisitor.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDVisitor.java
deleted file mode 100644
index 2544de7bd4..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/DTDVisitor.java
+++ /dev/null
@@ -1,105 +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.dtd.core.util;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.CMBasicNode;
-import org.eclipse.wst.dtd.core.CMGroupNode;
-import org.eclipse.wst.dtd.core.CMNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.ParameterEntityReference;
-
-
-public class DTDVisitor {
-
- public DTDVisitor() {
-
- }
-
- // utility method
- public boolean isParameterEntityRef(String reference) {
- if (reference.length() > 0) {
- return reference.charAt(0) == '%' && reference.charAt(reference.length() - 1) == ';';
- }
- return false;
- }
-
- public void visit(DTDFile file) {
- List nodes = file.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- DTDNode currentNode = (DTDNode) nodes.get(i);
- if (currentNode instanceof Element) {
- visitElement((Element) currentNode);
- } else if (currentNode instanceof AttributeList) {
- visitAttributeList((AttributeList) currentNode);
- } else if (currentNode instanceof ParameterEntityReference) {
- visitExternalParameterEntityReference((ParameterEntityReference) currentNode);
- }
- }
- }
-
- public void visitAttribute(Attribute attr) {
- }
-
- public void visitAttributeList(AttributeList attList) {
- // note that we don't visit attributes here because we
- // want the element to visit them with it's consolidated list
- // that it creates by gathering all attribute lists together
- }
-
- public void visitAttributes(List attributes) {
- int size = attributes.size();
- for (int i = 0; i < size; i++) {
- Attribute attr = (Attribute) attributes.get(i);
- visitAttribute(attr);
- }
- }
-
- public void visitContentNode(CMNode content) {
- if (content instanceof CMBasicNode) {
- CMBasicNode basicNode = (CMBasicNode) content;
- if (basicNode.isReference()) {
- visitReference(basicNode);
- }
- } else if (content instanceof CMGroupNode) {
- visitGroupNode((CMGroupNode) content);
- }
- }
-
- public void visitElement(Element element) {
- CMNode content = element.getContentModel();
- visitContentNode(content);
- visitAttributes(element.getElementAttributes());
- }
-
- public void visitExternalParameterEntityReference(ParameterEntityReference parmEntityRef) {
- }
-
- public void visitGroupNode(CMGroupNode group) {
- List children = group.getChildrenList();
- int size = children.size();
- for (int i = 0; i < size; i++) {
- visitContentNode((CMNode) children.get(i));
- }
- }
-
- public void visitReference(CMBasicNode node) {
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/LabelValuePair.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/LabelValuePair.java
deleted file mode 100644
index 5f04ceb065..0000000000
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/util/LabelValuePair.java
+++ /dev/null
@@ -1,30 +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.dtd.core.util;
-
-import org.eclipse.jface.util.Assert;
-
-public class LabelValuePair {
-
- public String fLabel;
- public Object fValue;
-
- /**
- * Creates a new name/value item
- */
- public LabelValuePair(String label, Object value) {
- Assert.isTrue(label != null);
- fLabel = label;
- fValue = value;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/.classpath b/bundles/org.eclipse.wst.dtd.ui/.classpath
deleted file mode 100644
index df094ee4a7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.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.dtd.ui/.compatibility b/bundles/org.eclipse.wst.dtd.ui/.compatibility
deleted file mode 100644
index 3ea4f291b1..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.compatibility
+++ /dev/null
@@ -1,2 +0,0 @@
-#Wed Mar 24 13:53:52 EST 2004
-.project=4140
diff --git a/bundles/org.eclipse.wst.dtd.ui/.cvsignore b/bundles/org.eclipse.wst.dtd.ui/.cvsignore
deleted file mode 100644
index 4f388b8264..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-
-build.xml
-dtdeditor.jar
-temp.folder
-org.eclipse.wst.dtd.ui_1.0.0.jar
diff --git a/bundles/org.eclipse.wst.dtd.ui/.project b/bundles/org.eclipse.wst.dtd.ui/.project
deleted file mode 100644
index 16b209c4e8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.dtd.ui</name>
- <comment></comment>
- <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.dtd.ui/README.txt b/bundles/org.eclipse.wst.dtd.ui/README.txt
deleted file mode 100644
index 5a653feed2..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-The dtd implementation of the sse editor. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.dtd.ui/build.properties b/bundles/org.eclipse.wst.dtd.ui/build.properties
deleted file mode 100644
index 88b9844830..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/build.properties
+++ /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
-# Jens Lukowski/Innoopract - initial renaming/restructuring
-#
-###############################################################################
-bin.includes = plugin.xml,\
- *.jar,\
- dtd.jar,\
- icons/,\
- plugin.properties
-source.dtdeditor.jar = src/
-src.includes = plugin.xml,\
- icons/,\
- build.xml,\
- plugin.properties
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif b/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif
deleted file mode 100644
index 211c437fa9..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/DTDFile.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a8236b8d7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif
deleted file mode 100644
index 8168fb34f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/ctool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif
deleted file mode 100644
index a7fb780c77..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif
deleted file mode 100644
index 3755e5e42e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a58e11192..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif
deleted file mode 100644
index d525a21e73..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/dtool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif
deleted file mode 100644
index 00bb7b475d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Attribute.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif
deleted file mode 100644
index 01f4889869..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_Element.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif
deleted file mode 100644
index 1a8236b8d7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_ElementToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif
deleted file mode 100644
index 8168fb34f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/etool16/ADD_GroupToConModel.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif
deleted file mode 100644
index 39611d6c63..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Comment.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif
deleted file mode 100644
index cb415064e0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif
deleted file mode 100644
index 5efa9b905e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Entity_Reference.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif
deleted file mode 100644
index 57ad089a69..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/ADD_Notation.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif
deleted file mode 100644
index 093c6bad04..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/organize_dtd_logically.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif
deleted file mode 100644
index 23c5d0b11c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/sort.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif b/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif
deleted file mode 100644
index 86196e996f..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/full/obj16/validate.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.dtd.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.properties b/bundles/org.eclipse.wst.dtd.ui/plugin.properties
deleted file mode 100644
index 1a48cf95ab..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.properties
+++ /dev/null
@@ -1,350 +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
-#
-###############################################################################
-SSE_DTD_Source_Editor.name=SSE DTD Source Editor
-SSE_DTD_Source_Editor_NL_Support.name=SSE DTD Source Editor NL Support
-DTD_Source_Page_Editor.name=DTD Source Page Editor
-! Properties file for component: XMDTD - XML Tools DTD Editor
-! Packaged for translation in: xml.zip
-
-!plugin.xml
-_UI_PLUGIN_NAME=DTD Editor
-_UI_EDITOR_NAME=DTD Editor
-_UI_WIZARD_NEW_DTD=DTD File
-_UI_CREATE_NEW_DTD_FILE=Create a new DTD file
-_UI_XML_TOOLS_PREFERENCE_PAGE=XML
-_UI_DTD_EDITOR_PREFERENCE=DTD
-
-! GenerateDTDActionDelegate - XML validation check
-_UI_DIALOG_TITLE_XML_ERROR=Invalid XML
-_UI_DIALOG_INFO_XML_INVALID=IWAK0090I The XML file contains errors. Open it in the XML editor and validate it for details.
-
-!
-! Preference Page
-!
-_UI_SEPARATE_DESIGN_AND_SOURCE_VIEW=Separate design and source view
-_UI_COMBINED_DESIGN_AND_SOURCE_VIEW=Combined design and source view
-_UI_LABEL_EDITOR_LAYOUT=Editor Layout
-_UI_LABEL_DTD_FILES=DTD Files
-_UI_LABEL_DTD_STYLES=DTD Styles
-
-!AddAttributeAction
-_UI_DEFAULT_NEW_ATTRIBUTE=Attribute
-_UI_ACTION_DTD_ADD_ATTRIBUTE=Add Attribute
-_UI_ACTION_DTD_ADD_ELEMENT=Add Element
-
-!actions/AddGroupToContentModelAction.java
-_UI_ACTION_ADD_GROUP=Add &Group
-
-!AddEntityAction
-_UI_ACTION_ADD_ENTITY=Add &Entity
-
-
-! Flat Page Header Text
-_UI_PAGE_HEADING_ELEMENT=Element
-_UI_PAGE_HEADING_ATTRIBUTE=Attribute
-_UI_PAGE_HEADING_NOTATION=Notation
-_UI_PAGE_HEADING_PARAM_ENTITY_REF=External Parameter Entity Reference
-_UI_PAGE_HEADING_ENTITY=Entity
-_UI_PAGE_HEADING_COMMENT=Comment
-_UI_PAGE_HEADING_ATTLIST=Attribute List
-_UI_PAGE_HEADING_CONTENT_MODEL=Content Model
-_UI_PAGE_HEADING_CONTENT_MODEL_GROUP=Content Model Group
-
-!BlankWindow
-_UI_LABEL_VIEW_NOT_AVAILABLE=View is not available for selected object.
-
-!AttributeWindow
-_UI_ACTION_NOTATION_INFO=Attribute Information
-_UI_LABEL_ATTRIBUTE_NAME=Name:
-_UI_LABEL_ATTRIBUTE_TYPE=Type:
-_UI_RADIO_DEFAULT=Default
-_UI_GROUP_ENUMERATED_DEFAULTS=Enumerated defaults
-_UI_BUTTON_ADD=Add >>
-_UI_BUTTON_REMOVE=<< Remove
-_UI_CHKBOX_DEFAULT=Default
-_UI_GROUP_ELEMENT_COMMENT=Comment
-_UI_CHKBOX_ENUMERATED_DEFAULT=Default
-_UI_CHKBOX_NOTATION_COMBO=Default
-_UI_GROUP_ATTRIBUTE=Attribute default value
-
-!ContentWindow & ElementWindow
-_UI_LABEL_DTD_NAME=Name
-_UI_GROUP_OCCURRENCE=Occurrence
-
-!the following four symbols are also used in dtdeditor/presentation/GroupContentWindow.java
-!! NOTE TO TRANSLATOR: Please keep the characters in parentheses in translated text i.e. (1)
-_UI_RADIO_JUST_ONCE=Just once (1)
-_UI_RADIO_ONE_OR_MORE=One or more (+)
-_UI_RADIO_OPTIONAL=Optional (?)
-_UI_RADIO_ZERO_OR_MORE=Zero or more (*)
-
-!context menu for .dtd files
-_UI_MENU_GENERATE=&Generate
-_UI_MENU_JAVA=&Java Beans...
-_UI_MENU_XML_SCHEMA=XML &Schema...
-_UI_MENU_HTML_FORM=&HTML Form...
-
-!presentation/DTDContextContributor.java
-_UI_MENU_GENERATE_JAVA=Generate &Java Beans...
-_UI_MENU_GENERATE_XML_SCHEMA=Generate &XML Schema...
-_UI_MENU_GENERATE_HTML_FORM=Generate &HTML Form...
-_UI_MENU_GENERATE_SAMPLE_XML=Generate XM&L...
-_UI_MENU_VALIDATE_DTD=&Validate DTD
-_UI_TOOLTIP_VALIDATE_DTD=Validate the current state of the DTD
-_UI_TOOLTIP_GENERATE_HTML=Generate an HTML form for the DTD
-_UI_TOOLTIP_GENERATE_SAMPLE_XML=Generate an XML from the DTD
-_UI_TOOLTIP_GENERATE_XML_SCHEMA=Generate an XML Schema from the DTD
-_UI_TOOLTIP_GENERATE_JAVA=Generate Java Beans for the DTD
-
-_UI_ACTION_DELETE=Delete
-_UI_ACTION_CONTEXT_ADD_NOTATION=Add &Notation
-_UI_TOOLTIP_ADD_NOTATION=Add a notation to the DTD.
-_UI_ACTION_CONTEXT_ADD_ENTITY=Add &Entity
-_UI_TOOLTIP_ADD_ENTITY=Add an entity to the DTD.
-_UI_ACTION_CONTEXT_ADD_ELEMENT=Add Ele&ment
-_UI_TOOLTIP_ADD_ELEMENT=Add an element to the DTD.
-_UI_ACTION_CONTEXT_ADD_ATTRIBUTE=Add Attribute
-_UI_TOOLTIP_ADD_ATTRIBUTE_SELECTED=Add an attribute to the selected element.
-_UI_ACTION_ADD_ATTRIBUTELIST=Add Attribute &List
-_UI_TOOLTIP_ADD_ATTRIBUTELIST_SELECTED=Add an attribute list to the selected element.
-_UI_ACTION_ADD_GROUP_CONTENT=Add Group To Con&tent Model
-_UI_TOOLTIP_ADD_GROUP=Add a group to the content model of the selected group or element.
-_UI_ACTION_ADD_ELEMENT_CONTENT=Add Element To C&ontent Model
-_UI_TOOLTIP_ADD_ELEMENT_CONTENT=Add an element to the content model.
-_UI_MENU_DTD_EDITOR=&DTD
-_UI_TOOLTIP_ADD_COMMENT=Add a comment to the DTD.
-
-!presentation/DTDEditor.java
-_UI_WORKBOOKPAGE_SOURCE=Source
-_UI_WORKBOOKPAGE_DESIGN=Design
-
-!the following is used: _UI_MENU_UNDO_1 + _UI_MENU_UNDO_2
-_UI_MENU_UNDO_1=&Undo
-!! NOTE TO TRANSLATOR: Do not translate following line - shortcut key
-_UI_MENU_UNDO_2=@Ctrl+Z
-
-!the following is used: _UI_MENU_UNDO_DESC + a description of the command to be undone
-_UI_MENU_UNDO_DESC=Undo:
-
-!the following is used: _UI_MENU_REDO_1 + _UI_MENU_REDO_2
-_UI_MENU_REDO_1=&Redo
-!! NOTE TO TRANSLATOR: Do not translate following line - shortcut key
-_UI_MENU_REDO_2=@Ctrl+Y
-
-!the following is used: _UI_MENU_REDO_DESC + a description of the command to be done again
-_UI_MENU_REDO_DESC=Redo:
-
-!presentation/ElementWindow
-_UI_ELEMENT_NAME=Name
-_UI_ELEMENT_COMMENT=Comment
-
-!DTDOutliner
-_UI_ACTION_ADD_DTD_NOTATION=Add &Notation
-_UI_ACTION_ADD_DTD_ENTITY=Add &Entity
-_UI_ACTION_ADD_DTD_ELEMENT=Add Ele&ment
-_UI_ACTION_ADD_DTD_COMMENT=Add &Comment
-_UI_ACTION_DTD_DELETE=&Delete
-_UI_ACTION_ADD_ATTRIBUTE=Add &Attribute
-_UI_ACTION_GROUP_ADD_GROUP=Add Group to Con&tent Model
-_UI_ACTION_ADD_ELEMENT=Add Element to C&ontent Model
-
-!DTDContentOutlinePage
-_UI_BUTTON_GROUP_ITEMS_LOGICALLY=Group items logically.
-_UI_BUTTON_UNGROUP_ITEMS_LOGICALLY=Do not group items logically.
-_UI_BUTTON_SORT_ITEMS=Sort items alphabetically.
-_UI_BUTTON_UNSORT_ITEMS=Do not sort items alphabetically.
-
-!provider/EntityItemProvider.java
-_UI_COLUMN_PARAMETER=Parameter
-_UI_COLUMN_GENERAL=General
-
-!provider/FolderItemProvider.java
-_UI_LABEL_ELEMENTS_FOLDER=Elements
-_UI_LABEL_NOTATIONS_FOLDER=Notations
-_UI_LABEL_ENITIES_FOLDER=Entities
-
-!Wizards/InputSelectionPage.java
-_UI_BUTTON_SELECT_ALL=&Select All
-_UI_BUTTON_UNSELECT_ALL=&Clear All
-
-!Wizards/HTMLFormWizard.java
-_UI_HTML_WIZARD_NEW_FILE_TITLE=Generate HTML Form
-_UI_HTML_WIZARD_NEW_FILE_DESC=Generate an HTML form from the selected DTD file.
-
-!Wizards/NewDTDWizard.java
-_UI_WIZARD_NEW_DTD_TITLE=Create DTD
-_UI_WIZARD_CREATE_DTD_HEADING=Create DTD File
-_UI_WIZARD_CREATE_DTD_EXPL=Select how you would like to create your DTD file.
-_UI_RADIO_CREATE_DTD=Create DTD file from scratch
-_UI_RADIO_CREATE_DTD_FROM_XML=Create DTD file from an XML file
-
-_UI_WIZARD_NEW_DTD_HEADING=New DTD
-_UI_WIZARD_NEW_DTD_EXPL=Create a new DTD file. Specify the folder and name for the file.
-
-_UI_WIZARD_NEW_XSD_HEADING=New XML Schema
-_UI_WIZARD_NEW_XSD_EXPL=Create a new XML Schema file from the XML file.
-
-_UI_WIZARD_XML_FILE_HEADING=XML Files
-_UI_WIZARD_XML_FILE_EXPL=Select the XML files to create the DTD file from.
-_UI_LABEL_XML_FILES=XML Files:
-
-_UI_STATUS_XML_CONTAINS_ERRORS=XML files specified contained errors.
-_UI_BUTTON_ADD_XML=Add...
-_UI_BUTTON_REMOVE_XML=Remove
-
-!wizards/ServletNamePage
-_UI_WIZARD_SERVLET_NAME_HEADING=Servlet Name
-_UI_LABEL_SERVLET_NAME=&Enter the servlet name:
-_UI_LABEL_MISSING_SERVLET_NAME=Provide a servlet name
-_UI_LABEL_DEFAULT_SERVLET_NAME=http://localhost/servlet/testServlet
-
-!wizards/GenerateXMLSchemaHelper.java & DTD2XSDWizard.java
-_UI_WIZARD_DTD2XSD_TITLE=Generate
-_UI_GENERATE_XSD_TITLE=Generate XML Schema
-_UI_GENERATE_XSD_DESCRIPTION=Generate an XML schema from the selected DTD file.
-_UI_PAGE_GEN_OPTIONS_TITLE=XML Schema Generation Options
-_UI_PAGE_GEN_OPTIONS_DESC=Select how you want your XML schema generated
-_UI_GENERATE_XSD_LONG_DESC=You can create one XML schema file that includes the selected DTD and any of the DTDs it references. Alternatively, you can create individual schema files that correspond to the selected DTD and any of the DTDs it references.
-
-
-_UI_GROUP_OPTIONS=Options
-_UI_BUTTON_GEN_ONE_SCHEMA=&Create one XML schema that includes all the DTD files
-_UI_BUTTON_GEN_MULTI_SCHEMAS=Create an &XML schema for each DTD file
-
-!EntityWindow
-_UI_GROUP_ENTITY_INFORMATION=Entity information
-_UI_LABEL_NAME=Name:
-_UI_LABLE_TYPE=Type:
-_UI_RADIO_GENERAL=General
-_UI_RADIO_PARAMETER=Parameter
-_UI_CHKBOX_EXTERNAL=External
-_UI_GROUP_INTERNAL=Internal Entity
-_UI_DIALOG_SELECT_DTD=Select System ID File
-_UI_DIALOG_SELECT_DTD_DESC=Please select a resource to be used for the System ID.
-_UI_GROUP_INTERNAL_ENTITY=Internal entity
-_UI_LABEL_VALUE_INTERNAL=Value:
-_UI_GROUP_EXTERNAL_ENTITY=External entity
-_UI_LABEL_VALUE=Value
-_UI_GROUP_COMMENT=Comment
-_UI_LABEL_SYSTEM_ID=System ID:
-_UI_BUTTON_SELECT=Select...
-_UI_LABEL_PUBLIC_ID=Public ID:
-_UI_LABEL_NOTATION_NAME=Notation name
-_UI_LABEL_UNPARSE_ENTITY=(Unparsed entity)
-_UI_TOOLTIP_GENERAL=Use entity in XML documents.
-_UI_TOOLTIP_PARAMETER=Use entity in a DTD.
-_UI_TOOLTIP_EXTERNAL=Refer to an external DTD.
-_UI_LABEL_BROWSE=Browse...
-
-!presentation/NotationsTable.java
-_UI_COLUMN_NOTATION_NAME=Notation Name
-_UI_COLUMN_DECLARATION=Declaration
-
-!GroupContentWindow
-_UI_GROUP_MODEL_GROUP=Model group
-_UI_GROUP_CONNECTOR=Connector
-_UI_GROUP_MODEL_GROUP_OCCURRENCE=Occurrence
-_UI_RADIO_SEQUENCE=Sequence (,)
-_UI_RADIO_CHOICE=Choice (|)
-_UI_LABEL_CONTENT_MODEL_TYPE=Content model type:
-
-!EntitiesTable
-_UI_COLUMN_ENTITY_NAME=Entity Name
-_UI_COLUMN_TYPE=Type
-_UI_COLUMN_DECLARATION=Declaration
-
-!AddNotationAction
-_UI_DEFAULT_NOTATION=Notation
-_UI_ACTION_ADD_NOTATION=Add &Notation
-
-!ElementsTable
-_UI_COLUMN_ELEMENT_NAME=Element Name
-_UI_COLUMN_CONTENT_MODEL=Content Model
-_UI_COLUMN_ATTRIBUTES=Attributes
-
-!ValidateDTDAction
-_UI_MSGBOX_DTD_VALID_TITLE=Validation Successful
-_UI_MSGBOX_DTD_VALID_TEXT=The DTD file is valid.
-
-!NotationWindow
-_UI_LABEL_NOTATION_INFORMATION=Notation information
-_UI_LABEL_NOTATION_NAME=Name:
-_UI_LABEL_NOTATION_SYSTEM_ID=System ID:
-_UI_LABEL_NOTATION_PUBLIC_ID=Public ID:
-_UI_LABEL_NOTATION_COMMENT=Comment
-
-!ParameterEntityReferenceWindow
-_UI_GROUP_EXTERNAL_PARM_ENTITY_REF=External parameter entity reference
-_UI_LABEL_ENTITY_NAME=Entity name:
-_UI_LABEL_REFERENCED_FILE=Referenced file:
-
-!InputSelectionPage (HTMLFormWizard)
-_UI_INPUT_SEL_PAGE_TITLE=Form Input Selection
-_UI_INPUT_SEL_PAGE_DESC=Select the form input fields to be generated
-
-!HTMLFormWizard (HTMLFormWizard)
-_UI_HTML_WIZARD_TITLE=HTML Form Creation Wizard
-
-! ParameterEntityReferenceWindow
-_UI_BUTTON_DETAILS=Details...
-
-!DTDContextContributer
-_UI_ACTION_ADD_PARAM_ENTITY_REF=Add &Parameter Entity Reference
-
-!DragAttributeCommand
-_UI_MOVE_ATTRIBUTE=Move Attribute
-
-!DragContentModelCommand
-_UI_MOVE_CONTENT=Move Content
-
-!DragTopLevelNodesCommand
-_UI_MOVE_NODE=Move Node
-_UI_MOVE_NODES=Move Nodes
-
-!DTDValidator
-_UI_DTD_VALIDATOR=DTD Validator
-
-!======================================================================================
-!
-! Here is the list of Error strings that have message IDs - make sure they are unique
-! Range for DTDEditor messageIDs: IWAX0201 - IWAX0400
-!
-!======================================================================================
-_ERROR_MIN_ONE_XML_FILE=IWAK0091E At least one XML File must be added
-_ERROR_MIN_ONE_XML_FILE_FOR_OP=IWAK0092E At least one XML file is required to perform the operation.
-_ERROR_NO_FILENAME=IWAK0093E Enter a file name
-_ERROR_FILE_DOES_NOT_EXIST=IWAK0094E File does not exist
-_ERROR_FILENAME_INVALID=IWAK0095E Invalid file name
-_ERROR_FILENAME_MUST_END_DTD=IWAK0096E The file name must end in .dtd
-_ERROR_TITLE_GENERATE_DTD_FAILED=IWAK0097E Generate DTD failed
-_ERROR_MSG_GENERATE_DTD_FAILED=IWAK0098E Errors were encountered while generating the DTD.
-
-_ERROR_INVALID_NAME_SPACE=IWAK0099E Name field cannot contain a space
-_ERROR_VALIDATE_FAILED=IWAK0100E Validation failed
-_ERROR_DTD_INVALID=IWAK0101E The DTD file is invalid. Please check the Tasks view for more details.
-_ERROR_LIMITE_EXCEEDED=IWAK0102E The DTD file is not valid. The message limit for the Tasks view has been exceeded. Please increase the limit and try again.
-
-_ERROR_TITLE_GENERATE_JAVABEAN_FAILED=IWAK0103E Generate Java Beans failed
-_ERROR_MSG_GENERATE_JAVABEAN_FAILED=IWAK0104E Errors were encountered while generating the Java Beans.
-DTDColorPage.0=<\!ELEMENT Main (One,Two+)>\r\n<\!ELEMENT One (Three,Four)>\r\n<\!ATTLIST One\r\n oneone CDATA \#REQUIRED\r\n>\r\n<\!-- You need this -->\r\n<\!ELEMENT Two (moremore*)>\r\n<\!ATTLIST Two\r\n twotwo CDATA \#REQUIRED\r\n twothree (aaa | bbb) "aaa"\r\n>\r\n
-DTDColorPage.1=Comments
-DTDColorPage.2=Data
-DTDColorPage.3=Default
-DTDColorPage.4=Keywords
-DTDColorPage.5=Strings
-DTDColorPage.6=Symbols
-DTDColorPage.7=Tag Delimiters
-DTDColorPage.8=Tag Names
-DTDPropertySourceAdapter.0=Name
-DTDPropertySourceAdapter.1=Contents
-DTDPropertySourceAdapter.2=Attributes
diff --git a/bundles/org.eclipse.wst.dtd.ui/plugin.xml b/bundles/org.eclipse.wst.dtd.ui/plugin.xml
deleted file mode 100644
index 788f729119..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/plugin.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.dtd.ui"
- name="%SSE_DTD_Source_Editor.name"
- version="1.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.wst.dtd.ui.DTDEditorPlugin">
-
- <runtime>
- <library name="dtdeditor.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.views"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.ui.editors"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.wst.dtd.core"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.ui.workbench"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.common.encoding"/>
- <import plugin="org.eclipse.wst.common.ui"/>
- </requires>
-
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%DTD_Source_Page_Editor.name"
- icon="icons/DTDFile.gif"
- extensions="dtd,ent,mod"
- contributorClass="org.eclipse.wst.dtd.ui.ActionContributorDTD"
- class="org.eclipse.wst.dtd.ui.StructuredTextEditorDTD"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.dtd.ui.StructuredTextEditorDTD">
- </editor>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.extendedconfiguration">
- <contentoutlineconfiguration
- class="org.eclipse.wst.dtd.ui.views.contentoutline.DTDContentOutlineConfiguration"
- target="org.eclipse.wst.dtd.core.dtdsource">
- </contentoutlineconfiguration>
- <textviewerconfiguration
- class="org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurationDTD"
- target="org.eclipse.wst.dtd.core.dtdsource">
- </textviewerconfiguration>
- <characterpairmatcher
- class="org.eclipse.wst.dtd.ui.text.DTDDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.dtd.core.dtdsource">
- </characterpairmatcher>
- <preferencepages
- preferenceids="org.eclipse.wst.sse.ui.preferences/org.eclipse.wst.sse.ui.preferences.dtd"
- target="org.eclipse.wst.dtd.core.dtdsource">
- </preferencepages>
- </extension>
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.dtd.core.dtdsource"
- class="org.eclipse.wst.sse.ui.StructuredResourceMarkerAnnotationModelFactory"/>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.dtd.ui.registry.AdapterFactoryProviderForDTD">
- <contentType id="org.eclipse.wst.dtd.core.dtdsource"/>
- </adapterFactoryDescription>
- </extension>
-<!-- Editor actionsets -->
- <extension
- point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part
- id="org.eclipse.wst.dtd.ui.StructuredTextEditorDTD">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part
- id="org.eclipse.wst.dtd.ui.StructuredTextEditorDTD">
- </part>
- </actionSetPartAssociation>
- </extension>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- name="%_UI_LABEL_DTD_FILES"
- category="org.eclipse.wst.sse.ui.preferences"
- class="org.eclipse.wst.dtd.ui.preferences.DTDFilesPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.dtd">
- </page>
- <page
- name="%_UI_LABEL_DTD_STYLES"
- category="org.eclipse.wst.sse.ui.preferences.dtd"
- class="org.eclipse.wst.dtd.ui.preferences.DTDColorPage"
- id="org.eclipse.wst.sse.ui.preferences.dtd.styles">
- </page>
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/ActionContributorDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/ActionContributorDTD.java
deleted file mode 100644
index b09a0822c0..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/ActionContributorDTD.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui;
-
-import org.eclipse.wst.sse.ui.edit.util.ActionContributor;
-
-/**
- * XMLEditorActionContributor
- *
- * This class should not be used inside multi page editor's
- * ActionBarContributor, since cascaded init() call from the
- * ActionBarContributor will causes exception and it leads to lose whole
- * toolbars.
- *
- * Instead, use SourcePageActionContributor for source page contributor of
- * multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorDTD extends ActionContributor {
- protected static final String[] EDITOR_IDS = {"org.eclipse.wst.dtd.ui.StructuredTextEditorDTD", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.edit.util.ActionContributor#getExtensionIDs()
- */
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/DTDEditorPlugin.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/DTDEditorPlugin.java
deleted file mode 100644
index a7e5ade89b..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/DTDEditorPlugin.java
+++ /dev/null
@@ -1,155 +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.dtd.ui;
-
-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.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.dtd.ui.style.IStyleConstantsDTD;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.ColorHelper;
-
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class DTDEditorPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static DTDEditorPlugin plugin;
-
- /**
- * Returns the shared instance.
- */
- public static DTDEditorPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle, or 'key' if not
- * found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = DTDEditorPlugin.getDefault().getResourceBundle();
- try {
- if (bundle != null)
- return bundle.getString(key);
- else
- return key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * true if editor preference store has been initialized with default
- * values false otherwise
- */
- private boolean preferencesInitd = false;
-
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public DTDEditorPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- plugin = this;
- try {
- //resourceBundle =
- // ResourceBundle.getBundle("org.eclipse.wst.dtd.ui.DTDPluginResources");
- resourceBundle = descriptor.getResourceBundle();
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
-
- // reference the preference store so
- // initializeDefaultPreferences(IPreferenceStore preferenceStore) is
- // called
- IPreferenceStore store = getPreferenceStore();
- // for some reason initializeDefaultPreferences is not always called,
- // so
- // just add an extra check to see if not initialized, then call init
- if (!preferencesInitd) {
- initializeDefaultPreferences(store);
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- private void initializeDefaultDTDPreferences(IPreferenceStore store) {
- String ctId = IContentTypeIdentifier.ContentTypeID_DTD;
-
- // DTD Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_DEFAULT, ctId), styleValue); //black
-
- styleValue = ColorHelper.getColorString(63, 63, 191) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_TAG, ctId), styleValue); // blue
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_TAGNAME, ctId), styleValue); // blue
-
- styleValue = ColorHelper.getColorString(127, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_COMMENT, ctId), styleValue); // grey
-
- styleValue = ColorHelper.getColorString(128, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_KEYWORD, ctId), styleValue); // dark
- // red
-
- styleValue = ColorHelper.getColorString(63, 159, 95) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_STRING, ctId), styleValue); //green
-
- styleValue = ColorHelper.getColorString(191, 95, 95) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_DATA, ctId), styleValue); // light
- // red
-
- styleValue = ColorHelper.getColorString(128, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsDTD.DTD_SYMBOL, ctId), styleValue); // dark
- // red
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPluginPreferences()
- */
- protected void initializeDefaultPreferences(IPreferenceStore store) {
-
- // ignore this preference store
- // use EditorPlugin preference store
- IPreferenceStore editorStore = ((AbstractUIPlugin) Platform.getPlugin(EditorPlugin.ID)).getPreferenceStore();
- EditorPlugin.initializeDefaultEditorPreferences(editorStore);
- initializeDefaultDTDPreferences(editorStore);
- preferencesInitd = true;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextEditorDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextEditorDTD.java
deleted file mode 100644
index 59e8671b57..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextEditorDTD.java
+++ /dev/null
@@ -1,24 +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.dtd.ui;
-
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class StructuredTextEditorDTD extends StructuredTextEditor {
- protected void initializeEditor() {
- super.initializeEditor();
- setHelpContextId(IHelpContextIds.DTD_SOURCEVIEW_HELPID);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
deleted file mode 100644
index cc827f960a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
+++ /dev/null
@@ -1,98 +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.dtd.ui;
-
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.wst.dtd.core.rules.StructuredTextPartitionerForDTD;
-import org.eclipse.wst.dtd.ui.style.LineStyleProviderForDTD;
-import org.eclipse.wst.dtd.ui.taginfo.DTDBestMatchHoverProcessor;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.style.Highlighter;
-import org.eclipse.wst.sse.ui.style.IHighlighter;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.style.LineStyleProviderForNoOp;
-import org.eclipse.wst.sse.ui.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.taginfo.ProblemAnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.util.EditorUtility;
-
-
-/**
- * Provides the best dtd hover help documentation (by using other hover help
- * processors) Priority of hover help processors is: ProblemHoverProcessor,
- * AnnotationHoverProcessor
- */
-public class StructuredTextViewerConfigurationDTD extends StructuredTextViewerConfiguration {
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (configuredContentTypes == null) {
- configuredContentTypes = new String[]{StructuredTextPartitionerForDTD.ST_DTD_DEFAULT, StructuredTextPartitioner.ST_DEFAULT_PARTITION, StructuredTextPartitioner.ST_UNKNOWN_PARTITION};
- }
- return configuredContentTypes;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration#getHighlighter(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IHighlighter getHighlighter(ISourceViewer viewer) {
- if (fHighlighter == null) {
- fHighlighter = new Highlighter();
- }
-
- // We need to add the providers each time this method is called.
- // See StructuredTextViewer.configure() method (defect#246727)
- LineStyleProvider dtdProvider = new LineStyleProviderForDTD();
- LineStyleProvider noopProvider = new LineStyleProviderForNoOp();
-
- // com.ibm.sed.editor.ST_DEFAULT
- fHighlighter.addProvider(StructuredTextPartitionerForDTD.ST_DTD_DEFAULT, dtdProvider);
- fHighlighter.addProvider(StructuredTextPartitioner.ST_DEFAULT_PARTITION, dtdProvider);
- fHighlighter.addProvider(StructuredTextPartitioner.ST_UNKNOWN_PARTITION, noopProvider);
-
- //fHighlighter.setModel(((StructuredTextViewer) viewer).getModel());
- fHighlighter.setDocument((IStructuredDocument) viewer.getDocument());
-
- return fHighlighter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTextHover(org.eclipse.jface.text.source.ISourceViewer,
- * java.lang.String, int)
- */
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- // content type does not really matter since only combo, problem,
- // annotation hover is available
- TextHoverManager.TextHoverDescriptor[] hoverDescs = EditorPlugin.getDefault().getTextHoverManager().getTextHovers();
- int i = 0;
- while (i < hoverDescs.length) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
- return new DTDBestMatchHoverProcessor();
- else if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
- return new ProblemAnnotationHoverProcessor();
- else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
- return new AnnotationHoverProcessor();
- }
- i++;
- }
- return super.getTextHover(sourceViewer, contentType, stateMask);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DTDDragAndDropManager.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DTDDragAndDropManager.java
deleted file mode 100644
index 990d0128eb..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DTDDragAndDropManager.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.dtd.ui.dnd;
-
-import java.util.Collection;
-
-import org.eclipse.wst.common.ui.dnd.DragAndDropCommand;
-import org.eclipse.wst.common.ui.dnd.DragAndDropManager;
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.CMNode;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.TopLevelNode;
-
-public class DTDDragAndDropManager implements DragAndDropManager {
-
- public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source) {
- if (target instanceof DTDNode) {
- DTDNode node = (DTDNode) target;
-
- if (node instanceof TopLevelNode) {
- return new DragTopLevelNodesCommand(target, location, operations, operation, source);
- }
- if (node instanceof Attribute) {
- return new DragAttributeCommand(target, location, operations, operation, source);
- }
- if (node instanceof CMNode) {
- return new DragContentModelCommand(target, location, operations, operation, source);
- }
-
- }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragAttributeCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragAttributeCommand.java
deleted file mode 100644
index cde3bffeda..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragAttributeCommand.java
+++ /dev/null
@@ -1,61 +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.dtd.ui.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.ui.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-
-
-
-public class DragAttributeCommand extends DefaultDragAndDropCommand {
-
- public DragAttributeCommand(Object target, float location, int operations, int operation, Collection sources) {
- super(target, location, operations, operation, sources);
- }
-
- public boolean canExecute() {
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- Object source = iter.next();
- if (!(source instanceof Attribute)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- DTDNode referenceNode = (DTDNode) target;
- DTDFile dtdFile = referenceNode.getDTDFile();
- if (referenceNode instanceof Attribute) {
- dtdFile.getDTDModel().beginRecording(this, DTDEditorPlugin.getResourceString("_UI_MOVE_ATTRIBUTE")); //$NON-NLS-1$
- AttributeList attList = (AttributeList) referenceNode.getParentNode();
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof Attribute) {
- attList.insertIntoModel(this, (Attribute) referenceNode, (Attribute) node, isAfter());
- dtdFile.deleteNode(this, node);
- }
- }
- dtdFile.getDTDModel().endRecording(this);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragContentModelCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragContentModelCommand.java
deleted file mode 100644
index d0ac95f157..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragContentModelCommand.java
+++ /dev/null
@@ -1,111 +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.dtd.ui.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.wst.common.ui.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.CMBasicNode;
-import org.eclipse.wst.dtd.core.CMGroupNode;
-import org.eclipse.wst.dtd.core.CMNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-
-
-public class DragContentModelCommand extends DefaultDragAndDropCommand {
-
- public DragContentModelCommand(Object target, float location, int operations, int operation, Collection sources) {
- super(target, location, operations, operation, sources);
- }
-
- public boolean canExecute() {
- if (!(target instanceof CMNode)) {
- return false;
- }
-
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- Object source = iter.next();
- if (!(source instanceof CMNode)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- DTDNode referenceNode = (DTDNode) target;
-
- if (referenceNode instanceof CMNode) {
- DTDFile dtdFile = referenceNode.getDTDFile();
-
- DTDNode parent = (DTDNode) referenceNode.getParentNode();
- dtdFile.getDTDModel().beginRecording(this, DTDEditorPlugin.getResourceString("_UI_MOVE_CONTENT")); //$NON-NLS-1$
- boolean parentIsElement = false;
- Element element = null;
- CMGroupNode group = null;
- if (parent instanceof Element) {
- parentIsElement = true;
- element = (Element) parent;
- } else {
- group = (CMGroupNode) parent;
- }
-
- if (element == null && group == null) {
- // no parent to add to
- return;
- }
-
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof CMNode) {
- if (parentIsElement) {
- if (element.getContentModel() == node) {
- continue;
- }
- element.replaceContentModel(this, (CMNode) node);
- } else {
- if (referenceNode == node || (isAfter() && referenceNode.getNextSibling() == node) || (!isAfter() && node.getNextSibling() == referenceNode)) {
- continue;
- }
-
- group.insertIntoModel(this, (CMNode) referenceNode, (CMNode) node, isAfter());
-
- }
- DTDNode nodeParent = (DTDNode) node.getParentNode();
- nodeParent.delete(this, node);
- }
- }
- dtdFile.getDTDModel().endRecording(this);
- }
- }
-
- public int getFeedback() {
- DTDNode referenceNode = (DTDNode) target;
- if (referenceNode instanceof CMNode) {
- CMNode cmNode = (CMNode) referenceNode;
- if (cmNode.isRootElementContent() && cmNode instanceof CMBasicNode) {
- return DND.FEEDBACK_SELECT;
- }
- }
-
- return super.getFeedback();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragTopLevelNodesCommand.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragTopLevelNodesCommand.java
deleted file mode 100644
index 0a8f6f8c54..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/dnd/DragTopLevelNodesCommand.java
+++ /dev/null
@@ -1,64 +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.dtd.ui.dnd;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.ui.dnd.DefaultDragAndDropCommand;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.TopLevelNode;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-
-public class DragTopLevelNodesCommand extends DefaultDragAndDropCommand {
-
- static private final String moveNode = DTDEditorPlugin.getResourceString("_UI_MOVE_NODE"); //$NON-NLS-1$
- static private final String moveNodes = DTDEditorPlugin.getResourceString("_UI_MOVE_NODES"); //$NON-NLS-1$
-
- public DragTopLevelNodesCommand(Object target, float location, int operations, int operation, Collection sources) {
- super(target, location, operations, operation, sources);
- }
-
- public boolean canExecute() {
- if (!(target instanceof TopLevelNode)) {
- return false;
- }
-
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- Object source = iter.next();
- if (!(source instanceof TopLevelNode)) {
- return false;
- }
- }
- return true;
- }
-
- public void execute() {
- DTDNode referenceNode = (DTDNode) target;
-
- DTDFile dtdFile = referenceNode.getDTDFile();
- dtdFile.getDTDModel().beginRecording(this, sources.size() > 1 ? moveNodes : moveNode);
- Iterator iter = sources.iterator();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (node instanceof TopLevelNode) {
- dtdFile.moveNode(this, referenceNode, node, isAfter());
- }
- }
- dtdFile.getDTDModel().endRecording(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java
deleted file mode 100644
index 7a7e9ae75c..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImageHelper.java
+++ /dev/null
@@ -1,155 +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.dtd.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- *
- * NOTE: For internal use only. For images used externally, please use the
- * Shared***ImageHelper class instead.
- *
- * @author amywu
- */
-public class DTDEditorPluginImageHelper {
- private static DTDEditorPluginImageHelper instance = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a DTDEditorPluginImageHelper
- */
- public synchronized static DTDEditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new DTDEditorPluginImageHelper();
- return instance;
- }
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
- private final String PLUGINID = DTDEditorPlugin.getDefault().getBundle().getSymbolicName();
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
- getImageRegistry().put(resource, image);
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- } else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- //create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- } else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null)
- fImageDescRegistry = new HashMap();
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java
deleted file mode 100644
index 3f0a7807c3..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/DTDEditorPluginImages.java
+++ /dev/null
@@ -1,42 +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.dtd.ui.internal.editor;
-
-/**
- * Bundle of most images used by the DTD Source Editor plug-in.
- */
-public class DTDEditorPluginImages {
- public static final String IMG_CTOOL_ADD_ATTRIBUTE = "icons/full/ctool16/ADD_Attribute.gif"; //$NON-NLS-1$
-
- public static final String IMG_CTOOL_ADD_ELEMENT = "icons/full/ctool16/ADD_Element.gif"; //$NON-NLS-1$
-
- public static final String IMG_CTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/ctool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
-
- public static final String IMG_CTOOL_ADD_GROUPTOCONMODEL = "icons/full/ctool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_ATTRIBUTE = "icons/full/dtool16/ADD_Attribute.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_ELEMENT = "icons/full/dtool16/ADD_Element.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/dtool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_DTOOL_ADD_GROUPTOCONMODEL = "icons/full/dtool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_ATTRIBUTE = "icons/full/etool16/ADD_Attribute.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_ELEMENT = "icons/full/etool16/ADD_Element.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_ELEMENTTOCONMODEL = "icons/full/etool16/ADD_ElementToConModel.gif"; //$NON-NLS-1$
- public static final String IMG_ETOOL_ADD_GROUPTOCONMODEL = "icons/full/etool16/ADD_GroupToConModel.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_ADD_COMMENT = "icons/full/obj16/ADD_Comment.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_ENTITY = "icons/full/obj16/ADD_Entity.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_ENTITY_REFERENCE = "icons/full/obj16/ADD_Entity_Reference.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ADD_NOTATION = "icons/full/obj16/ADD_Notation.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_ORGANIZE_DTD_LOGICALLY = "icons/full/obj16/organize_dtd_logically.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_VALIDATE = "icons/full/obj16/validate.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index ffce903e86..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,36 +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.dtd.ui.internal.editor;
-
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-
-/**
- * Help context ids for the DTD Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
-
- // org.eclipse.wst.dtd.ui.
- public static final String PREFIX = DTDEditorPlugin.getDefault().getBundle().getSymbolicName() + "."; //$NON-NLS-1$
- // DTD Files Preference page
- public static final String DTD_PREFWEBX_FILES_HELPID = PREFIX + "webx0020"; //$NON-NLS-1$
- // DTD Styles Preference page
- public static final String DTD_PREFWEBX_STYLES_HELPID = PREFIX + "webx0021"; //$NON-NLS-1$
-
- // DTD Source page editor
- public static final String DTD_SOURCEVIEW_HELPID = PREFIX + "edtd0000"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java
deleted file mode 100644
index c3ad60e502..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java
+++ /dev/null
@@ -1,180 +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.dtd.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.dtd.core.parser.DTDRegionParser;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.dtd.ui.style.IStyleConstantsDTD;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage;
-import org.eclipse.wst.sse.ui.preferences.ui.StyledTextColorPicker;
-
-
-
-public class DTDColorPage extends AbstractColorPage {
-
- protected Control createContents(Composite parent) {
- Composite pageComponent = createComposite(parent, 1);
- ((GridData) pageComponent.getLayoutData()).horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
-
- super.createContents(pageComponent);
- WorkbenchHelp.setHelp(pageComponent, IHelpContextIds.DTD_PREFWEBX_STYLES_HELPID);
-
- return pageComponent;
- }
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceKeyGenerator.generateKey((String) i.next(), IContentTypeIdentifier.ContentTypeID_DTD)));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return EditorPlugin.getDefault().getPreferenceStore();
- }
-
- public String getSampleText() {
- return DTDEditorPlugin.getResourceString("DTDColorPage.0"); //$NON-NLS-1$
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
- contextStyleMap.put(DTDRegionTypes.CONTENT_EMPTY, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.CONTENT_ANY, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.CONTENT_PCDATA, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.NDATA_VALUE, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.NAME, IStyleConstantsDTD.DTD_DATA);
- contextStyleMap.put(DTDRegionTypes.ENTITY_PARM, IStyleConstantsDTD.DTD_DATA);
-
- contextStyleMap.put(DTDRegionTypes.ELEMENT_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- contextStyleMap.put(DTDRegionTypes.ENTITY_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- contextStyleMap.put(DTDRegionTypes.ATTLIST_TAG, IStyleConstantsDTD.DTD_TAGNAME);
- contextStyleMap.put(DTDRegionTypes.NOTATION_TAG, IStyleConstantsDTD.DTD_TAGNAME);
-
- contextStyleMap.put(DTDRegionTypes.CONNECTOR, IStyleConstantsDTD.DTD_SYMBOL);
- contextStyleMap.put(DTDRegionTypes.OCCUR_TYPE, IStyleConstantsDTD.DTD_SYMBOL);
-
- contextStyleMap.put(DTDRegionTypes.START_TAG, IStyleConstantsDTD.DTD_TAG);
- contextStyleMap.put(DTDRegionTypes.END_TAG, IStyleConstantsDTD.DTD_TAG);
- contextStyleMap.put(DTDRegionTypes.EXCLAMATION, IStyleConstantsDTD.DTD_TAG);
-
- contextStyleMap.put(DTDRegionTypes.COMMENT_START, IStyleConstantsDTD.DTD_COMMENT);
- contextStyleMap.put(DTDRegionTypes.COMMENT_CONTENT, IStyleConstantsDTD.DTD_COMMENT);
- contextStyleMap.put(DTDRegionTypes.COMMENT_END, IStyleConstantsDTD.DTD_COMMENT);
-
- contextStyleMap.put(DTDRegionTypes.SINGLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
- contextStyleMap.put(DTDRegionTypes.DOUBLEQUOTED_LITERAL, IStyleConstantsDTD.DTD_STRING);
-
- contextStyleMap.put(DTDRegionTypes.SYSTEM_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.PUBLIC_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.CDATA_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.ID_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.IDREF_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.IDREFS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.ENTITY_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.ENTITIES_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NMTOKEN_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NMTOKENS_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.NOTATION_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.REQUIRED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.IMPLIED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- contextStyleMap.put(DTDRegionTypes.FIXED_KEYWORD, IStyleConstantsDTD.DTD_KEYWORD);
- }
-
- protected void initDescriptions(Dictionary descriptions) {
- descriptions.put(IStyleConstantsDTD.DTD_COMMENT, DTDEditorPlugin.getResourceString("DTDColorPage.1")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_DATA, DTDEditorPlugin.getResourceString("DTDColorPage.2")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_DEFAULT, DTDEditorPlugin.getResourceString("DTDColorPage.3")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_KEYWORD, DTDEditorPlugin.getResourceString("DTDColorPage.4")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_STRING, DTDEditorPlugin.getResourceString("DTDColorPage.5")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_SYMBOL, DTDEditorPlugin.getResourceString("DTDColorPage.6")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_TAG, DTDEditorPlugin.getResourceString("DTDColorPage.7")); //$NON-NLS-1$
- descriptions.put(IStyleConstantsDTD.DTD_TAGNAME, DTDEditorPlugin.getResourceString("DTDColorPage.8")); //$NON-NLS-1$
- }
-
- protected void initStyleList(ArrayList list) {
- list.add(IStyleConstantsDTD.DTD_COMMENT);
- list.add(IStyleConstantsDTD.DTD_DATA);
- list.add(IStyleConstantsDTD.DTD_DEFAULT);
- list.add(IStyleConstantsDTD.DTD_KEYWORD);
- list.add(IStyleConstantsDTD.DTD_STRING);
- list.add(IStyleConstantsDTD.DTD_SYMBOL);
- list.add(IStyleConstantsDTD.DTD_TAG);
- list.add(IStyleConstantsDTD.DTD_TAGNAME);
- }
-
- public boolean performOk() {
- // required since the superclass *removes* existing preferences before
- // saving its own
- super.performOk();
-
- EditorPlugin.getDefault().savePluginPreferences();
- return true;
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
-
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- if (plugin != null) {
- IModelManager mmanager = plugin.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_DTD).getParser());
- } else
- picker.setParser(new DTDRegionParser());
-
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
-
- picker.setGeneratorKey(IContentTypeIdentifier.ContentTypeID_DTD);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDFilesPreferencePage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDFilesPreferencePage.java
deleted file mode 100644
index e7f075dd74..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDFilesPreferencePage.java
+++ /dev/null
@@ -1,62 +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.dtd.ui.preferences;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.dtd.core.DTDPlugin;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferencePage;
-
-
-public class DTDFilesPreferencePage extends AbstractPreferencePage {
-
- protected Control createContents(Composite parent) {
- Composite composite = (Composite) super.createContents(parent);
- WorkbenchHelp.setHelp(composite, IHelpContextIds.DTD_PREFWEBX_FILES_HELPID);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return DTDEditorPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- DTDPlugin.getInstance().savePluginPreferences(); // model
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return DTDPlugin.getInstance().getPluginPreferences();
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/registry/AdapterFactoryProviderForDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/registry/AdapterFactoryProviderForDTD.java
deleted file mode 100644
index 1af43409a4..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/registry/AdapterFactoryProviderForDTD.java
+++ /dev/null
@@ -1,74 +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.dtd.ui.registry;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.dtd.core.modelhandler.ModelHandlerForDTD;
-import org.eclipse.wst.dtd.ui.views.properties.DTDPropertySourceAdapterFactory;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.IFactoryRegistry;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.util.Assert;
-
-
-/**
- * @author nitin
- *
- * To change the template for this generated type comment go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-public class AdapterFactoryProviderForDTD implements AdapterFactoryProvider {
-
- /**
- *
- */
- public AdapterFactoryProviderForDTD() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
- IFactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- AdapterFactory factory = null;
-
- factory = factoryRegistry.getFactoryFor(IPropertySource.class);
- if (factory == null) {
- factory = new DTDPropertySourceAdapterFactory();
- factoryRegistry.addFactory(factory);
- }
-
- // factory = factoryRegistry.getFactoryFor(JFaceNodeAdapter.class);
- // if (factory == null) {
- // factory = new JFaceNodeAdapterFactory(JFaceNodeAdapter.class,
- // true);
- // factoryRegistry.addFactory(factory);
- // }
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForDTD);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- // nothing to do, since no embedded type
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/IStyleConstantsDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/IStyleConstantsDTD.java
deleted file mode 100644
index 393cbf1242..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/IStyleConstantsDTD.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.dtd.ui.style;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider,
- * ColorManager, and any others who may be interested
- */
-public interface IStyleConstantsDTD {
-
- public static final String DTD_COMMENT = "dtdComment"; //$NON-NLS-1$
-
- // Data are variables
- public static final String DTD_DATA = "dtdData"; //$NON-NLS-1$
- public static final String DTD_DEFAULT = "dtdDefault"; //$NON-NLS-1$
-
- // keywords are constants like IMPLIED or PCDATA
- public static final String DTD_KEYWORD = "dtdKeyword"; //$NON-NLS-1$
-
- // strings are anything in quotes
- public static final String DTD_STRING = "dtdString"; //$NON-NLS-1$
-
- // All the remaining symbols
- public static final String DTD_SYMBOL = "dtdSymbol"; //$NON-NLS-1$
-
- // tags are '<', '!', or '>'
- public static final String DTD_TAG = "dtdTag"; //$NON-NLS-1$
-
- // tagnames are like ELEMENT, ATTLIST, etc.
- public static final String DTD_TAGNAME = "dtdTagName"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTD.java
deleted file mode 100644
index be41e5e67a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTD.java
+++ /dev/null
@@ -1,135 +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.dtd.ui.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-
-
-public class LineStyleProviderForDTD extends AbstractLineStyleProvider implements LineStyleProvider {
- public LineStyleProviderForDTD() {
- super();
- loadColors();
- }
-
- protected void clearColors() {
- getTextAttributes().clear();
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- /**
- * a method to centralize all the "format rules" for regions
- * specifically associated for how to "open" the region.
- */
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DEFAULT);
- }
- String type = region.getType();
- if (type == DTDRegionTypes.CONTENT_EMPTY || type == DTDRegionTypes.CONTENT_ANY || type == DTDRegionTypes.CONTENT_PCDATA) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
- } else if (type == DTDRegionTypes.ELEMENT_TAG || type == DTDRegionTypes.ENTITY_TAG || type == DTDRegionTypes.ATTLIST_TAG || type == DTDRegionTypes.NOTATION_TAG) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_TAGNAME);
- } else if (type == DTDRegionTypes.CONNECTOR || type == DTDRegionTypes.OCCUR_TYPE) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_SYMBOL);
- } else if (type == DTDRegionTypes.NDATA_VALUE) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
- } else if (type == DTDRegionTypes.START_TAG || type == DTDRegionTypes.END_TAG || type == DTDRegionTypes.EXCLAMATION) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_TAG);
- } else if (type == DTDRegionTypes.COMMENT_START || type == DTDRegionTypes.COMMENT_CONTENT || type == DTDRegionTypes.COMMENT_END) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_COMMENT);
- } else if (type == DTDRegionTypes.SINGLEQUOTED_LITERAL || type == DTDRegionTypes.DOUBLEQUOTED_LITERAL) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_STRING);
- } else if (type == DTDRegionTypes.SYSTEM_KEYWORD || type == DTDRegionTypes.PUBLIC_KEYWORD || type == DTDRegionTypes.NDATA_KEYWORD || type == DTDRegionTypes.CDATA_KEYWORD || type == DTDRegionTypes.ID_KEYWORD || type == DTDRegionTypes.IDREF_KEYWORD || type == DTDRegionTypes.IDREFS_KEYWORD || type == DTDRegionTypes.ENTITY_KEYWORD || type == DTDRegionTypes.ENTITIES_KEYWORD || type == DTDRegionTypes.NMTOKEN_KEYWORD || type == DTDRegionTypes.NMTOKENS_KEYWORD || type == DTDRegionTypes.NOTATION_KEYWORD || type == DTDRegionTypes.REQUIRED_KEYWORD || type == DTDRegionTypes.IMPLIED_KEYWORD || type == DTDRegionTypes.FIXED_KEYWORD) {
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_KEYWORD);
- } else if (type == DTDRegionTypes.NAME || type == DTDRegionTypes.ENTITY_PARM) {
- // if (region instanceof DTDRegion) {
- // DTDRegion dtdRegion = (DTDRegion) region;
- // IStructuredDocumentRegion flatNode = dtdRegion.getParent();
- // String regionText = flatNode.getText(dtdRegion);
- // if (regionText.equals("ANY") || regionText.equals("EMPTY")) {
- // return new TextAttribute(DTDColors.DTD_KEYWORD);
- // }
- // }
- return (TextAttribute) getTextAttributes().get(IStyleConstantsDTD.DTD_DATA);
- }
-
- // default, return null to signal "not handled"
- // in which case, other factories should be tried
- return null;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return EditorPlugin.getDefault().getPreferenceStore();
- }
-
- protected String getPreferenceKey(String key) {
- String contentTypeId = IContentTypeIdentifier.ContentTypeID_DTD;
- return PreferenceKeyGenerator.generateKey(key, contentTypeId);
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (getPreferenceKey(IStyleConstantsDTD.DTD_DEFAULT).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_DEFAULT;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_TAG).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_TAG;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_TAGNAME).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_TAGNAME;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_COMMENT).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_COMMENT;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_KEYWORD).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_KEYWORD;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_STRING).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_STRING;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_DATA).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_DATA;
- } else if (getPreferenceKey(IStyleConstantsDTD.DTD_SYMBOL).equals(prefKey)) {
- styleKey = IStyleConstantsDTD.DTD_SYMBOL;
- }
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- super.handlePropertyChange(event);
- }
- }
-
- protected void loadColors() {
- clearColors();
-
- addTextAttribute(IStyleConstantsDTD.DTD_DEFAULT);
- addTextAttribute(IStyleConstantsDTD.DTD_TAG);
- addTextAttribute(IStyleConstantsDTD.DTD_TAGNAME);
- addTextAttribute(IStyleConstantsDTD.DTD_COMMENT);
- addTextAttribute(IStyleConstantsDTD.DTD_KEYWORD);
- addTextAttribute(IStyleConstantsDTD.DTD_STRING);
- addTextAttribute(IStyleConstantsDTD.DTD_DATA);
- addTextAttribute(IStyleConstantsDTD.DTD_SYMBOL);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTDSubSet.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTDSubSet.java
deleted file mode 100644
index 8f4048e3e3..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/style/LineStyleProviderForDTDSubSet.java
+++ /dev/null
@@ -1,156 +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.dtd.ui.style;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.dtd.core.rules.StructuredTextPartitionerForDTD;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.core.IStructuredModel;
-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.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-
-
-public class LineStyleProviderForDTDSubSet extends AbstractLineStyleProvider implements LineStyleProvider {
- private int fInternalAdjustment;
-
- private IStructuredModel fInternalModel = null;
- private LineStyleProviderForDTD fInternalProvider = null;
- private StyleRange[] fInternalRanges;
-
- public LineStyleProviderForDTDSubSet() {
-
- super();
- fInternalProvider = new LineStyleProviderForDTD();
- fInternalRanges = new StyleRange[0];
- fInternalAdjustment = 0;
- }
-
- /**
- * @param lineRequestStart
- * @param lineRequestLength
- * @param holdResults
- */
- private void addStyleRanges(int lineRequestStart, int lineRequestLength, Collection holdResults) {
-
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- TextAttribute ta = null;
-
- String prefString = getColorPreferences().getString(getPreferenceKey(IStyleConstantsDTD.DTD_DEFAULT));
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
- boolean bold = Boolean.valueOf(stylePrefs[2]).booleanValue();
- ta = createTextAttribute(foreground, background, bold);
- }
- return ta;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return EditorPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @return
- */
- private IStructuredDocument getInternalDocument() {
- if (fInternalModel == null) {
- fInternalModel = getModelManager().createUnManagedStructuredModelFor(IContentTypeIdentifier.ContentTypeID_DTD);
- }
- return fInternalModel.getStructuredDocument();
- }
-
- private IModelManager getModelManager() {
-
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- return plugin.getModelManager();
- }
-
- protected String getPreferenceKey(String key) {
- String contentTypeId = IContentTypeIdentifier.ContentTypeID_DTD;
- return PreferenceKeyGenerator.generateKey(key, contentTypeId);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.structured.style.AbstractLineStyleProvider#prepareRegions(org.eclipse.jface.text.ITypedRegion,
- * int, int, java.util.Collection)
- */
- public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) {
-
- if (!StructuredTextPartitionerForDTD.ST_DTD_DEFAULT.equals(typedRegion.getType())) {
- // compute an internal DTD model and return linestyles for it
- ITextRegion dtdContentRegion = null;
- IStructuredDocumentRegion doctype = getDocument().getRegionAtCharacterOffset(typedRegion.getOffset());
- if (doctype != null)
- dtdContentRegion = doctype.getRegionAtCharacterOffset(typedRegion.getOffset());
- String contents = dtdContentRegion != null ? doctype.getFullText(dtdContentRegion) : null;
- IStructuredDocument document = getInternalDocument();
- if (document == null)
- return false;
- updateStyleRanges(document, contents, typedRegion.getOffset());
- addStyleRanges(lineRequestStart, lineRequestLength, holdResults);
- return true;
- }
- return false;
- }
-
- public void release() {
- if (fInternalProvider != null) {
- fInternalProvider.release();
- }
- super.release();
- }
-
- private void updateStyleRanges(IStructuredDocument document, String contents, int adjustment) {
-
- if (!document.get().equals(contents) || fInternalAdjustment != adjustment) {
- document.set(contents);
- try {
- ITypedRegion regions[] = getInternalDocument().computePartitioning(0, document.getLength());
- List ranges = new ArrayList();
- fInternalProvider.init(getInternalDocument(), getHighlighter());
- for (int i = 0; i < regions.length; i++) {
- fInternalProvider.prepareRegions(regions[i], regions[i].getOffset(), regions[i].getLength(), ranges);
- }
- fInternalAdjustment = adjustment;
- fInternalRanges = (StyleRange[]) ranges.toArray(new StyleRange[0]);
- for (int i = 0; i < fInternalRanges.length; i++)
- fInternalRanges[i].start += fInternalAdjustment;
- } catch (BadLocationException e) {
- fInternalRanges = new StyleRange[0];
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/taginfo/DTDBestMatchHoverProcessor.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/taginfo/DTDBestMatchHoverProcessor.java
deleted file mode 100644
index 0ed9370e1d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/taginfo/DTDBestMatchHoverProcessor.java
+++ /dev/null
@@ -1,34 +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.dtd.ui.taginfo;
-
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.wst.sse.ui.taginfo.AbstractBestMatchHoverProcessor;
-
-
-/**
- * @author amywu
- */
-public class DTDBestMatchHoverProcessor extends AbstractBestMatchHoverProcessor {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.dtd.ui.taginfo.AbstractBestMatchHoverProcessor#getTagInfoHover()
- */
- protected ITextHover getTagInfoHover() {
- // DTD has no taginfo hover
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/text/DTDDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/text/DTDDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 7b58e19435..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/text/DTDDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,28 +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.dtd.ui.text;
-
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.sse.ui.text.DocumentRegionEdgeMatcher;
-
-
-public class DTDDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public DTDDocumentRegionEdgeMatcher() {
- super(new String[]{DTDRegionTypes.START_TAG, DTDRegionTypes.COMMENT_START}, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java
deleted file mode 100644
index d48d682ea8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContentOutlineConfiguration.java
+++ /dev/null
@@ -1,210 +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.dtd.ui.views.contentoutline;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.util.TransferDropTargetListener;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.wst.common.ui.dnd.ObjectTransfer;
-import org.eclipse.wst.common.ui.dnd.ViewerDragAdapter;
-import org.eclipse.wst.common.ui.dnd.ViewerDropAdapter;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.dtd.ui.dnd.DTDDragAndDropManager;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.util.Assert;
-import org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateActionContributionItem;
-import org.eclipse.wst.sse.ui.views.contentoutline.StructuredContentOutlineConfiguration;
-
-/**
- * @author nitin
- *
- */
-public class DTDContentOutlineConfiguration extends StructuredContentOutlineConfiguration {
-
- private DTDContextMenuHelper fMenuHelper;
- private TransferDragSourceListener[] fTransferDragSourceListeners;
- private TransferDropTargetListener[] fTransferDropTargetListeners;
- private Map fViewerContributions;
- private final String OUTLINE_ORDER_PREF = "outline-order"; //$NON-NLS-1$
- private final String OUTLINE_SORT_PREF = "outline-sort"; //$NON-NLS-1$
-
- /**
- * @param editor
- */
- public DTDContentOutlineConfiguration() {
- super();
- fViewerContributions = new HashMap(2);
- }
-
- public IContributionItem[] createToolbarContributions(TreeViewer viewer) {
- Assert.isTrue(getContentProvider(viewer) instanceof DTDTreeContentProvider);
- IContributionItem[] items = super.createToolbarContributions(viewer);
-
- SortAction sortAction = new SortAction(viewer, DTDEditorPlugin.getDefault().getPreferenceStore(), getSortPreferenceKey());
- OrderAction orderAction = new OrderAction(viewer, (DTDTreeContentProvider) getContentProvider(viewer), DTDEditorPlugin.getDefault().getPreferenceStore(), getOrderPreferenceKey());
- IContributionItem sortItem = new PropertyChangeUpdateActionContributionItem(sortAction);
- IContributionItem orderItem = new PropertyChangeUpdateActionContributionItem(orderAction);
-
- if (items == null) {
- items = new IContributionItem[2];
- items[0] = sortItem;
- items[1] = orderItem;
- } else {
- IContributionItem[] combinedItems = new IContributionItem[items.length + 2];
- combinedItems[0] = sortItem;
- combinedItems[1] = orderItem;
- System.arraycopy(items, 0, combinedItems, 2, items.length);
- items = combinedItems;
- }
- return items;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getContentProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public IContentProvider getContentProvider(TreeViewer viewer) {
- if (fContentProvider == null) {
- fContentProvider = new DTDTreeContentProvider();
- }
- return super.getContentProvider(viewer);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getLabelProvider(org.eclipse.jface.viewers.TreeViewer)
- */
- public ILabelProvider getLabelProvider(TreeViewer viewer) {
- if (fLabelProvider == null) {
- fLabelProvider = new DTDLabelProvider();
- }
- return super.getLabelProvider(viewer);
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getMenuListener(org.eclipse.jface.viewers.TreeViewer)
- */
- public IMenuListener getMenuListener(TreeViewer viewer) {
- fMenuHelper.createMenuListenersFor(viewer);
- return fMenuHelper.getMenuListener();
- }
-
- public String getOrderPreferenceKey() {
- return PreferenceKeyGenerator.generateKey(OUTLINE_ORDER_PREF, getDeclaringID());
- }
-
- public String getSortPreferenceKey() {
- return PreferenceKeyGenerator.generateKey(OUTLINE_SORT_PREF, getDeclaringID());
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDragSourceListeners(org.eclipse.jface.viewers.TreeViewer)
- */
- public TransferDragSourceListener[] getTransferDragSourceListeners(TreeViewer treeViewer) {
- if (fTransferDragSourceListeners == null) {
- // emulate the XMLDragAndDropManager
- final ViewerDragAdapter dragAdapter = new ViewerDragAdapter(treeViewer);
- fTransferDragSourceListeners = new TransferDragSourceListener[]{new TransferDragSourceListener() {
- public void dragFinished(DragSourceEvent event) {
- dragAdapter.dragFinished(event);
- }
-
- public void dragSetData(DragSourceEvent event) {
- dragAdapter.dragSetData(event);
- }
-
- public void dragStart(DragSourceEvent event) {
- dragAdapter.dragStart(event);
- }
-
- public Transfer getTransfer() {
- return ObjectTransfer.getInstance();
- }
- }};
- }
-
- return fTransferDragSourceListeners;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getTransferDropTargetListeners(org.eclipse.jface.viewers.TreeViewer)
- */
- public TransferDropTargetListener[] getTransferDropTargetListeners(TreeViewer treeViewer) {
- if (fTransferDropTargetListeners == null) {
- // emulate the XMLDragAnDropManager
- final ViewerDropAdapter dropAdapter = new ViewerDropAdapter(treeViewer, new DTDDragAndDropManager());
- fTransferDropTargetListeners = new TransferDropTargetListener[]{new TransferDropTargetListener() {
- public void dragEnter(DropTargetEvent event) {
- dropAdapter.dragEnter(event);
- }
-
- public void dragLeave(DropTargetEvent event) {
- dropAdapter.dragLeave(event);
- }
-
- public void dragOperationChanged(DropTargetEvent event) {
- dropAdapter.dragOperationChanged(event);
- }
-
- public void dragOver(DropTargetEvent event) {
- dropAdapter.dragOver(event);
- }
-
- public void drop(DropTargetEvent event) {
- dropAdapter.drop(event);
- }
-
- public void dropAccept(DropTargetEvent event) {
- dropAdapter.dropAccept(event);
- }
-
- public Transfer getTransfer() {
- return ObjectTransfer.getInstance();
- }
-
- public boolean isEnabled(DropTargetEvent event) {
- return getTransfer().isSupportedType(event.currentDataType);
- }
- }};
- }
- return fTransferDropTargetListeners;
- }
-
- public void setEditor(StructuredTextEditor editor) {
- super.setEditor(editor);
- fMenuHelper = new DTDContextMenuHelper(editor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#unconfigure(org.eclipse.jface.viewers.TreeViewer)
- */
- public void unconfigure(TreeViewer viewer) {
- super.unconfigure(viewer);
- fViewerContributions.remove(viewer);
- fMenuHelper.removeMenuListenersFor(viewer);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
deleted file mode 100644
index 2be2b8538e..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDContextMenuHelper.java
+++ /dev/null
@@ -1,307 +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.dtd.ui.views.contentoutline;
-
-import java.util.List;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.CMGroupNode;
-import org.eclipse.wst.dtd.core.CMNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.NodeList;
-import org.eclipse.wst.dtd.core.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.parser.DTDRegionTypes;
-import org.eclipse.wst.dtd.core.util.LabelValuePair;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddAttributeAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddAttributeListAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddCommentAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddElementAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddElementToContentModelAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddEntityAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddGroupToContentModelAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddNotationAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.AddParameterEntityReferenceAction;
-import org.eclipse.wst.dtd.ui.views.contentoutline.actions.DeleteAction;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class DTDContextMenuHelper //extends FocusAdapter
-{
-
- private class DTDMenuListener implements IMenuListener {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
- */
- public void menuAboutToShow(IMenuManager manager) {
- updateActions();
- List selection = DTDContextMenuHelper.this.editor.getSelectedNodes();
- if (selection != null && selection.size() == 1)
- addActionItemsForSelection(selection.get(0), manager);
- }
- }
-
- protected AddAttributeAction addAttributeAction;
- protected AddAttributeListAction addAttributeListAction;
- protected AddCommentAction addCommentAction;
- protected AddElementAction addElementAction;
- protected AddElementToContentModelAction addElementToContentModelAction;
- protected AddEntityAction addEntityAction;
- protected AddGroupToContentModelAction addGroupToContentModelAction;
- protected AddNotationAction addNotationAction;
- protected AddParameterEntityReferenceAction addParameterEntityReferenceAction;
- protected DeleteAction deleteAction;
-
- private StructuredTextEditor editor;
-
- private IMenuListener fMenuListener;
- protected IAction redoAction;
-
- // protected CutAction cutAction;
- // protected CopyAction copyAction;
- // protected PasteAction pasteAction;
- protected IAction undoAction;
-
- //private List viewerList = new Vector();
-
- public DTDContextMenuHelper(StructuredTextEditor editor) {
- this.editor = editor;
- fMenuListener = new DTDMenuListener();
- addNotationAction = new AddNotationAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_DTD_NOTATION")); //$NON-NLS-1$
- addEntityAction = new AddEntityAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_DTD_ENTITY")); //$NON-NLS-1$
- addElementAction = new AddElementAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_DTD_ELEMENT")); //$NON-NLS-1$
- addCommentAction = new AddCommentAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_DTD_COMMENT")); //$NON-NLS-1$
-
- addParameterEntityReferenceAction = new AddParameterEntityReferenceAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_PARAM_ENTITY_REF")); //$NON-NLS-1$
- deleteAction = new DeleteAction(DTDEditorPlugin.getResourceString("_UI_ACTION_DTD_DELETE")); //$NON-NLS-1$
- addAttributeAction = new AddAttributeAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_ATTRIBUTE")); //$NON-NLS-1$
- addAttributeListAction = new AddAttributeListAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_ATTRIBUTELIST")); //$NON-NLS-1$
-
- addGroupToContentModelAction = new AddGroupToContentModelAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_GROUP_ADD_GROUP")); //$NON-NLS-1$
- addElementToContentModelAction = new AddElementToContentModelAction(editor, DTDEditorPlugin.getResourceString("_UI_ACTION_ADD_ELEMENT")); //$NON-NLS-1$
-
- addNotationAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_NOTATION));
- addEntityAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_ENTITY));
- addCommentAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_COMMENT));
- addParameterEntityReferenceAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ADD_ENTITY_REFERENCE));
-
- // Tri-state images
- addElementAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ELEMENT));
- addElementAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ELEMENT));
- addElementAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ELEMENT));
-
- addAttributeAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ATTRIBUTE));
- addAttributeAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ATTRIBUTE));
- addAttributeAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ATTRIBUTE));
-
- addAttributeListAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ATTRIBUTE));
- addAttributeListAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ATTRIBUTE));
- addAttributeListAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ATTRIBUTE));
-
- addGroupToContentModelAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_GROUPTOCONMODEL));
- addGroupToContentModelAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_GROUPTOCONMODEL));
- addGroupToContentModelAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_GROUPTOCONMODEL));
-
- addElementToContentModelAction.setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_ETOOL_ADD_ELEMENTTOCONMODEL));
- addElementToContentModelAction.setHoverImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_CTOOL_ADD_ELEMENTTOCONMODEL));
- addElementToContentModelAction.setDisabledImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_DTOOL_ADD_ELEMENTTOCONMODEL));
- }
-
- public void addActionItemsForSelection(Object selectedObject, IMenuManager menu) {
- if (undoAction == null) {
- undoAction = editor.getAction(ActionFactory.UNDO.getId());
- redoAction = editor.getAction(ActionFactory.REDO.getId());
- }
-
- menu.add(undoAction);
- menu.add(redoAction);
- menu.add(new Separator());
-
- if (selectedObject instanceof IndexedNodeList) {
- // http://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4201
- // add appropriate menu to logical view
- NodeList folder = ((IndexedNodeList) selectedObject).getTarget();
- if (folder.getListType().equals(DTDRegionTypes.NOTATION_TAG)) {
- menu.add(addNotationAction);
- } else if (folder.getListType().equals(DTDRegionTypes.ENTITY_TAG)) {
- menu.add(addEntityAction);
- } else if (folder.getListType().equals(DTDRegionTypes.ELEMENT_TAG)) {
- LabelValuePair[] availableEntities = ((DTDModelImpl) editor.getModel()).createParmEntityContentItems(null);
- addParameterEntityReferenceAction.setEnabled(availableEntities.length > 0);
-
- menu.add(addElementAction);
- menu.add(addParameterEntityReferenceAction);
- }
- }
- if (selectedObject instanceof DTDFile || selectedObject == null) {
- LabelValuePair[] availableEntities = ((DTDModelImpl) editor.getModel()).createParmEntityContentItems(null);
- addParameterEntityReferenceAction.setEnabled(availableEntities.length > 0);
-
- menu.add(addElementAction);
- menu.add(addEntityAction);
- menu.add(addNotationAction);
- menu.add(addParameterEntityReferenceAction);
- menu.add(addCommentAction);
- menu.add(addAttributeListAction);
- menu.add(new Separator());
- }
-
- if (selectedObject instanceof Element) {
- Element dtdElement = (Element) selectedObject;
-
- if (dtdElement.getContentModel() == null) {
- menu.add(addGroupToContentModelAction);
- menu.add(addElementToContentModelAction);
- }
- // if (!(((Element)selectedObject).getContentModel() instanceof
- // CMGroupNode))
- // {
- // menu.add(addGroupToContentModelAction);
- // }
- // addAttributeAction.setElement(selectedObject);
- menu.add(addAttributeAction);
- } else if (selectedObject instanceof CMGroupNode) {
- // addElementToContentModelAction.setElement(selectedObject);
- // addGroupToContentModelAction.setElement(selectedObject);
- menu.add(addElementToContentModelAction);
- menu.add(addGroupToContentModelAction);
- } else if (selectedObject instanceof AttributeList) {
- menu.add(addAttributeAction);
- }
-
- menu.add(new Separator());
- addEditActions(menu);
- menu.add(new Separator());
-
- if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
- menu.add(deleteAction);
- deleteAction.setEnabled(true);
- // if (selectedObject instanceof DTDElementContent)
- // {
- // DTDElementContent content = (DTDElementContent) selectedObject;
- // if (content.getElement() != null && (content instanceof
- // DTDPCDataContent || content instanceof DTDEmptyContent))
- // {
- // deleteAction.setEnabled(false);
- // } // end of if ()
- // } // end of if ()
- }
- }
-
- public void addEditActions(IMenuManager menu) {
- // menu.add(undoAction);
- // menu.add(redoAction);
- // menu.add(new Separator());
- // menu.add(cutAction);
- // menu.add(copyAction);
- // menu.add(pasteAction);
- }
-
- public void createMenuListenersFor(Viewer viewer) {
- viewer.addSelectionChangedListener(addNotationAction);
- viewer.addSelectionChangedListener(addEntityAction);
- viewer.addSelectionChangedListener(addElementAction);
- viewer.addSelectionChangedListener(addCommentAction);
- viewer.addSelectionChangedListener(addParameterEntityReferenceAction);
- viewer.addSelectionChangedListener(deleteAction);
- viewer.addSelectionChangedListener(addAttributeAction);
- viewer.addSelectionChangedListener(addAttributeListAction);
- viewer.addSelectionChangedListener(addGroupToContentModelAction);
- viewer.addSelectionChangedListener(addElementToContentModelAction);
-
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- addNotationAction.selectionChanged(selection);
- addEntityAction.selectionChanged(selection);
- addElementAction.selectionChanged(selection);
- addParameterEntityReferenceAction.selectionChanged(selection);
- deleteAction.selectionChanged(selection);
- addAttributeAction.selectionChanged(selection);
- addAttributeListAction.selectionChanged(selection);
- addGroupToContentModelAction.selectionChanged(selection);
- addElementToContentModelAction.selectionChanged(selection);
-
- // viewer.addSelectionChangedListener(cutAction);
- // viewer.addSelectionChangedListener(copyAction);
- // viewer.addSelectionChangedListener(pasteAction);
-
- // viewerList.add(viewer);
- // viewer.getControl().addFocusListener(this);
- }
-
- public DeleteAction getDeleteAction() {
- return deleteAction;
- }
-
- /**
- * @return Returns the menuListener.
- */
- public IMenuListener getMenuListener() {
- return fMenuListener;
- }
-
- // public void focusGained(FocusEvent event)
- // {
- // updateSelection();
- // }
-
- public void removeMenuListenersFor(Viewer viewer) {
- viewer.removeSelectionChangedListener(addNotationAction);
- viewer.removeSelectionChangedListener(addEntityAction);
- viewer.removeSelectionChangedListener(addElementAction);
- viewer.removeSelectionChangedListener(addCommentAction);
- viewer.removeSelectionChangedListener(addParameterEntityReferenceAction);
- viewer.removeSelectionChangedListener(deleteAction);
- viewer.removeSelectionChangedListener(addAttributeAction);
- viewer.removeSelectionChangedListener(addAttributeListAction);
- viewer.removeSelectionChangedListener(addGroupToContentModelAction);
- viewer.removeSelectionChangedListener(addElementToContentModelAction);
- }
-
- // Update all the actions for the viewer in focus
- public void updateActions() {
- // undoAction.update();
- // redoAction.update();
- }
-
- public void updateEditActions(IActionBars actionBars) {
- // if (actionBars != null)
- // {
- // actionBars.setGlobalActionHandler(IWorkbenchActionConstants.CUT,
- // cutAction);
- // actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY,
- // copyAction);
- // actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PASTE,
- // pasteAction);
- // actionBars.setGlobalActionHandler(IWorkbenchActionConstants.UNDO,
- // undoAction);
- // actionBars.setGlobalActionHandler(IWorkbenchActionConstants.REDO,
- // redoAction);
- // }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java
deleted file mode 100644
index 6ef7e5276d..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDLabelProvider.java
+++ /dev/null
@@ -1,87 +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.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.NodeList;
-
-
-/**
- * Based on com.ibm.etools.dtd.editor.viewers.DTDLabelProvider
- */
-
-public class DTDLabelProvider extends LabelProvider {
-
- public DTDLabelProvider() {
- super();
- }
-
- /**
- * Returns the image for the label of the given element.
- *
- * @param element
- * the element for which to provide the label image
- * @return the image used to label the element, or <code>null</code> if
- * these is no image for the given object
- */
- public Image getImage(Object element) {
- Image image = null;
- if (element instanceof DTDNode) {
- image = ((DTDNode) element).getImage();
- } else if (element instanceof NodeList) {
- image = ((NodeList) element).getImage();
- } else if (element instanceof IndexedNodeList) {
- return ((IndexedNodeList) element).getTarget().getImage();
- } else if (element instanceof DTDFile) {
- image = ((DTDFile) element).getImage();
- } else {
- image = super.getImage(element);
- }
- return image;
- }
-
- /**
- * Returns the text for the label of the given element.
- *
- * @param element
- * the element for which to provide the label text
- * @return the text string used to label the element, or <code>null</code>
- * if these is no text label for the given object
- */
- public String getText(Object element) {
- if (element instanceof DTDNode) {
- String name = ((DTDNode) element).getName();
-
- // strip leading whitespace (useful for multi-line comments)
- int i = 0;
- for (i = 0; i < name.length(); i++) {
- if (!Character.isWhitespace(name.charAt(i)))
- break;
- }
- if (i > 0 && i < name.length() - 1)
- name = name.substring(i);
-
- return name;
- } else if (element instanceof NodeList) {
- return ((NodeList) element).getListType();
- } else if (element instanceof IndexedNodeList) {
- return ((IndexedNodeList) element).getTarget().getName();
- } else if (element instanceof DTDFile) {
- return ((DTDFile) element).getName();
- }
- return super.getText(element);
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
deleted file mode 100644
index dc7f1ceefa..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/DTDTreeContentProvider.java
+++ /dev/null
@@ -1,288 +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.dtd.ui.views.contentoutline;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.dtd.core.Attribute;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.Comment;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.dtd.core.Entity;
-import org.eclipse.wst.dtd.core.NodeList;
-import org.eclipse.wst.dtd.core.Notation;
-import org.eclipse.wst.dtd.core.ParameterEntityReference;
-import org.eclipse.wst.dtd.core.document.DTDModelImpl;
-import org.eclipse.wst.dtd.core.event.IDTDFileListener;
-import org.eclipse.wst.dtd.core.event.NodesEvent;
-
-
-/**
- * Based on com.ibm.etools.dtd.editor.viewers.DTDTreeContentProvider
- */
-
-public class DTDTreeContentProvider implements ITreeContentProvider, IDTDFileListener {
-
- private Object fInputObject;
- protected Viewer fViewer;
-
- // A cached set of IndexedNodeLists, required for getParent to return the
- // correct instances mapping to TreeItems
- protected Object[] logicalNodeLists = null;
-
- private boolean showLogicalOrder = false;
-
- public DTDTreeContentProvider() {
- super();
- }
-
- public void dispose() {
- fViewer = null;
- }
-
- private void expandToNode(DTDNode node) {
- DTDFile dtdFile = node.getDTDFile();
- // first expand the root
- AbstractTreeViewer viewer = (AbstractTreeViewer) fViewer;
- viewer.expandToLevel(dtdFile, 1);
- NodeList listToExpand = null;
- if (node instanceof Element || node instanceof ParameterEntityReference) {
- listToExpand = dtdFile.getElementsAndParameterEntityReferences();
- } else if (node instanceof Notation) {
- listToExpand = dtdFile.getNotations();
- } else if (node instanceof Entity) {
- listToExpand = dtdFile.getEntities();
- } else if (node instanceof Comment) {
- listToExpand = dtdFile.getComments();
- }
- if (listToExpand != null) {
- viewer.expandToLevel(listToExpand, 1);
- }
- viewer.expandToLevel(node, 0);
- }
-
- public Object[] getChildren(Object parentElement) {
- // return the lists of nodes when in logical order mode, all the Nodes
- // otherwise
- if (parentElement instanceof DTDFile) {
- if (isShowLogicalOrder()) {
- if (logicalNodeLists == null) {
- DTDFile file = (DTDFile) parentElement;
- Object[] children = file.getNodeLists().toArray();
- for (int i = 0; i < children.length; i++) {
- children[i] = new IndexedNodeList((NodeList) children[i]);
- }
- logicalNodeLists = children;
- }
- return logicalNodeLists;
- } else {
- return ((DTDFile) parentElement).getNodes().toArray();
- }
- } else if (parentElement instanceof NodeList) {
- return ((NodeList) parentElement).getNodes().toArray();
- } else if (parentElement instanceof IndexedNodeList) {
- return ((IndexedNodeList) parentElement).getTarget().getNodes().toArray();
- } else if (parentElement instanceof Element && isShowLogicalOrder()) {
- // then group the attributes under the element
- Object[] children = ((DTDNode) parentElement).getChildren();
- List attributes = ((Element) parentElement).getElementAttributes();
- Object[] logicalChildren = new Object[children.length + attributes.size()];
- int index = 0;
- for (index = 0; index < children.length; index++) {
- logicalChildren[index] = children[index];
- }
- for (Iterator iter = attributes.iterator(); iter.hasNext();) {
- logicalChildren[index++] = iter.next();
- }
- return logicalChildren;
- } else if (parentElement instanceof DTDNode) {
- return ((DTDNode) parentElement).getChildren();
- }
- return Collections.EMPTY_LIST.toArray();
- }
-
- public Object[] getElements(java.lang.Object inputElement) {
- Object[] elements = null;
- // Always show the DTDFile "node"
- if (inputElement instanceof DTDModelImpl) {
- elements = new Object[]{((DTDModelImpl) inputElement).getDTDFile()};
- }
- if (elements == null) {
- elements = new Object[0];
- }
- return elements;
- }
-
- public Object getParent(Object element) {
- Object parent = null;
- if (element instanceof DTDNode) {
- DTDNode node = (DTDNode) element;
- if (element instanceof Attribute && isShowLogicalOrder()) {
- // then we must say that the element with the same name
- // as our attributelist is our parent
- parent = node.getParentNode();
- if (parent != null) {
- String attListName = ((DTDNode) parent).getName();
- Iterator iter = node.getDTDFile().getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode currentNode = (DTDNode) iter.next();
- if (currentNode instanceof AttributeList && currentNode.getName().equals(attListName)) {
- parent = currentNode;
- }
- }
- }
- }
-
- if (parent == null) {
- parent = ((DTDNode) element).getParentNode();
- }
-
- // if showing in the logical order, return the IndexedNodeList
- // acting as the parent in the tree
- if (parent == null) {
- if (isShowLogicalOrder()) {
- Object[] indexedNodeLists = getChildren(((DTDModelImpl) fInputObject).getDTDFile());
- for (int i = 0; i < indexedNodeLists.length && parent == null; i++) {
- if (indexedNodeLists[i] instanceof IndexedNodeList) {
- if (((IndexedNodeList) indexedNodeLists[i]).contains(element))
- parent = indexedNodeLists[i];
- }
- }
- } else {
- parent = ((DTDModelImpl) fInputObject).getDTDFile();
- }
- }
- } else if (element instanceof IndexedNodeList && fInputObject instanceof DTDModelImpl) {
- parent = ((DTDModelImpl) fInputObject).getDTDFile();
- }
- return parent;
- }
-
- public boolean hasChildren(Object element) {
- Object[] children = getChildren(element);
- return children.length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fViewer = viewer;
-
- if (fInputObject instanceof DTDModelImpl) {
- ((DTDModelImpl) fInputObject).getDTDFile().removeDTDFileListener(this);
- }
- fInputObject = newInput;
- if (fInputObject instanceof DTDModelImpl) {
- ((DTDModelImpl) fInputObject).getDTDFile().addDTDFileListener(this);
- }
- }
-
- /**
- * Get the value of showLogicalOrder.
- *
- * @return value of showLogicalOrder.
- */
- public boolean isShowLogicalOrder() {
- return showLogicalOrder;
- }
-
- public void nodeChanged(DTDNode node) {
- if (fViewer instanceof StructuredViewer) {
- // System.out.println("node changed notified");
- // System.out.println("selection before = " +
- // ((StructuredViewer)view).getSelection());
- if (node instanceof AttributeList && isShowLogicalOrder()) {
- // in this case, we are showing attributes under the element.
- // refresh the element object instead
- Iterator iter = node.getDTDFile().getNodes().iterator();
- while (iter.hasNext()) {
- DTDNode currentNode = (DTDNode) iter.next();
- if (currentNode.getName().equals(node.getName()) && currentNode instanceof Element) {
- ((StructuredViewer) fViewer).refresh(currentNode);
- }
- } // end of while ()
- } else {
- // do standard stuff
- ((StructuredViewer) fViewer).refresh(node);
- }
- // System.out.println("selection after = " +
- // ((StructuredViewer)view).getSelection());
- }
- }
-
- public void nodesAdded(NodesEvent event) {
- if (fViewer instanceof AbstractTreeViewer) {
- StructuredViewer viewer = (StructuredViewer) fViewer;
- ISelection selection = viewer.getSelection();
-
- Object firstObj = (!selection.isEmpty() && selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- DTDNode oldSelectedNode = null;
- if (firstObj instanceof DTDNode) {
- oldSelectedNode = (DTDNode) firstObj;
- }
-
- // for now just refresh the whole view
- AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
- abstractTreeViewer.refresh();
-
- Iterator iter = event.getNodes().iterator();
- List newSelection = new ArrayList();
- while (iter.hasNext()) {
- DTDNode node = (DTDNode) iter.next();
- if (oldSelectedNode == null || node.getStructuredDTDDocumentRegion() != oldSelectedNode.getStructuredDTDDocumentRegion() || node.getStartOffset() != oldSelectedNode.getStartOffset() || node.getEndOffset() != oldSelectedNode.getEndOffset()) {
- // add to selection
- newSelection.add(node);
- expandToNode(node);
- }
- }
- if (newSelection.size() > 0) {
- viewer.setSelection(new StructuredSelection(newSelection));
- }
-
- }
- }
-
- public void nodesRemoved(NodesEvent event) {
- if (fViewer instanceof AbstractTreeViewer) {
- AbstractTreeViewer abstractTreeViewer = (AbstractTreeViewer) fViewer;
- for (Iterator iter = event.getNodes().iterator(); iter.hasNext();) {
- abstractTreeViewer.remove(iter.next());
- }
- }
-
- }
-
- /**
- * Set the value of showLogicalOrder.
- *
- * @param v
- * Value to assign to showLogicalOrder.
- */
- public void setShowLogicalOrder(boolean v) {
- this.showLogicalOrder = v;
- if (!v) {
- // if not using logical order, lose the cached lists
- logicalNodeLists = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/IndexedNodeList.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/IndexedNodeList.java
deleted file mode 100644
index 9225bacd72..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/IndexedNodeList.java
+++ /dev/null
@@ -1,86 +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.dtd.ui.views.contentoutline;
-
-import java.util.List;
-
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.NodeList;
-import org.eclipse.wst.sse.core.IndexedRegion;
-
-
-/* package */
-class IndexedNodeList implements IndexedRegion {
- public NodeList fTarget;
-
- public IndexedNodeList(NodeList target) {
- fTarget = target;
- }
-
- /**
- * @see org.eclipse.wst.sse.core.IndexedRegion#contains(int)
- */
- public boolean contains(int testPosition) {
- return getStartOffset() <= testPosition && testPosition <= getEndOffset();
- }
-
- public boolean contains(Object child) {
- return fTarget.getNodes().contains(child);
- }
-
- /**
- * @see org.eclipse.wst.sse.core.IndexedRegion#getEndOffset()
- */
- public int getEndOffset() {
- int end = 0;
- List nodes = fTarget.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- int thisEnd = ((DTDNode) nodes.get(i)).getEndOffset();
- if (end < thisEnd)
- end = thisEnd;
- }
- return end;
- }
-
- /**
- * @see org.eclipse.wst.sse.core.IndexedRegion#getStartOffset()
- */
- public int getStartOffset() {
- int start = -1;
- List nodes = fTarget.getNodes();
- for (int i = 0; i < nodes.size(); i++) {
- int thisStart = ((DTDNode) nodes.get(i)).getStartOffset();
- if (start > thisStart || start < 0)
- start = thisStart;
- }
- if (start < 0)
- start = 0;
- return start;
- }
-
- /**
- * @return
- */
- public NodeList getTarget() {
- return fTarget;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return getClass().getName() + ":" + fTarget.toString(); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java
deleted file mode 100644
index c32c119d2a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/OrderAction.java
+++ /dev/null
@@ -1,64 +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
- *
- *******************************************************************************/
-/*
- * Created on Jan 22, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.dtd.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateAction;
-
-
-/**
- * Based on com.ibm.etools.dtd.editor.DTDContentOutlinePage#OrderAction
- */
-class OrderAction extends PropertyChangeUpdateAction {
- private DTDTreeContentProvider contentProvider;
- private TreeViewer treeViewer;
-
- public OrderAction(TreeViewer viewer, DTDTreeContentProvider provider, IPreferenceStore store, String preferenceKey) {
- super(DTDEditorPlugin.getResourceString("_UI_BUTTON_GROUP_ITEMS_LOGICALLY"), store, preferenceKey, false); //$NON-NLS-1$
- setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_ORGANIZE_DTD_LOGICALLY));
- treeViewer = viewer;
- contentProvider = provider;
- setToolTipText(getText());
- contentProvider.setShowLogicalOrder(isChecked());
- }
-
- public void update() {
- super.update();
- setChecked(getPreferenceStore().getBoolean(getPreferenceKey()));
- // treeViewer.getControl().setVisible(false);
- // treeViewer.getControl().setRedraw(false);
- Object[] expandedElements = treeViewer.getExpandedElements();
- ISelection selection = treeViewer.getSelection();
- contentProvider.setShowLogicalOrder(isChecked());
-
- //treeViewer.setInput(treeViewer.getInput());
- treeViewer.refresh(treeViewer.getInput());
-
- treeViewer.setExpandedElements(expandedElements);
- treeViewer.setSelection(selection);
- // treeViewer.getControl().setVisible(true);
- // treeViewer.getControl().setRedraw(true);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
deleted file mode 100644
index 4a343dfae7..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/SortAction.java
+++ /dev/null
@@ -1,63 +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.dtd.ui.views.contentoutline;
-
-import java.text.Collator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImageHelper;
-import org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages;
-import org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateAction;
-
-
-/**
- * Based on com.ibm.etools.dtd.editor.DTDContentOutlinePage#SortAction
- */
-class SortAction extends PropertyChangeUpdateAction {
- private TreeViewer treeViewer;
-
- public SortAction(TreeViewer viewer, IPreferenceStore store, String preferenceKey) {
- super(DTDEditorPlugin.getResourceString("_UI_BUTTON_SORT_ITEMS"), store, preferenceKey, false); //$NON-NLS-1$
- setImageDescriptor(DTDEditorPluginImageHelper.getInstance().getImageDescriptor(DTDEditorPluginImages.IMG_OBJ_SORT));
- setToolTipText(getText());
- treeViewer = viewer;
- if (isChecked()) {
- treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- super.update();
- //treeViewer.getControl().setVisible(false);
- treeViewer.getControl().setRedraw(false);
- Object[] expandedElements = treeViewer.getExpandedElements();
- if (isChecked()) {
- treeViewer.setSorter(new ViewerSorter(Collator.getInstance()));
- } else {
- treeViewer.setSorter(null);
- }
- treeViewer.setInput(treeViewer.getInput());
- treeViewer.setExpandedElements(expandedElements);
- // treeViewer.getControl().setVisible(true);
- treeViewer.getControl().setRedraw(true);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeAction.java
deleted file mode 100644
index d63991d871..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeAction.java
+++ /dev/null
@@ -1,54 +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.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.AttributeList;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddAttributeAction extends BaseAction {
-
- public AddAttributeAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- String newName = "NewAttribute"; //$NON-NLS-1$
- if (selectedNode instanceof AttributeList) {
- ((AttributeList) selectedNode).addAttribute(newName);
- } else if (selectedNode instanceof Element) {
- ((Element) selectedNode).addAttribute(newName);
- }
- }
-
- protected boolean updateSelection(IStructuredSelection selection) {
- boolean rc = super.updateSelection(selection);
- DTDNode node = getFirstNodeSelected(selection);
- if (node instanceof Element) {
- // System.out.println("attribute set to true");
- setEnabled(true);
- } else {
- // System.out.println("attribute set to false");
- setEnabled(false);
- }
-
- return rc;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeListAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeListAction.java
deleted file mode 100644
index d5491d83f6..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddAttributeListAction.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.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddAttributeListAction extends BaseAction {
-
- public AddAttributeListAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- DTDFile dtdFile = getModel().getDTDFile();
- String attListName = "NewAttList"; //$NON-NLS-1$
- if (selectedNode != null) {
- DTDNode topLevelNode = dtdFile.getTopLevelNodeAt(selectedNode.getStartOffset());
- if (topLevelNode instanceof Element) {
- attListName = ((Element) topLevelNode).getName();
- }
- }
-
- getModel().getDTDFile().createAttributeList(selectedNode, attListName, true);
- // newElement.setName(DTDUniqueNameHelper.getUniqueElementName(dtdFile));
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddCommentAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddCommentAction.java
deleted file mode 100644
index 62d1ebefa4..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddCommentAction.java
+++ /dev/null
@@ -1,32 +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.dtd.ui.views.contentoutline.actions;
-
-//import com.ibm.etools.dtd.util.DTDUniqueNameHelper;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddCommentAction extends BaseAction {
-
- public AddCommentAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- getModel().getDTDFile().createComment(selectedNode, "NewComment", true); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementAction.java
deleted file mode 100644
index cb15e96b67..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementAction.java
+++ /dev/null
@@ -1,33 +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.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.util.DTDUniqueNameHelper;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddElementAction extends BaseAction {
-
- public AddElementAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
- DTDFile dtdFile = getModel().getDTDFile();
- String elementName = DTDUniqueNameHelper.getUniqueElementName(dtdFile);
- dtdFile.createElement(selectedNode, elementName, true); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementToContentModelAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementToContentModelAction.java
deleted file mode 100644
index 0e8bef34db..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddElementToContentModelAction.java
+++ /dev/null
@@ -1,50 +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.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.wst.dtd.core.CMGroupNode;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddElementToContentModelAction extends BaseAction {
-
- public AddElementToContentModelAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode node = getFirstNodeSelected();
-
- if (node instanceof CMGroupNode) {
- ((CMGroupNode) node).addChild();
- } else if (node instanceof Element) {
- ((Element) node).addChild();
- }
- }
-
- protected boolean updateSelection(IStructuredSelection selection) {
- boolean rc = super.updateSelection(selection);
- DTDNode node = getFirstNodeSelected(selection);
- if (node instanceof CMGroupNode) {
- setEnabled(true);
- } else {
- setEnabled(false);
- }
- return rc;
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddEntityAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddEntityAction.java
deleted file mode 100644
index f8250b3c9a..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddEntityAction.java
+++ /dev/null
@@ -1,35 +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.dtd.ui.views.contentoutline.actions;
-
-
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddEntityAction extends BaseAction {
-
- public AddEntityAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
-
- getModel().getDTDFile().createEntity(selectedNode, "NewEntity", true); //$NON-NLS-1$
- // newElement.setName(DTDUniqueNameHelper.getUniqueElementName(dtdFile));
-
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddGroupToContentModelAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddGroupToContentModelAction.java
deleted file mode 100644
index 303cd57e75..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddGroupToContentModelAction.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-
-package org.eclipse.wst.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.CMGroupNode;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.Element;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddGroupToContentModelAction extends BaseAction {
-
- // private Object element;
-
- public AddGroupToContentModelAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode node = getFirstNodeSelected();
-
- if (node instanceof CMGroupNode) {
- ((CMGroupNode) node).addGroup();
- } else if (node instanceof Element) {
- ((Element) node).addGroup();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddNotationAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddNotationAction.java
deleted file mode 100644
index 12bcefaae8..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddNotationAction.java
+++ /dev/null
@@ -1,34 +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.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddNotationAction extends BaseAction {
-
- public AddNotationAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public void run() {
- DTDNode selectedNode = getFirstNodeSelected();
-
- getModel().getDTDFile().createNotation(selectedNode, "NewNotation", true); //$NON-NLS-1$
-
- // newNotation.setName(DTDUniqueNameHelper.getUniqueNotationName(dtdFile));
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddParameterEntityReferenceAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddParameterEntityReferenceAction.java
deleted file mode 100644
index 7ee2c08be4..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/AddParameterEntityReferenceAction.java
+++ /dev/null
@@ -1,48 +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.dtd.ui.views.contentoutline.actions;
-
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.util.LabelValuePair;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-public class AddParameterEntityReferenceAction extends BaseAction {
- public AddParameterEntityReferenceAction(StructuredTextEditor editor, String label) {
- super(editor, label);
- }
-
- public String getFirstExternalParameterEntity(DTDFile dtdFile) {
- LabelValuePair[] freeExternalEntities = dtdFile.getDTDModel().createParmEntityContentItems(null);
-
- if (freeExternalEntities.length > 0) {
- return (String) freeExternalEntities[0].fValue;
- // return (Entity) freeExternalEntities[0].fValue;
- }
- return null;
- }
-
- public void run() {
- DTDFile dtdFile = getModel().getDTDFile();
- String extEntity = getFirstExternalParameterEntity(dtdFile);
- DTDNode selectedNode = getFirstNodeSelected();
- if (extEntity != null) {
- dtdFile.createParameterEntityReference(selectedNode, extEntity, true);
- } else {
- dtdFile.createParameterEntityReference(selectedNode, "%NewEntityReference;", true); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/BaseAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/BaseAction.java
deleted file mode 100644
index 110bbeed48..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/BaseAction.java
+++ /dev/null
@@ -1,78 +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.dtd.ui.views.contentoutline.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.document.DTDModelImpl;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-
-abstract public class BaseAction extends SelectionListenerAction {
-
- protected IEditorActionBarContributor contextContributor;
- private StructuredTextEditor fTextEditor;
-
- public BaseAction(StructuredTextEditor editor, String text) {
- this(editor, text, null);
- }
-
- public BaseAction(StructuredTextEditor editor, String text, ImageDescriptor imageDesc) {
- super(text);
- fTextEditor = editor;
- setImageDescriptor(imageDesc);
- }
-
- public IEditorActionBarContributor getContextContributor() {
- return contextContributor;
- }
-
- public DTDNode getFirstNodeSelected() {
- return getFirstNodeSelected(getStructuredSelection());
- }
-
- public DTDNode getFirstNodeSelected(IStructuredSelection selection) {
- Iterator iter = selection.iterator();
- //DTDNode referencePoint = null;
- while (iter.hasNext()) {
- Object element = iter.next();
- if (element instanceof DTDNode) {
- return (DTDNode) element;
- }
- }
- return null;
- }
-
- public DTDModelImpl getModel() {
- return (DTDModelImpl) getTextEditor().getModel();
- }
-
- /**
- * @return Returns the textEditor.
- */
- public StructuredTextEditor getTextEditor() {
- return fTextEditor;
- }
-
- public void setContextContributor(IEditorActionBarContributor contributor) {
- contextContributor = contributor;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/DeleteAction.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/DeleteAction.java
deleted file mode 100644
index 0642c37186..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/contentoutline/actions/DeleteAction.java
+++ /dev/null
@@ -1,69 +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.dtd.ui.views.contentoutline.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.wst.dtd.core.CMNode;
-import org.eclipse.wst.dtd.core.DTDFile;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.core.DTDPlugin;
-import org.eclipse.wst.dtd.core.util.DTDBatchNodeDelete;
-
-
-public class DeleteAction extends SelectionListenerAction {
-
- public DeleteAction(String label) {
- super(label);
- }
-
- public void run() {
- IStructuredSelection selection = getStructuredSelection();
-
- Iterator iter = selection.iterator();
- DTDBatchNodeDelete batchDelete = null;
- DTDFile dtdFile = null;
- while (iter.hasNext()) {
- Object element = iter.next();
- if (element instanceof DTDNode) {
- DTDNode node = (DTDNode) element;
- dtdFile = node.getDTDFile();
- if (batchDelete == null) {
- batchDelete = new DTDBatchNodeDelete(dtdFile);
- }
- batchDelete.addNode((DTDNode) element);
- }
- }
- dtdFile.getDTDModel().beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_DTD_FILE_DELETE")); //$NON-NLS-1$
- batchDelete.deleteNodes(this);
- dtdFile.getDTDModel().endRecording(this);
- }
-
- public boolean updateSelection(IStructuredSelection sel) {
- if (!super.updateSelection(sel))
- return false;
-
- Object selectedObject = sel.getFirstElement();
- if (selectedObject instanceof DTDNode && !(selectedObject instanceof CMNode && ((CMNode) selectedObject).isRootElementContent())) {
- setEnabled(true);
- return true; // enable delete menu item
- } else {
- setEnabled(false);
- return false; // disable it - grey out
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapter.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapter.java
deleted file mode 100644
index 67a7d07827..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapter.java
+++ /dev/null
@@ -1,131 +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.dtd.ui.views.properties;
-
-
-
-import java.util.Stack;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.dtd.core.DTDNode;
-import org.eclipse.wst.dtd.ui.DTDEditorPlugin;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.properties.CustomPropertyDescriptor;
-
-
-/**
- * An IPropertySource implementation for a JFace viewer used to display
- * properties of DOM nodes. Requires an adapter factory to create JFace
- * adapters for the nodes in the tree.
- */
-public class DTDPropertySourceAdapter implements INodeAdapter, IPropertySource {
- protected final static String CATEGORY_ATTRIBUTES = "Attributes"; //$NON-NLS-1$
-
- private static final String ID_NAME = DTDEditorPlugin.getResourceString("DTDPropertySourceAdapter.0"); //$NON-NLS-1$
- private static final String ID_TEXT = DTDEditorPlugin.getResourceString("DTDPropertySourceAdapter.1"); //$NON-NLS-1$
-
- protected IPropertyDescriptor[] fDescriptors = null;
- protected INodeNotifier fNode = null;
-
- protected Stack fValuesBeingSet = new Stack();
-
- public DTDPropertySourceAdapter(INodeNotifier target) {
- super();
- fNode = target;
- }
-
- /**
- * @return
- */
- private IPropertyDescriptor[] createPropertyDescriptors() {
- CustomPropertyDescriptor nameDescriptor = new CustomPropertyDescriptor(ID_NAME, ID_NAME, null);
- nameDescriptor.setCategory(DTDEditorPlugin.getResourceString("DTDPropertySourceAdapter.2")); //$NON-NLS-1$
- // CustomPropertyDescriptor contentDescriptor = new
- // CustomPropertyDescriptor(ID_TEXT, ID_TEXT, null);
- // contentDescriptor.setCategory("Attributes");
- return new IPropertyDescriptor[]{nameDescriptor};
- }
-
- /**
- * Returns a value for this Node that can be editted in a property sheet.
- *
- * @return a value that can be editted
- */
- public Object getEditableValue() {
- return null;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return all valid descriptors.
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (fDescriptors == null || fDescriptors.length == 0) {
- fDescriptors = createPropertyDescriptors();
- } else {
- updatePropertyDescriptors();
- }
- return fDescriptors;
- }
-
- /**
- * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
- */
- public Object getPropertyValue(Object id) {
- Object value = null;
- if (id.equals(ID_NAME) && fNode instanceof DTDNode) {
- value = ((DTDNode) fNode).getName();
- }
- if (id.equals(ID_TEXT) && fNode instanceof DTDNode) {
- value = ((DTDNode) fNode).getFullNodeText();
- }
- return value;
- }
-
- /**
- * Allowing the INodeAdapter to compare itself against the type allows it
- * to return true in more than one case.
- */
- public boolean isAdapterForType(Object type) {
- return type == IPropertySource.class;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
- */
- public boolean isPropertySet(Object id) {
- return false;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)
- */
- public void resetPropertyValue(Object id) {
- }
-
- public void setPropertyValue(Object nameObject, Object value) {
- }
-
- protected void updatePropertyDescriptors() {
- }
-}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapterFactory.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapterFactory.java
deleted file mode 100644
index 900da6f691..0000000000
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/views/properties/DTDPropertySourceAdapterFactory.java
+++ /dev/null
@@ -1,42 +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.dtd.ui.views.properties;
-
-
-
-import org.eclipse.ui.views.properties.IPropertySource;
-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;
-
-
-public class DTDPropertySourceAdapterFactory extends AbstractAdapterFactory {
-
- public DTDPropertySourceAdapterFactory() {
- super(IPropertySource.class, true);
- }
-
- public DTDPropertySourceAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- public AdapterFactory copy() {
- return new DTDPropertySourceAdapterFactory(this.adapterKey, this.shouldRegisterAdapter);
- }
-
- protected INodeAdapter createAdapter(INodeNotifier target) {
- // at the moment, only one implementation exists
- return new DTDPropertySourceAdapter(target);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/.classpath b/bundles/org.eclipse.wst.html.ui/.classpath
deleted file mode 100644
index 065ac06e19..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.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.html.ui/.compatibility b/bundles/org.eclipse.wst.html.ui/.compatibility
deleted file mode 100644
index 730407f0af..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.compatibility
+++ /dev/null
@@ -1,2 +0,0 @@
-#Wed Mar 24 13:53:52 EST 2004
-.project=4633
diff --git a/bundles/org.eclipse.wst.html.ui/.cvsignore b/bundles/org.eclipse.wst.html.ui/.cvsignore
deleted file mode 100644
index 2f941d80f2..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-htmleditor.jar
-temp.folder
-build.xml
diff --git a/bundles/org.eclipse.wst.html.ui/.project b/bundles/org.eclipse.wst.html.ui/.project
deleted file mode 100644
index 38bee736ad..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.html.ui</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.html.ui/build.properties b/bundles/org.eclipse.wst.html.ui/build.properties
deleted file mode 100644
index fb3c968eec..0000000000
--- a/bundles/org.eclipse.wst.html.ui/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,\
- html.jar,\
- icons/,\
- plugin.properties,\
- templates/
-source.htmleditor.jar = src/
-src.includes = plugin.xml,\
- plugin.properties,\
- icons/,\
- build.xml,\
- templates/
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
deleted file mode 100644
index b99b45cac1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/table.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
deleted file mode 100644
index f58992d6c8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-anchor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
deleted file mode 100644
index 005fa99b46..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-body.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
deleted file mode 100644
index d143fcf621..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-button.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
deleted file mode 100644
index bbb40cb3f1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-font.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
deleted file mode 100644
index 3b139588c1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-form.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
deleted file mode 100644
index fb39ba6f9e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-html.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
deleted file mode 100644
index ef3235d170..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image-map.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
deleted file mode 100644
index a988c1d5fb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-image.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
deleted file mode 100644
index 4084602119..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-jsp.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
deleted file mode 100644
index b129090b16..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-title.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
deleted file mode 100644
index 5e7fb33399..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.html.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.properties b/bundles/org.eclipse.wst.html.ui/plugin.properties
deleted file mode 100644
index bfc85a9b2a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/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
-###############################################################################
-SSE_HTML_Source_Editor.name=SSE HTML Source Editor
-SSE_HTML_Source_Editor_NL_Support.name=SSE HTML Source Editor NL Support
-HTML_Source_Page_Editor.name=HTML Source Page Editor
-HTML_Files.name=HTML Files
-HTML_Source.name=HTML Source
-HTML_Templates.name=HTML Templates
-HTML_Styles.name=HTML Styles
-HTML_Annotations.name=HTML Annotations
-WebContentSettings.name=Web Content Settings
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml
deleted file mode 100644
index efafc79c5e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.xml
+++ /dev/null
@@ -1,277 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.html.ui"
- name="%SSE_HTML_Source_Editor.name"
- version="1.0.0"
- provider-name="Eclipse.org"
- class="org.eclipse.wst.html.ui.HTMLEditorPlugin">
-
- <runtime>
- <library name="htmleditor.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.views"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.ui.editors"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.wst.sse.ui"/>
- <import plugin="org.eclipse.wst.xml.ui"/>
- <import plugin="org.eclipse.wst.css.ui"/>
- <import plugin="org.eclipse.wst.sse.core"/>
- <import plugin="org.eclipse.wst.css.core"/>
- <import plugin="org.eclipse.wst.html.core"/>
- <import plugin="org.eclipse.wst.javascript.common.ui"/>
- <import plugin="org.eclipse.wst.xml.core"/>
- <import plugin="org.eclipse.wst.common.contentmodel"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.common.encoding"/>
- <import plugin="org.eclipse.jdt.ui"/>
- </requires>
-
-
- <extension-point id="deviceProfileEntryProvider" name="DeviceProfileEntryProviderExtension"/>
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%HTML_Source_Page_Editor.name"
- icon="icons/sourceEditor.gif"
- extensions="html, htm, xhtml, jhtml, shtml, shtm, html-ss, wml"
- contributorClass="org.eclipse.wst.html.ui.edit.ui.ActionContributorHTML"
- class="org.eclipse.wst.html.ui.StructuredTextEditorHTML"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.html.ui.StructuredTextEditorHTML">
- </editor>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.extendedconfiguration">
- <textviewerconfiguration
- class="org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML"
- target="org.eclipse.wst.html.core.htmlsource">
- </textviewerconfiguration>
- <contentoutlineconfiguration
- class="org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration"
- target="org.eclipse.wst.html.core.htmlsource">
- </contentoutlineconfiguration>
- <propertysheetconfiguration
- class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
- target="org.eclipse.wst.html.core.htmlsource">
- </propertysheetconfiguration>
- <spellchecktarget
- class="org.eclipse.wst.xml.ui.XMLSpellCheckTarget"
- target="org.eclipse.wst.html.core.htmlsource">
- </spellchecktarget>
- <sourceeditingtexttools
- class="org.eclipse.wst.xml.ui.extensions.XMLSourceEditingTextTools"
- target="org.eclipse.wst.html.core.htmlsource">
- </sourceeditingtexttools>
- <characterpairmatcher
- class="org.eclipse.wst.html.ui.text.HTMLDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.html.core.htmlsource">
- </characterpairmatcher>
- <preferencepages
- preferenceids="org.eclipse.wst.sse.ui.preferences/org.eclipse.wst.html.ui.preferences"
- target="org.eclipse.wst.html.core.htmlsource">
- </preferencepages>
- </extension>
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.html.core.htmlsource"
- class="org.eclipse.wst.sse.ui.StructuredResourceMarkerAnnotationModelFactory"/>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.html.ui.registry.AdapterFactoryProviderForHTML">
- <contentType id="org.eclipse.wst.html.core.htmlsource"/>
- </adapterFactoryDescription>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.embeddedAdapterFactoryProvider">
- <embeddedAdapterFactoryProvider
- class="org.eclipse.wst.html.ui.registry.AdapterFactoryProviderForEmbeddedHTML">
- </embeddedAdapterFactoryProvider>
- </extension>
- <extension
- point="org.eclipse.ui.preferencePages">
-<!-- HTML PREFERENCE PAGES-->
- <page
- name="%HTML_Files.name"
- category="org.eclipse.wst.sse.ui.preferences"
- class="org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage"
- id="org.eclipse.wst.html.ui.preferences">
- </page>
- <page
- name="%HTML_Source.name"
- category="org.eclipse.wst.html.ui.preferences"
- class="org.eclipse.wst.html.ui.preferences.ui.HTMLSourcePreferencePage"
- id="org.eclipse.wst.html.ui.preferences.source">
- </page>
- <page
- name="%HTML_Templates.name"
- category="org.eclipse.wst.html.ui.preferences"
- class="org.eclipse.wst.html.ui.preferences.ui.HTMLTemplatePreferencePage"
- id="org.eclipse.wst.html.ui.preferences.templates">
- </page>
- <page
- name="%HTML_Styles.name"
- category="org.eclipse.wst.html.ui.preferences"
- class="org.eclipse.wst.html.ui.preferences.ui.HTMLColorPage"
- id="org.eclipse.wst.html.ui.preferences.styles">
- </page>
- </extension>
-<!-- Web content settings -->
- <extension
- point="org.eclipse.ui.propertyPages">
-<!-- for j2ee web project -->
- <page
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- name="%WebContentSettings.name"
- class="org.eclipse.wst.html.ui.contentproperties.ui.ProjectContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.dynamicprojectpropertypage">
- <filter
- name="nature"
- value="org.eclipse.wst.webproject.WebNature">
- </filter>
- </page>
-<!-- for static web project -->
- <page
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- name="%WebContentSettings.name"
- class="org.eclipse.wst.html.ui.contentproperties.ui.ProjectContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.staticprojectpropertypage">
- <filter
- name="nature"
- value="org.eclipse.wst.webproject.StaticWebNature">
- </filter>
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.htm*"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.shtml"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.xhtml"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.jhtml"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.jsp"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.jspf"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.jsf"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- nameFilter="*.wml"
- class="org.eclipse.wst.html.ui.contentproperties.ui.HTMLContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.htmlpropertypage">
- </page>
- </extension>
-<!-- Editor actionsets -->
- <extension
- point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part
- id="org.eclipse.wst.html.ui.StructuredTextEditorHTML">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part
- id="org.eclipse.wst.html.ui.StructuredTextEditorHTML">
- </part>
- </actionSetPartAssociation>
- </extension>
-<!-- add a default open on action for html content type -->
- <extension
- point="org.eclipse.wst.sse.ui.openon">
- <openon
- class="org.eclipse.wst.html.ui.openon.DefaultOpenOnHTML"
- id="org.eclipse.wst.html.ui.openon.DefaultOpenOnHTML">
- <contenttypeidentifier
- id="org.eclipse.wst.html.core.htmlsource" />
- </openon>
- </extension>
-<!-- Templates -->
- <extension
- point="org.eclipse.ui.editors.templates">
- <contextType
- name="All HTML context type"
- class="org.eclipse.wst.html.ui.templates.TemplateContextTypeHTML"
- id="html_all">
- </contextType>
- <contextType
- name="HTML Tag context type"
- class="org.eclipse.wst.html.ui.templates.TemplateContextTypeHTMLTag"
- id="html_tag">
- </contextType>
- <contextType
- name="HTML Attribute context type"
- class="org.eclipse.wst.html.ui.templates.TemplateContextTypeHTMLAttribute"
- id="html_attribute">
- </contextType>
- <contextType
- name="HTML Attribute value context type"
- class="org.eclipse.wst.html.ui.templates.TemplateContextTypeHTMLAttributeValue"
- id="html_attribute_value">
- </contextType>
- <include
- file="templates/htmldefault-templates.xml"
- translations="templates/htmldefault-templates.properties">
- </include>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.ui/src/EditingHTML.properties b/bundles/org.eclipse.wst.html.ui/src/EditingHTML.properties
deleted file mode 100644
index 0cbee1cfaf..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/EditingHTML.properties
+++ /dev/null
@@ -1,166 +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 line is a sample HTML document. Please translate only the following parts:
-## HTML Highlighting Preferences
-## we need a flaming logo
-Sample_HTML_doc=<!DOCTYPE HTML\n\tPUBLIC \"-//W3C/DTD/ HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML>\n\t<HEAD>\n\t\t<META content=\"text/html\">\n\t\t<TITLE>HTML Highlighting Preferences</TITLE>\n\t</HEAD>\n<BODY>\n\t<!--\n\t\twe need a flaming logo!\n\t-->\n</BODY>\n</HTML>
-! XML Common UI
-! Constants for strings
-
-NEW=New
-DELETE=Remove
-ADD_TEXT=Add Text
-ADD_CDATA_SECTION=Add CDATA Section
-ADD_COMMENT=Add Commen&t
-ADD_PROCESSING_INSTRUCTION=Add Processing Instruction
-
-_UI_MENU_ADD_AFTER=Add &After
-_UI_MENU_ADD_ATTRIBUTE=Add A&ttribute
-_UI_MENU_ADD_BEFORE=Add &Before
-_UI_MENU_ADD_CHILD=Add &Child
-_UI_MENU_REMOVE=Re&move
-_UI_MENU_REPLACE_WITH=Re&place With
-_UI_MENU_ADD_DOCTYPE=Add DOCTYPE...
-_UI_MENU_EDIT_DOCTYPE=Edit DOCTYPE...
-_UI_MENU_ADD_GRAMMAR_INFORMATION=Add Grammar Information
-_UI_MENU_VALIDATE_XML=Validate XML File
-_UI_LABEL_UNDO_ADD_DESCRIPTION=Add
-_UI_LABEL_UNDO_REPLACE_DESCRIPTION=Replace
-_UI_LABEL_EDIT_DOCTYPE=Edit DOCTYPE
-_UI_INFO_EXPAND_ALL=IWAK0105I Expand All
-_UI_INFO_COLLAPSE_ALL=IWAK0106I Collapse All
-
-_UI_MENU_ADD_DTD_INFORMATION=Add DTD Information...
-_UI_MENU_ADD_SCHEMA_INFORMATION=Add Schema Information...
-_UI_MENU_EDIT_SCHEMA_INFORMATION=Edit &Schema Information...
-_UI_MENU_EDIT_PROCESSING_INSTRUCTION=Edit Process&ing Instruction...
-
-_UI_MENU_ADD_DTD_INFORMATION_TITLE=Add DTD Information
-_UI_MENU_EDIT_PROCESSING_INSTRUCTION_TITLE=Edit Processing Instruction
-_UI_MENU_EDIT_SCHEMA_INFORMATION_TITLE=Edit Schema Information
-
-_UI_MENU_NEW_ATTRIBUTE=&New Attribute...
-_UI_MENU_NEW_ATTRIBUTE_TITLE=New Attribute
-_UI_MENU_EDIT_ATTRIBUTE=Edit Attribute...
-_UI_MENU_EDIT_ATTRIBUTE_TITLE=Edit Attribute
-_UI_MENU_NEW_ELEMENT=New &Element...
-_UI_MENU_NEW_ELEMENT_TITLE=New Element
-_UI_MENU_RENAME=R&ename
-_UI_MENU_RENAME_TITLE=Rename
-_UI_LABEL_ELEMENT_NAME=Element name:
-_UI_LABEL_LOADING_GRAMMAR=Loading grammar:
-
-_UI_MENU_ADD_COMMENT=Add Comment
-_UI_MENU_ADD_PROCESSING_INSTRUCTION=Add Processing Instruction
-_UI_MENU_ADD_CDATA_SECTION=Add CDATA Section
-_UI_MENU_ADD_PCDATA=Add #PCDATA;
-
-_UI_MENU_COMMENT=C&omment
-_UI_MENU_PROCESSING_INSTRUCTION=P&rocessing Instruction
-_UI_MENU_CDATA_SECTION=CDATA Section
-_UI_MENU_PCDATA=#PC&DATA;
-
-_UI_MENU_ADD=Add
-
-_UI_COMMENT_VALUE=comment
-_UI_PI_TARGET_VALUE=target
-_UI_PI_DATA_VALUE=data
-_UI_LABEL_ROOT_ELEMENT_VALUE=RootElement
-
-_UI_LABEL_TARGET_COLON=Target:
-_UI_LABEL_DATA_COLON=Data:
-_UI_LABEL_ROOT_ELEMENT_NAME_COLON=Root element name:
-_UI_LABEL_PUBLIC_ID_COLON=Public ID:
-_UI_LABEL_SYSTEM_ID_COLON=System ID:
-_UI_LABEL_BROWSE=Browse...
-_UI_LABEL_SELECT_XML_CATALOG_ENTRY=Select XML Catalog Entry
-_UI_LABEL_SPECIFY_SYSTEM_ID=Specify System ID
-_UI_LABEL_SELECT_FILE=Select File
-
-_UI_LABEL_KEY=Key
-_UI_LABEL_URI=URI:
-_UI_LABEL_XML_CATALOG_COLON=XML Catalog
-_UI_LABEL_NAMESPACE_NAME=Namespace Name
-_UI_LABEL_LOCATION_HINT=Location Hint
-_UI_LABEL_PREFIX=Prefix
-_UI_LABEL_NAMESPACE_NAME_COLON=Namespace Name:
-_UI_LABEL_LOCATION_HINT_COLON=Location Hint:
-_UI_LABEL_PREFIX_COLON=Prefix:
-_UI_NO_NAMESPACE_NAME=<no namespace name>
-_UI_NO_PREFIX=<no prefix>
-
-_UI_LABEL_XML_SCHEMA_INFORMATION=XML Schema Information
-
-_UI_LABEL_NAME_COLON=Name:
-_UI_LABEL_VALUE_COLON=Value:
-
-_UI_BUTTON_DELETE=Delete
-_UI_BUTTON_NEW=New...
-_UI_BUTTON_EDIT=Edit...
-
-_UI_LABEL_NEW_NAMESPACE_INFORMATION=New Namespace Information
-_UI_LABEL_EDIT_NAMESPACE_INFORMATION=Edit Namespace Information
-
-!
-! Assign links to an XML file
-!
-_UI_WORK_BENCH=Workbench Files...
-_UI_FILE_SYSTEM=Import Files...
-_UI_ASSIGN_XSL=Assign An XSL Stylesheet To The XML File
-_UI_ASSIGN_DTD=Assign A DTD file To The XML File
-_UI_ASSIGN_XSD=Assign An XML schema To The XML File
-_UI_SELECT_XSL_TITLE=Select an XSL File
-_UI_SELECT_XSL_DESC=Select an XSL file from the workbench.
-
-_UI_ASSIGN=Assign
-_UI_XSD=XML Schema...
-_UI_DTD=DTD...
-_UI_XSL=XSL Stylesheet...
-
-! XMLValidator.java
-_UI_XML_VALIDATOR=XML Validator
-! SelectFileOrXMLCatalogIdPanel.java
-
-_UI_RADIO_BUTTON_SELECT_FROM_WORKSPACE=Select file from workbench
-_UI_RADIO_BUTTON_SELECT_FROM_CATALOG=Select XML Catalog entry
-
-_UI_WARNING_TITLE_ROOT_ELEMENT_REQUIRED=Root Element Required
-_UI_WARNING_DOCUMENT_REQUIRES_ROOT=The document requires a root element in order to add schema information.
-_UI_WARNING_MORE_THAN_ONE_NS_WITH_NAME=More than one namespace has been specified with the namespace name :
-_UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_NAME=More than one schema has been specified without a namespace name
-_UI_WARNING_MORE_THAN_ONE_NS_WITHOUT_PREFIX=More than one namespace has been specificed without a prefix
-_UI_WARNING_MORE_THAN_ONE_NS_WITH_PREFIX=More than one namespace has been specified with the prefix :
-_UI_WARNING_SCHEMA_CAN_NOT_BE_LOCATED=The specified schema can not be located :
-_UI_WARNING_LOCATION_HINT_NOT_SPECIFIED=A location hint has not been specified for the namespace with name
-_UI_WARNING_NAMESPACE_NAME_NOT_SPECIFIED=A name must be specified for the namespace with prefix :
-_UI_WARNING_PREFIX_NOT_SPECIFIED=A prefix must be specified for the namespace named :
-_UI_WARNING_ROOT_ELEMENT_MUST_BE_SPECIFIED=A root element name must be specified.
-_UI_WARNING_SYSTEM_ID_MUST_BE_SPECIFIED=A system ID must be specified.
-
-!======================================================================================
-!
-! Here is the list of Error string that have message IDs - make sure they are unique
-! Range for XMLBuilder messageIDs: IWAX1601E - IWAX1800E
-! Since we'll be combing these plugins at some later point we'll use the same range
-! and be carefull not to clobber those defined in xmlbuilder's plugin.properties
-!======================================================================================
-_ERROR_XML_ATTRIBUTE_ALREADY_EXISTS=IWAK0107E The element already has an attribute with this name.
-
-#
-TemplateContextTypeHTMLTag.0=HTML Tags
-TemplateContextTypeHTML.0=All HTML
-TemplateContextTypeHTMLAttributeValue.0=HTML Attribute Values
-TemplateContextTypeHTMLAttribute.0=HTML Attributes
-
-HTMLFilesPreferencePage.0=Loading files...
-HTMLFilesPreferencePage.1=Add this suffix (if not specified):
-HTMLFilesPreferencePage.2=Insert DOCTYPE declaration
-HTMLFilesPreferencePage.3=Insert GENERATOR with META tag \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/HTMLEditorPlugin.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/HTMLEditorPlugin.java
deleted file mode 100644
index 66f160c303..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/HTMLEditorPlugin.java
+++ /dev/null
@@ -1,195 +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.html.ui;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.style.IStyleConstantsHTML;
-import org.eclipse.wst.html.ui.templates.TemplateContextTypeHTML;
-import org.eclipse.wst.html.ui.templates.TemplateContextTypeHTMLAttribute;
-import org.eclipse.wst.html.ui.templates.TemplateContextTypeHTMLAttributeValue;
-import org.eclipse.wst.html.ui.templates.TemplateContextTypeHTMLTag;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryRegistryImpl;
-import org.eclipse.wst.sse.ui.registry.embedded.EmbeddedAdapterFactoryRegistryImpl;
-import org.eclipse.wst.xml.ui.style.IStyleConstantsXML;
-
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLEditorPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- protected static HTMLEditorPlugin instance = null;
-
- /**
- * The template store for the html editor.
- */
- private TemplateStore fTemplateStore;
-
- /**
- * The template context type registry for the html editor.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- public HTMLEditorPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- instance = this;
-
- // reference the preference store so
- // initializeDefaultPreferences(IPreferenceStore preferenceStore) is called
- getPreferenceStore();
- }
-
- public static HTMLEditorPlugin getDefault() {
- return instance;
- }
-
- public synchronized static HTMLEditorPlugin getInstance() {
- return instance;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- public AdapterFactoryRegistry getEmbeddedAdapterFactoryRegistry() {
- return EmbeddedAdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPluginPreferences()
- */
- protected void initializeDefaultPreferences(IPreferenceStore store) {
-
- // ignore this preference store
- // use EditorPlugin preference store
- IPreferenceStore editorStore = ((AbstractUIPlugin)Platform.getPlugin(EditorPlugin.ID)).getPreferenceStore();
- EditorPlugin.initializeDefaultEditorPreferences(editorStore);
- initializeDefaultHTMLPreferences(editorStore);
- }
-
- protected void initializeDefaultHTMLPreferences(IPreferenceStore store) {
- String ctId = IContentTypeIdentifier.ContentTypeID_HTML;
-
- store.setDefault(PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.CONTENT_ASSIST_SUPPORTED, ctId), true);
- store.setDefault(PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.AUTO_PROPOSE, ctId), true);
- store.setDefault(PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.AUTO_PROPOSE_CODE, ctId), CommonEditorPreferenceNames.LT);
-
- store.setDefault(PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.EDITOR_VALIDATION_METHOD, ctId), CommonEditorPreferenceNames.EDITOR_VALIDATION_WORKBENCH_DEFAULT); //$NON-NLS-1$
- store.setDefault(PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.EDITOR_USE_INFERRED_GRAMMAR, ctId), true);
-
- // HTML Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, ctId), styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, ctId), styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.COMMENT_BORDER, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.COMMENT_TEXT, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.DECL_BORDER, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.DOCTYPE_NAME, ctId), styleValue);
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(128, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 95) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, ctId), styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.XML_CONTENT, ctId), styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.TAG_BORDER, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.TAG_NAME, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.PI_BORDER, ctId), styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.PI_CONTENT, ctId), styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.CDATA_BORDER, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsXML.CDATA_TEXT, ctId), styleValue);
-
- styleValue = ColorHelper.getColorString(191, 95, 63) + NOBACKGROUNDBOLD;
- store.setDefault(PreferenceKeyGenerator.generateKey(IStyleConstantsHTML.SCRIPT_AREA_BORDER, ctId), styleValue);
- }
-
- /**
- * Returns the template store for the html editor templates.
- *
- * @return the template store for the html editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore= new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), CommonEditorPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the html plugin.
- *
- * @return the template context type registry for the html plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- fContextTypeRegistry= new ContributionContextTypeRegistry();
-
- fContextTypeRegistry.addContextType(new TemplateContextTypeHTML());
- fContextTypeRegistry.addContextType(new TemplateContextTypeHTMLTag());
- fContextTypeRegistry.addContextType(new TemplateContextTypeHTMLAttribute());
- fContextTypeRegistry.addContextType(new TemplateContextTypeHTMLAttributeValue());
- }
-
- return fContextTypeRegistry;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java
deleted file mode 100644
index 8704f70e53..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java
+++ /dev/null
@@ -1,61 +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.html.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.html.ui.edit.ui.CleanupActionHTML;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesAction;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds;
-import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionProvider;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-import org.eclipse.wst.xml.ui.actions.AddBlockCommentActionXML;
-import org.eclipse.wst.xml.ui.actions.RemoveBlockCommentActionXML;
-import org.eclipse.wst.xml.ui.actions.ToggleCommentActionXML;
-
-
-public class StructuredTextEditorHTML extends StructuredTextEditor {
- protected void createActions() {
- super.createActions();
-
- ResourceBundle resourceBundle = ResourceHandler.getResourceBundle();
-
- Action action = new CleanupActionHTML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT + DOT, this);
- action.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT, action);
-
- action = new ToggleCommentActionXML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT + DOT, this);
- action.setActionDefinitionId(ActionDefinitionIds.TOGGLE_COMMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT, action);
-
- action = new AddBlockCommentActionXML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT + DOT, this);
- action.setActionDefinitionId(ActionDefinitionIds.ADD_BLOCK_COMMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT, action);
-
- action = new RemoveBlockCommentActionXML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT + DOT, this);
- action.setActionDefinitionId(ActionDefinitionIds.REMOVE_BLOCK_COMMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT, action);
-
- FindOccurrencesActionProvider foAction = new FindOccurrencesActionProvider(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES + DOT, this);
- foAction.addAction(new HTMLFindOccurrencesAction(resourceBundle, "", this)); //$NON-NLS-1$
- foAction.setActionDefinitionId(ActionDefinitionIds.FIND_OCCURRENCES);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES, foAction);
- markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES, true);
- }
- protected void initializeEditor() {
- super.initializeEditor();
- setHelpContextId(IHelpContextIds.HTML_SOURCEVIEW_HELPID);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
deleted file mode 100644
index 2ea1c88751..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.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.wst.html.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
-import org.eclipse.jdt.ui.text.JavaTextTools;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IAutoIndentStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.InformationPresenter;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS;
-import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.css.ui.style.LineStyleProviderForEmbeddedCSS;
-import org.eclipse.wst.html.core.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
-import org.eclipse.wst.html.ui.style.LineStyleProviderForHTML;
-import org.eclipse.wst.html.ui.taginfo.HTMLBestMatchHoverProcessor;
-import org.eclipse.wst.html.ui.taginfo.HTMLInformationProvider;
-import org.eclipse.wst.html.ui.taginfo.HTMLTagInfoHoverProcessor;
-import org.eclipse.wst.javascript.common.ui.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.javascript.common.ui.style.LineStyleProviderForJavaScript;
-import org.eclipse.wst.javascript.common.ui.taginfo.JavaScriptBestMatchHoverProcessor;
-import org.eclipse.wst.javascript.common.ui.taginfo.JavaScriptInformationProvider;
-import org.eclipse.wst.javascript.common.ui.taginfo.JavaScriptTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.StructuredTextReconciler;
-import org.eclipse.wst.sse.ui.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.style.IHighlighter;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.taginfo.AnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.taginfo.ProblemAnnotationHoverProcessor;
-import org.eclipse.wst.sse.ui.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.util.EditorUtility;
-import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.ui.doubleclick.XMLDoubleClickStrategy;
-import org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML;
-import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
-import org.eclipse.wst.xml.ui.reconcile.StructuredTextReconcilingStrategyForContentModel;
-import org.eclipse.wst.xml.ui.reconcile.StructuredTextReconcilingStrategyForMarkup;
-
-
-public class StructuredTextViewerConfigurationHTML extends StructuredTextViewerConfiguration {
- InformationPresenter fInformationPresenter = null;
-
- private boolean reconcilerStrategiesAreSet;
-
- private JavaSourceViewerConfiguration fJavaSourceViewerConfiguration;
-
- /*
- * (non-Javadoc)
- *
- * @see com.ibm.sse.editor.StructuredTextViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer)
- */
- public Map getAutoEditStrategies(ISourceViewer sourceViewer) {
- Map result = super.getAutoEditStrategies(sourceViewer);
-
- if (result.get(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML) == null)
- result.put(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, new ArrayList(1));
- if (result.get(StructuredTextPartitionerForHTML.ST_HTML_DECLARATION) == null)
- result.put(StructuredTextPartitionerForHTML.ST_HTML_DECLARATION, new ArrayList(1));
-
- IAutoEditStrategy autoEditStrategy = new StructuredAutoEditStrategyXML();
- List strategies = (List) result.get(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML);
- strategies.add(autoEditStrategy);
- strategies = (List) result.get(StructuredTextPartitionerForHTML.ST_HTML_DECLARATION);
- strategies.add(autoEditStrategy);
-
- return result;
- }
-
- public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) {
- if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_SCRIPT) == 0)
- // JavaScript
- return getJavaSourceViewerConfiguration().getAutoIndentStrategy(sourceViewer, StructuredTextPartitionerForHTML.ST_SCRIPT);
- else
- return super.getAutoIndentStrategy(sourceViewer, contentType);
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (configuredContentTypes == null) {
- String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
- String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes();
- configuredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length];
-
- configuredContentTypes[0] = StructuredTextPartitioner.ST_DEFAULT_PARTITION;
- configuredContentTypes[1] = StructuredTextPartitioner.ST_UNKNOWN_PARTITION;
-
- int index = 0;
- System.arraycopy(xmlTypes, 0, configuredContentTypes, index += 2, xmlTypes.length);
- System.arraycopy(htmlTypes, 0, configuredContentTypes, index += xmlTypes.length, htmlTypes.length);
- }
-
- return configuredContentTypes;
- }
-
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = super.getContentAssistant(sourceViewer);
-
- if (ca != null && ca instanceof ContentAssistant) {
- ContentAssistant contentAssistant = (ContentAssistant) ca;
-
- IContentAssistProcessor htmlContentAssistProcessor = new HTMLContentAssistProcessor();
- IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
- IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
- IContentAssistProcessor noRegionProcessorForHTML = new NoRegionContentAssistProcessorForHTML();
-
- // HTML
- addContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML);
- addContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, StructuredTextPartitionerForHTML.ST_HTML_COMMENT);
-
- // JavaScript
- addContentAssistProcessor(contentAssistant, jsContentAssistProcessor, StructuredTextPartitionerForHTML.ST_SCRIPT);
-
- // CSS
- addContentAssistProcessor(contentAssistant, cssContentAssistProcessor, StructuredTextPartitionerForCSS.ST_STYLE);
-
- // unknown
- addContentAssistProcessor(contentAssistant, noRegionProcessorForHTML, StructuredTextPartitioner.ST_UNKNOWN_PARTITION);
- }
-
- return ca;
- }
-
- public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = super.getCorrectionAssistant(sourceViewer);
-
- if (ca != null && ca instanceof ContentAssistant) {
- ContentAssistant correctionAssistant = (ContentAssistant) ca;
- ITextEditor editor = getTextEditor();
- if (editor != null) {
- IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(editor);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_CDATA);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_COMMENT);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_DECLARATION);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_PI);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_DTD_SUBSET);
- }
- }
-
- return ca;
- }
-
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), StructuredTextPartitionerForHTML.ST_DEFAULT_HTML);
-
- formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-
- return formatter;
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML) == 0)
- // HTML
- return new XMLDoubleClickStrategy();
- else if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_SCRIPT) == 0)
- // JavaScript
- return getJavaSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
- else
- return super.getDoubleClickStrategy(sourceViewer, contentType);
- }
-
- public IHighlighter getHighlighter(ISourceViewer sourceViewer) {
- IHighlighter highlighter = super.getHighlighter(sourceViewer);
-
- if (highlighter != null) {
- // HTML
- LineStyleProvider htmlLineStyleProvider = new LineStyleProviderForHTML();
- highlighter.addProvider(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, htmlLineStyleProvider);
- highlighter.addProvider(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, htmlLineStyleProvider);
- highlighter.addProvider(StructuredTextPartitionerForHTML.ST_HTML_DECLARATION, htmlLineStyleProvider);
-
- // JavaScript
- LineStyleProvider jsLineStyleProvider = new LineStyleProviderForJavaScript();
- highlighter.addProvider(StructuredTextPartitionerForHTML.ST_SCRIPT, jsLineStyleProvider);
-
- // CSS
- LineStyleProvider cssLineStyleProvider = new LineStyleProviderForEmbeddedCSS();
- highlighter.addProvider(StructuredTextPartitionerForCSS.ST_STYLE, cssLineStyleProvider);
- }
-
- return highlighter;
- }
-
- public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
- if (fInformationPresenter == null) {
- fInformationPresenter = new InformationPresenter(getInformationPresenterControlCreator(sourceViewer));
-
- // HTML
- IInformationProvider htmlInformationProvider = new HTMLInformationProvider();
- fInformationPresenter.setInformationProvider(htmlInformationProvider, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML);
-
- // JavaScript
- IInformationProvider javascriptInformationProvider = new JavaScriptInformationProvider();
- fInformationPresenter.setInformationProvider(javascriptInformationProvider, StructuredTextPartitionerForHTML.ST_SCRIPT);
-
- fInformationPresenter.setSizeConstraints(60, 10, true, true);
- }
-
- return fInformationPresenter;
- }
-
- private IModelManager getModelManager() {
-
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- return plugin.getModelManager();
- }
-
- /**
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconcilerg(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IReconciler getReconciler(ISourceViewer sourceViewer) {
- if (fReconciler != null) {
- // a reconciler should always be installed or disposed of
- if (!fReconciler.isInstalled()) {
- fReconciler = null;
- reconcilerStrategiesAreSet = false;
- }
- }
-
- // the first time running through, there's no model (so no pref store)
- // but the reconciler still needs to be created so that its document gets set
- if (fReconciler == null) {
- // create one
- fReconciler = new StructuredTextReconciler();
- // a null editorPart is valid
- //fReconciler.setEditor(editorPart);
- }
-
- IPreferenceStore store = ((AbstractUIPlugin) Platform.getPlugin(SSE_EDITOR_ID)).getPreferenceStore();
- boolean reconcilingEnabled = store.getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
-
- // the second time through, the strategies are set
- if (fReconciler != null && !reconcilerStrategiesAreSet && reconcilingEnabled) {
- StructuredTextViewer viewer = null;
- if (sourceViewer instanceof StructuredTextViewer) {
- viewer = ((StructuredTextViewer) sourceViewer);
- }
-
- IStructuredModel sModel = getModelManager().getExistingModelForRead(viewer.getDocument());
- try {
- if (sModel != null) {
- // check language (ContentTypeID)....
- String contentTypeId = sModel.getContentTypeIdentifier(); //sModel.getModelHandler().getAssociatedContentTypeId();
- String generatedKey = PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.EDITOR_VALIDATION_METHOD, contentTypeId);
- String validationMethodPref = EditorPlugin.getInstance().getPreferenceStore().getString(generatedKey);
-
- IReconcilingStrategy defaultStrategy = null;
-
- // pref set to no validation, so return
- if (validationMethodPref.equals(CommonEditorPreferenceNames.EDITOR_VALIDATION_NONE) || validationMethodPref.trim().length() == 0)
- return fReconciler;
-
- // "Content Model" strategies (requires propagating adapter from AdapterFactoryProviderFor*)
- else if (validationMethodPref.equals(CommonEditorPreferenceNames.EDITOR_VALIDATION_CONTENT_MODEL)) {
- defaultStrategy = new StructuredTextReconcilingStrategyForContentModel((ITextEditor) editorPart);
- }
-
- // "workbench default" strategies
- else if (validationMethodPref.equals(CommonEditorPreferenceNames.EDITOR_VALIDATION_WORKBENCH_DEFAULT)) {
-
- IReconcilingStrategy markupStrategy = new StructuredTextReconcilingStrategyForMarkup((ITextEditor) editorPart);
- IReconcilingStrategy xmlStrategy = new StructuredTextReconcilingStrategyForContentModel((ITextEditor) editorPart);
-
- fReconciler.setReconcilingStrategy(markupStrategy, StructuredTextPartitioner.ST_DEFAULT_PARTITION);
-
- fReconciler.setReconcilingStrategy(xmlStrategy, StructuredTextPartitionerForXML.ST_DEFAULT_XML);
-
- //----------------------------------------------------------------------------------
- // valdator extension point
- //----------------------------------------------------------------------------------
- fReconciler.setValidatorStrategy(createValidatorStrategy(contentTypeId));
- //----------------------------------------------------------------------------------
- defaultStrategy = markupStrategy;
- }
- fReconciler.setDefaultStrategy(defaultStrategy);
- reconcilerStrategiesAreSet = true;
- }
- }
- finally {
- if(sModel != null)
- sModel.releaseFromRead();
- }
- }
- return fReconciler;
- }
-
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- // HTML
- if (contentType.equals(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML)) {
- TextHoverManager.TextHoverDescriptor[] hoverDescs= EditorPlugin.getDefault().getTextHoverManager().getTextHovers();
- int i= 0;
- while (i < hoverDescs.length) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
- return new HTMLBestMatchHoverProcessor();
- else if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
- return new ProblemAnnotationHoverProcessor();
- else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
- return new AnnotationHoverProcessor();
- else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType))
- return new HTMLTagInfoHoverProcessor();
- }
- i++;
- }
- }
- // JavaScript
- else if (contentType.equals(StructuredTextPartitionerForHTML.ST_SCRIPT)) {
- TextHoverManager.TextHoverDescriptor[] hoverDescs= EditorPlugin.getDefault().getTextHoverManager().getTextHovers();
- int i= 0;
- while (i < hoverDescs.length) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType))
- return new JavaScriptBestMatchHoverProcessor();
- else if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType))
- return new ProblemAnnotationHoverProcessor();
- else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType))
- return new AnnotationHoverProcessor();
- else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType))
- return new JavaScriptTagInfoHoverProcessor();
- }
- i++;
- }
- }
- return super.getTextHover(sourceViewer, contentType, stateMask);
- }
-
- public void unConfigure(ISourceViewer viewer) {
- super.unConfigure(viewer);
-
- // InformationPresenters
- if (fInformationPresenter != null)
- fInformationPresenter.uninstall();
- }
-
- private JavaSourceViewerConfiguration getJavaSourceViewerConfiguration() {
- if (fJavaSourceViewerConfiguration == null) {
- IPreferenceStore store = PreferenceConstants.getPreferenceStore();
- JavaTextTools javaTextTools = new JavaTextTools(store);
- fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(javaTextTools, getTextEditor());
- }
- return fJavaSourceViewerConfiguration;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntry.java
deleted file mode 100644
index b27b15a244..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntry.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.wst.html.ui.contentproperties.ui;
-
-public class AbstractDeviceProfileEntry implements DeviceProfileEntry {
-
- public AbstractDeviceProfileEntry() {
- super();
- }
-
- public String getEntryId() {
- return null;
- }
-
- public String getEntryName() {
- return null;
- }
-
- public void release() {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
deleted file mode 100644
index 5a21e4fb43..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/AbstractDeviceProfileEntryProvider.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.html.ui.contentproperties.ui;
-
-import java.util.Iterator;
-
-public class AbstractDeviceProfileEntryProvider implements
- DeviceProfileEntryProvider {
-
- public AbstractDeviceProfileEntryProvider() {
- super();
- }
-
- public Iterator getDeviceProfileEntries() {
- return null;
- }
-
- public void release() {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ContentSettingsRegistry.java
deleted file mode 100644
index 4e75cdb47f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,174 +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.html.ui.contentproperties.ui;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.common.encoding.CommonCharsetNames;
-import org.eclipse.wst.css.core.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboList;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-
-public final class ContentSettingsRegistry {
-
- private static final String NONE = ResourceHandler.getString("UI_none"); //$NON-NLS-1$
-
- public static String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
- public static String maxLengthStringInCharacterCodeRegistry = ""; //$NON-NLS-1$
-
- private ContentSettingsRegistry() {
- }
-
- public static void setHTMLDocumentTypeRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- String publicId = entry.getPublicId();
- String displayName = entry.getDisplayName();
- if (displayName != null) {
- combo.add(displayName, publicId);
- if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = displayName;
- }
- else
- combo.add(publicId, publicId);
- if (publicId.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = publicId;
- if (entry.getSystemId() == null)
- continue; // if HTML entry
- if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
- }
-
- combo.sortByKey(1);
- }
-
- public static void setCSSMetaModelRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- combo.add(name, id);
- }
- combo.sortByKey(1);
- }
-
- public static void setDeviceProfileRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- DeviceProfileEntryProvider reg = DeviceProfileEntryProviderBuilder.getEntryProvider();
- if (reg == null) {
- return;
- }
- Iterator profiles = reg.getDeviceProfileEntries();
- if (profiles == null) {
- reg.release();
- return;
- }
- DeviceProfileEntry entry;
- while (profiles.hasNext()) {
- entry = (DeviceProfileEntry) profiles.next();
- combo.add(entry.getEntryName(), entry.getEntryId());
- entry.release();
- }
- reg.release();
- combo.sortByKey(1);
- }
-
- public static String getSystemIdFrom(String publicId) {
- if (publicId == null || publicId.length() == 0)
- return null;
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- if (entry.getPublicId().equals(publicId))
- return entry.getSystemId();
- }
- return null;
- }
-
- public static void setContentTypeInto(ComboList combo) {
- String[] type = {"", //$NON-NLS-1$
- "application/xhtml+xml", //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml",}; //$NON-NLS-1$
- String[] displayName = {NONE, "application/xhtml+xml", //$NON-NLS-1$
- //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml",}; //$NON-NLS-1$
- for (int i = 0; i < type.length; i++) {
- if (displayName[i] != null && displayName[i].length() != 0)
- combo.add(displayName[i], type[i]);
- else
- combo.add(type[i], type[i]);
- }
-
- }
-
- public static void setCharacterCodeInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- String max = ""; //$NON-NLS-1$
- //CommonCharsetNames encoding = new CommonCharsetNames();
- String[] charCode = CommonCharsetNames.getCommonCharsetNames();
- for (int i = 0; i < charCode.length; i++) {
- String displayName = CommonCharsetNames.getDisplayString(charCode[i]);
- if (displayName != null && displayName.length() != 0) {
- combo.add(displayName, charCode[i]);
- int n_byte = displayName.getBytes().length;
- if (max.getBytes().length < n_byte)
- max = displayName;
- }
- else
- combo.add(charCode[i], charCode[i]);
- }
- /*
- charCode = encoding.getSupportedJavaEncodings();
- for(int i=0;i<charCode.length;i++){
- String displayName = encoding.getDisplayString(charCode[i]);
- if (displayName!=null && displayName.length()!=0)
- combo.add(displayName,charCode[i]);
- else
- combo.add(charCode[i],charCode[i]);
- }
- */
- // combo.sortByKey(1);
- maxLengthStringInCharacterCodeRegistry = max;
- }
-
- public static void setLanguageInto(ComboList combo) {
- String[] lang = {"", //$NON-NLS-1$
- "java", //$NON-NLS-1$
- "javascript",}; //$NON-NLS-1$
- String[] displayName = {NONE, "java", //$NON-NLS-1$
- //$NON-NLS-1$
- "javascript",}; //$NON-NLS-1$
- for (int i = 0; i < lang.length; i++) {
- if (displayName[i] != null && displayName[i].length() != 0)
- combo.add(displayName[i], lang[i]);
- else
- combo.add(lang[i], lang[i]);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntry.java
deleted file mode 100644
index 489e2571a3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntry.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.html.ui.contentproperties.ui;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients
- * directly. Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
- * </p>
- */
-public interface DeviceProfileEntry {
- public String getEntryId();
- public String getEntryName();
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProvider.java
deleted file mode 100644
index 51915862df..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProvider.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.html.ui.contentproperties.ui;
-
-import java.util.Iterator;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients
- * directly. Instead, please use abstract class(AbstractDeviceProfileEntryProvider) instead.
- * </p>
- */
-public interface DeviceProfileEntryProvider {
- public Iterator getDeviceProfileEntries();
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProviderBuilder.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
deleted file mode 100644
index 79fb3f6498..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/DeviceProfileEntryProviderBuilder.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.html.ui.contentproperties.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-
-public class DeviceProfileEntryProviderBuilder {
- private static final String EXTENSION_POINT_PLUGINID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
- private static final String EXTENSION_POINT_NAME = "deviceProfileEntryProvider"; //$NON-NLS-1$
- private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
-
- public DeviceProfileEntryProviderBuilder() {
- super();
- }
- static public DeviceProfileEntryProvider getEntryProvider() {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_PLUGINID, EXTENSION_POINT_NAME);
- if (point != null) {
- IExtension extensions[] = point.getExtensions();
- if ((extensions != null) && (extensions.length > 0)) {
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement elements[] = extensions[i].getConfigurationElements();
- if ((elements != null) && (elements.length > 0)) {
- for (int j = 0; j < elements.length; j++) {
- IConfigurationElement config = elements[j];
- if ((config != null) && (config.getName().equals(EXTENSION_POINT_NAME) == true)) {
- String className = config.getAttribute(ATTR_CLASS);
- if (className != null) {
- try {
- DeviceProfileEntryProvider provider = (DeviceProfileEntryProvider)config.createExecutableExtension(ATTR_CLASS);
- if (provider != null) {
- return provider;
- }
- } catch (CoreException ignored) {
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/HTMLContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/HTMLContentSettingsPropertyPage.java
deleted file mode 100644
index 0cc12bdcdb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/HTMLContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,279 +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.html.ui.contentproperties.ui;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ContentSettingsPropertyPage;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-
-public final class HTMLContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
-
-
- private final int N_DOCUMENT_TYPE = 0;
- private final int N_CSS_PROFILE = 1;
- private final int N_TARGET_DEVICE = 2;
-
- private Text publicIdText;
- private Text systemIdText;
-
- public HTMLContentSettingsPropertyPage() {
- super();
- numberOfCombo = 3;
- numCols = 2;
- numRows = 8;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
-
-
- protected void createDocumentTypeComboBox() {
-
- // create description of implecit DOCTYPE
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(ResourceHandler.getString("UI_Description_of_role_of_following_DOCTYPE"));//$NON-NLS-1$
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- label.setLayoutData(data);
-
- // create combobox
- super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
- super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
- // set entry list into Combo
- ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
- // create TextField
- createIDTextField();
- if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
- return;
-
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
- this.publicIdText.setText(initValue);
- if (!initValue.equals("")) {//$NON-NLS-1$
- // toro D210260
- if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else
- this.systemIdText.setText("");//$NON-NLS-1$
-
- // create separator
- label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
-
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
-
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createDeviceComboBox() {
- super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
-
- ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
- if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
- }
-
-
- protected void createSettingsPageGUI() {
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.FILE :
- // composite = createComposite(propertyPage,numCols,numRows);
- createDocumentTypeComboBox();
- createCSSComboBox();
- createDeviceComboBox();
- computeMaxWidthHint();
- WorkbenchHelp.setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "HTMLContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
- break;
- }
-
- }
-
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
- break;
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- case N_TARGET_DEVICE :
- // device
- properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- break;
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
- case N_TARGET_DEVICE :
- // device
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
- private void createIDTextField() {
- // public ID & System ID
- Label publicLabel = new Label(super.propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- publicLabel.setLayoutData(data);
- publicLabel.setText(ResourceHandler.getString("UI_Public_ID"));//$NON-NLS-1$
- publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- publicIdText.setLayoutData(data);
-
- Label systemLabel = new Label(super.propertyPage, SWT.NONE);
- data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- systemLabel.setLayoutData(data);
- systemLabel.setText(ResourceHandler.getString("UI_System_ID"));//$NON-NLS-1$
- systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- systemIdText.setLayoutData(data);
- }
-
-
-
- private void computeMaxWidthHint() {
- // maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
- String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = this.systemIdText.getText();
- this.systemIdText.setText(maxLengthString);
- int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- this.systemIdText.setText(backup);
-
- if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
- ((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
- if (this.publicIdText.getLayoutData() != null)
- ((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.systemIdText.getLayoutData() != null)
- ((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
- ((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
- ((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
-
- }
-
-
- public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
- }
-
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
- Widget source = event.widget;
-
- if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
- ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
- if (combo.getSelectionIndex() < 0)
- return;
- if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
- this.publicIdText.setText(combo.getSelectedValue());
- if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else {
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
- }
-
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
-
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ProjectContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ProjectContentSettingsPropertyPage.java
deleted file mode 100644
index e5203dbfd1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/contentproperties/ui/ProjectContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,282 +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.html.ui.contentproperties.ui;
-
-
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.sse.ui.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ContentSettingsPropertyPage;
-
-
-public final class ProjectContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
-
-
- private final int N_DOCUMENT_TYPE = 0;
- private final int N_CSS_PROFILE = 1;
- private final int N_TARGET_DEVICE = 2;
-
- private Text publicIdText;
- private Text systemIdText;
-
- public ProjectContentSettingsPropertyPage() {
- super();
- numberOfCombo = 3;
- numCols = 2;
- numRows = 8;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
-
-
- protected void createDocumentTypeComboBox() {
-
- // create description of implecit DOCTYPE
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(ResourceHandler.getString("UI_Description_of_role_of_following_DOCTYPE"));//$NON-NLS-1$
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- label.setLayoutData(data);
-
- // create combobox
- super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
- super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
- // set entry list into Combo
- ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
- // create TextField
- createIDTextField();
- if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
- return;
-
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
- this.publicIdText.setText(initValue);
- if (!initValue.equals("")) {//$NON-NLS-1$
- // toro D210260
- if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else
- this.systemIdText.setText("");//$NON-NLS-1$
-
- // create separator
- label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
-
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
-
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createDeviceComboBox() {
- super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
-
- ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
- if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
- }
-
-
- protected void createSettingsPageGUI() {
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.PROJECT :
- // composite = createComposite(propertyPage,numCols,numRows);
- createDocumentTypeComboBox();
- createCSSComboBox();
- createDeviceComboBox();
- computeMaxWidthHint();
- WorkbenchHelp.setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "ProjectContentSettingsPropertyPage is instantiated by resource except PROJECT");//$NON-NLS-1$
- break;
- }
-
- }
-
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
- break;
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- case N_TARGET_DEVICE :
- // device
- properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- break;
-
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
-
- case N_TARGET_DEVICE :
- // device
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- break;
-
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
- private void createIDTextField() {
- // public ID & System ID
- Label publicLabel = new Label(super.propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- publicLabel.setLayoutData(data);
- publicLabel.setText(ResourceHandler.getString("UI_Public_ID"));//$NON-NLS-1$
- publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- publicIdText.setLayoutData(data);
-
- Label systemLabel = new Label(super.propertyPage, SWT.NONE);
- data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- systemLabel.setLayoutData(data);
- systemLabel.setText(ResourceHandler.getString("UI_System_ID"));//$NON-NLS-1$
- systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- systemIdText.setLayoutData(data);
- }
-
-
-
- private void computeMaxWidthHint() {
- // maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
- String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = this.systemIdText.getText();
- this.systemIdText.setText(maxLengthString);
- int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- this.systemIdText.setText(backup);
-
- if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
- ((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
- if (this.publicIdText.getLayoutData() != null)
- ((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.systemIdText.getLayoutData() != null)
- ((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
- ((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
- ((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
-
- }
-
-
- public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
- }
-
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
- Widget source = event.widget;
-
- if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
- ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
- if (combo.getSelectionIndex() < 0)
- return;
- if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
- this.publicIdText.setText(combo.getSelectedValue());
- if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else {
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
- }
-
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
-
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/ActionContributorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/ActionContributorHTML.java
deleted file mode 100644
index 13cdf1e763..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/ActionContributorHTML.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.html.ui.edit.ui;
-
-import org.eclipse.wst.xml.ui.actions.ActionContributorXML;
-
-/**
- *
- * Instead, use SourcePageActionContributor for source page contributor
- * of multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorHTML extends ActionContributorXML {
- private static final String[] EDITOR_IDS = {"org.eclipse.wst.html.ui.StructuredTextEditorHTML", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.ui.actions.ActionContributor#getExtensionIDs()
- */
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java
deleted file mode 100644
index 615d9283b2..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.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.html.ui.edit.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.core.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.sse.core.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.ui.edit.util.CleanupAction;
-
-public class CleanupActionHTML extends CleanupAction {
- protected IStructuredCleanupProcessor fCleanupProcessor;
-
- public CleanupActionHTML(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- protected Dialog getCleanupDialog(Shell shell) {
- if (fCleanupDialog == null)
- fCleanupDialog = new CleanupDialogHTML(shell);
-
- return fCleanupDialog;
- }
-
- protected IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new HTMLCleanupProcessorImpl();
-
- return fCleanupProcessor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupDialogHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupDialogHTML.java
deleted file mode 100644
index 1f1d042748..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupDialogHTML.java
+++ /dev/null
@@ -1,311 +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.html.ui.edit.ui;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.html.core.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-import org.eclipse.wst.xml.core.cleanup.XMLCleanupPreferencesImpl;
-
-public class CleanupDialogHTML extends Dialog implements SelectionListener {
-
- protected Button fRadioButtonTagNameCaseAsis;
- protected Button fRadioButtonTagNameCaseLower;
- protected Button fRadioButtonTagNameCaseUpper;
- protected Button fRadioButtonAttrNameCaseAsis;
- protected Button fRadioButtonAttrNameCaseLower;
- protected Button fRadioButtonAttrNameCaseUpper;
- protected Button fCheckBoxInsertRequiredAttrs;
- protected Button fCheckBoxInsertMissingTags;
- protected Button fCheckBoxQuoteAttrValues;
- protected Button fCheckBoxFormatSource;
- protected Button fCheckBoxConvertEOLCodes;
- protected Button fRadioButtonConvertEOLWindows;
- protected Button fRadioButtonConvertEOLUnix;
- protected Button fRadioButtonConvertEOLMac;
- protected IStructuredModel fModel = null;
- protected Preferences fPreferences = null;
-
- public CleanupDialogHTML(Shell shell) {
- super(shell);
- }
-
- public Control createDialogArea(Composite parent) {
- getShell().setText(ResourceHandler.getString("Cleanup_UI_")); //$NON-NLS-1$ = "Cleanup"
- Composite composite = new Composite(parent, SWT.NULL);
-
- createDialogAreaInComposite(composite);
- initializeOptions();
-
- return composite;
- }
-
- protected void createDialogAreaInCompositeForHTML(Composite composite) {
- // Convert tag name case
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group tagNameCase = new Group(composite, SWT.NONE);
- tagNameCase.setText(ResourceHandler.getString("Tag_name_case_for_HTML_UI_")); //$NON-NLS-1$ = "Tag name case for HTML:"
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- tagNameCase.setLayout(hLayout);
- fRadioButtonTagNameCaseAsis = new Button(tagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseAsis.setText(ResourceHandler.getString("Tag_name_case_As-is_UI_")); //$NON-NLS-1$ = "&As-is"
- fRadioButtonTagNameCaseAsis.addSelectionListener(this);
- fRadioButtonTagNameCaseLower = new Button(tagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseLower.setText(ResourceHandler.getString("Tag_name_case_Lower_UI_")); //$NON-NLS-1$ = "&Lower"
- fRadioButtonTagNameCaseLower.addSelectionListener(this);
- fRadioButtonTagNameCaseUpper = new Button(tagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseUpper.setText(ResourceHandler.getString("Tag_name_case_Upper_UI_")); //$NON-NLS-1$ = "&Upper"
- fRadioButtonTagNameCaseUpper.addSelectionListener(this);
-
- // Convert attr name case
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group attrNameCase = new Group(composite, SWT.NONE);
- attrNameCase.setText(ResourceHandler.getString("Attribute_name_case_for_HTML_UI_")); //$NON-NLS-1$ = "Attribute name case for HTML:"
- attrNameCase.setLayout(hLayout);
- fRadioButtonAttrNameCaseAsis = new Button(attrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseAsis.setText(ResourceHandler.getString("Attribute_name_case_As-is_UI_")); //$NON-NLS-1$ = "A&s-is"
- fRadioButtonAttrNameCaseAsis.addSelectionListener(this);
- fRadioButtonAttrNameCaseLower = new Button(attrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseLower.setText(ResourceHandler.getString("Attribute_name_case_Lower_UI_")); //$NON-NLS-1$ = "L&ower"
- fRadioButtonAttrNameCaseLower.addSelectionListener(this);
- fRadioButtonAttrNameCaseUpper = new Button(attrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseUpper.setText(ResourceHandler.getString("Attribute_name_case_Upper_UI_")); //$NON-NLS-1$ = "U&pper"
- fRadioButtonAttrNameCaseUpper.addSelectionListener(this);
- }
-
- protected void createDialogAreaInComposite(Composite composite) {
- if (isHTMLType()) {
- createDialogAreaInCompositeForHTML(composite);
- WorkbenchHelp.setHelp(composite, IHelpContextIds.CLEANUP_HTML_HELPID); // use HTML specific help
- }
- else
- WorkbenchHelp.setHelp(composite, org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds.CLEANUP_XML_HELPID); // use XML specific help
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- composite.setLayout(layout);
-
- // Insert missing required attrs
- fCheckBoxInsertRequiredAttrs = new Button(composite, SWT.CHECK);
- fCheckBoxInsertRequiredAttrs.setText(ResourceHandler.getString("Insert_required_attributes_UI_")); //$NON-NLS-1$
- fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
-
- // Insert missing begin/end tags
- fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
- fCheckBoxInsertMissingTags.setText(ResourceHandler.getString("Insert_missing_tags_UI_")); //$NON-NLS-1$ = "Insert missing tags"
- fCheckBoxInsertMissingTags.addSelectionListener(this);
-
- // Quote attribute values
- fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
- fCheckBoxQuoteAttrValues.setText(ResourceHandler.getString("Quote_attribute_values_UI_")); //$NON-NLS-1$ = "Quote attribute values"
- fCheckBoxQuoteAttrValues.addSelectionListener(this);
-
- // Format source
- fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
- fCheckBoxFormatSource.setText(ResourceHandler.getString("Format_source_UI_")); //$NON-NLS-1$ = "Format source"
- fCheckBoxFormatSource.addSelectionListener(this);
-
- // Convert EOL code
- fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
- fCheckBoxConvertEOLCodes.setText(ResourceHandler.getString("Convert_EOL_codes_UI_")); //$NON-NLS-1$ = "Convert end-of-line codes"
- fCheckBoxConvertEOLCodes.addSelectionListener(this);
- Composite EOLCodes = new Composite(composite, SWT.NULL);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- EOLCodes.setLayout(hLayout);
- fRadioButtonConvertEOLWindows = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLWindows.setText(ResourceHandler.getString("EOL_Windows_UI")); //$NON-NLS-1$ = "Windows"
- fRadioButtonConvertEOLWindows.addSelectionListener(this);
- fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLUnix.setText(ResourceHandler.getString("EOL_Unix_UI")); //$NON-NLS-1$ = "Unix"
- fRadioButtonConvertEOLUnix.addSelectionListener(this);
- fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLMac.setText(ResourceHandler.getString("EOL_Mac_UI")); //$NON-NLS-1$ = "Mac"
- fRadioButtonConvertEOLMac.addSelectionListener(this);
- }
-
- protected void okPressed() {
- storeOptions();
-
- super.okPressed();
- }
-
- protected void initializeOptionsForHTML() {
- int tagNameCase = getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE);
- if (tagNameCase == CommonModelPreferenceNames.UPPER)
- fRadioButtonTagNameCaseUpper.setSelection(true);
- else if (tagNameCase == CommonModelPreferenceNames.LOWER)
- fRadioButtonTagNameCaseLower.setSelection(true);
- else
- fRadioButtonTagNameCaseAsis.setSelection(true);
-
- int attrNameCase = getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE);
- if (attrNameCase == CommonModelPreferenceNames.UPPER)
- fRadioButtonAttrNameCaseUpper.setSelection(true);
- else if (attrNameCase == CommonModelPreferenceNames.LOWER)
- fRadioButtonAttrNameCaseLower.setSelection(true);
- else
- fRadioButtonAttrNameCaseAsis.setSelection(true);
- }
-
- protected void initializeOptions() {
- if (isHTMLType())
- initializeOptionsForHTML();
-
- fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.INSERT_REQUIRED_ATTRS));
- fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.INSERT_MISSING_TAGS));
- fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.QUOTE_ATTR_VALUES));
- fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.FORMAT_SOURCE));
- fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.CONVERT_EOL_CODES));
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- String EOLCode = getModelPreferences().getString(CommonModelPreferenceNames.CLEANUP_EOL_CODE);
- if (EOLCode == CommonEncodingPreferenceNames.LF)
- fRadioButtonConvertEOLUnix.setSelection(true);
- else if (EOLCode == CommonEncodingPreferenceNames.CR)
- fRadioButtonConvertEOLMac.setSelection(true);
- else
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
-
- protected void storeOptionsForHTML() {
- if (fRadioButtonTagNameCaseUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else if (fRadioButtonTagNameCaseLower.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.LOWER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.ASIS);
-
- if (fRadioButtonAttrNameCaseUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else if (fRadioButtonAttrNameCaseLower.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.LOWER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.ASIS);
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- protected void storeOptions() {
- if (isHTMLType()) {
- storeOptionsForHTML();
- XMLCleanupPreferencesImpl.getInstance().setTagNameCase(getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE));
- XMLCleanupPreferencesImpl.getInstance().setAttrNameCase(getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE));
- }
- else {
- XMLCleanupPreferencesImpl.getInstance().setTagNameCase(CommonModelPreferenceNames.ASIS);
- XMLCleanupPreferencesImpl.getInstance().setAttrNameCase(CommonModelPreferenceNames.ASIS);
- }
-
- getModelPreferences().setValue(CommonModelPreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setInsertMissingTags(fCheckBoxInsertMissingTags.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setQuoteAttrValues(fCheckBoxQuoteAttrValues.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setFormatSource(fCheckBoxFormatSource.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setConvertEOLCodes(fCheckBoxConvertEOLCodes.getSelection());
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- if (fRadioButtonConvertEOLUnix.getSelection()) {
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
- XMLCleanupPreferencesImpl.getInstance().setEOLCode(CommonEncodingPreferenceNames.LF);
- }
- else if (fRadioButtonConvertEOLMac.getSelection()) {
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
- XMLCleanupPreferencesImpl.getInstance().setEOLCode(CommonEncodingPreferenceNames.CR);
- }
- else {
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF);
- XMLCleanupPreferencesImpl.getInstance().setEOLCode(CommonEncodingPreferenceNames.CRLF);
- }
- }
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- getButton(OK).setEnabled((fRadioButtonTagNameCaseLower != null && (fRadioButtonTagNameCaseLower.getSelection() || fRadioButtonTagNameCaseUpper.getSelection())) || (fRadioButtonAttrNameCaseLower != null && (fRadioButtonAttrNameCaseLower.getSelection() || fRadioButtonAttrNameCaseUpper.getSelection())) || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || fCheckBoxConvertEOLCodes.getSelection() || (fRadioButtonConvertEOLUnix != null && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection())));
- if (e.widget == fCheckBoxConvertEOLCodes)
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
-
- public void setModel(IStructuredModel model) {
- fModel = model;
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected boolean isXMLType() {
- boolean result = false;
-
- if (fModel != null) {
- IModelHandler modelHandler = fModel.getModelHandler();
- if (modelHandler.getAssociatedContentTypeId().equals(IContentTypeIdentifier.ContentTypeID_SSEXML))
- result = true;
- }
-
- return result;
- }
-
- protected boolean isHTMLType() {
- boolean result = true;
-
- if (fModel != null) {
- IModelHandler modelHandler = fModel.getModelHandler();
- if (modelHandler.getAssociatedContentTypeId().equals(IContentTypeIdentifier.ContentTypeID_HTML))
- result = true;
- }
-
- return result;
- }
-
- protected void enableEOLCodeRadios(boolean enable) {
- if ((fRadioButtonConvertEOLWindows != null) && (fRadioButtonConvertEOLUnix != null) && (fRadioButtonConvertEOLMac != null)) {
- fRadioButtonConvertEOLWindows.setEnabled(enable);
- fRadioButtonConvertEOLUnix.setEnabled(enable);
- fRadioButtonConvertEOLMac.setEnabled(enable);
-
- if (!fRadioButtonConvertEOLWindows.getSelection() && !fRadioButtonConvertEOLUnix.getSelection() && !fRadioButtonConvertEOLMac.getSelection())
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
deleted file mode 100644
index 65f2d6da70..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
+++ /dev/null
@@ -1,157 +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.html.ui.internal;
-
-
-
-import java.util.StringTokenizer;
-
-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.wst.html.ui.HTMLEditorPlugin;
-
-
-/**
- * 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 {
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- private static final Plugin fPlugin = HTMLEditorPlugin.getDefault();
- private static final String fPluginId = fPlugin.getDescriptor().getUniqueIdentifier();
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * 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, fPluginId, severity, message, exception);
- fPlugin.getLog().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, fPluginId, IStatus.OK, message, exception);
- fPlugin.getLog().log(statusObj);
- }
- }
-
- /**
- * @return true if the plugin for this logger is debugging
- */
- public static boolean isDebugging() {
- return fPlugin.isDebugging();
- }
-
- /**
- * 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(fPluginId + 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 trace(String category, String message) {
- _trace(category, message, null);
- }
-
- 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);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java
deleted file mode 100644
index 68dc842246..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.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.html.ui.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-
-
-public class SharedHTMLEditorPluginImageHelper {
- public static final String IMG_OBJ_TABLE = HTMLEditorPluginImages.IMG_OBJ_TABLE;
- public static final String IMG_OBJ_TAG_ANCHOR = HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR;
- public static final String IMG_OBJ_TAG_BODY = HTMLEditorPluginImages.IMG_OBJ_TAG_BODY;
- public static final String IMG_OBJ_TAG_BUTTON = HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON;
- public static final String IMG_OBJ_TAG_FONT = HTMLEditorPluginImages.IMG_OBJ_TAG_FONT;
- public static final String IMG_OBJ_TAG_FORM = HTMLEditorPluginImages.IMG_OBJ_TAG_FORM;
- public static final String IMG_OBJ_TAG_HTML = HTMLEditorPluginImages.IMG_OBJ_TAG_HTML;
- public static final String IMG_OBJ_TAG_IMAGE_MAP = HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP;
- public static final String IMG_OBJ_TAG_IMAGE = HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE;
- public static final String IMG_OBJ_TAG_JSP = HTMLEditorPluginImages.IMG_OBJ_TAG_JSP;
- public static final String IMG_OBJ_TAG_TITLE = HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE;
- public static final String IMG_OBJ_TAG = HTMLEditorPluginImages.IMG_OBJ_TAG;
-
- /**
- * Retrieves the specified image from the html source editor plugin's image registry.
- * Note: The returned <code>Image</code> is managed by the workbench; clients
- * must <b>not</b> dispose of the returned image.
- *
- * @param symbolicName the symbolic name of the image; there are constants
- * declared in this class for build-in images that come with the html source editor
- * @return the image, or <code>null</code> if not found
- */
- public static Image getImage(String symbolicName) {
- return HTMLEditorPluginImageHelper.getInstance().getImage(symbolicName);
- }
-
- /**
- * Retrieves the image descriptor for specified image from the html source editor plugin's
- * image registry. Unlike <code>Image</code>s, image descriptors themselves do
- * not need to be disposed.
- *
- * @param symbolicName the symbolic name of the image; there are constants
- * declared in this interface for build-in images that come with the html source editor
- * @return the image descriptor, or <code>null</code> if not found
- */
- public static ImageDescriptor getImageDescriptor(String symbolicName) {
- return HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(symbolicName);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
deleted file mode 100644
index 6bd1f74e78..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ /dev/null
@@ -1,428 +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.html.ui.internal.contentassist;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.common.contentmodel.CMDocument;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.HTML40Namespace;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.javascript.common.ui.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-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.modelquery.ModelQueryAdapter;
-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.ui.EditorPlugin;
-import org.eclipse.wst.sse.ui.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.edit.util.SharedEditorPluginImageHelper;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.sse.ui.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.xml.core.document.XMLDocument;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.core.document.XMLNode;
-import org.eclipse.wst.xml.core.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-import org.eclipse.wst.xml.ui.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.contentassist.AbstractTemplateCompletionProcessor;
-import org.eclipse.wst.xml.ui.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.contentassist.XMLContentModelGenerator;
-import org.eclipse.wst.xml.ui.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
- private AdapterFactory factoryForCSS = null;
- protected IPreferenceStore fPreferenceStore = null;
- protected AbstractTemplateCompletionProcessor fTemplateProcessor = null;
- protected boolean isXHTML = false;
- protected IResource fResource = null;
-
- public HTMLContentAssistProcessor() {
-
- super();
- }
-
- /**
- * @see AbstractContentAssistProcessor#addXMLProposal(ContentAssistRequest)
- */
- protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- super.addXMLProposal(contentAssistRequest);
- }
-
- /**
- * Add the proposals for a completely empty document
- */
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- // addMacros(contentAssistRequest, MacroHelper.TAG);
- }
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- super.addPCDATAProposal(nodeName, contentAssistRequest);
- }
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- addEmptyDocumentProposals(contentAssistRequest);
- }
-
- protected boolean beginsWith(String aString, String prefix) {
- if (aString == null || prefix == null || prefix.length() == 0)
- return true;
- int minimumLength = Math.min(prefix.length(), aString.length());
- String beginning = aString.substring(0, minimumLength);
- return beginning.equalsIgnoreCase(prefix);
- }
-
- /**
- * Return a list of proposed code completions based on the
- * specified location within the document that corresponds
- * to the current cursor position within the text-editor control.
- *
- * @param documentPosition a location within the document
- * @return an array of code-assist items
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) textViewer, documentPosition);
- XMLNode node = (XMLNode) treeNode;
- setErrorMessage(null);
-
- // check if it's in a comment node
- IStructuredDocument structuredDocument = (IStructuredDocument) textViewer.getDocument();
- IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
- if (fn != null && fn.getType() == XMLRegionContext.XML_COMMENT_TEXT && documentPosition != fn.getStartOffset()) {
- return new ICompletionProposal[0];
- }
-
- // CMVC 242695
- // if it's a </script> tag, bounce back to JS ca processor...
- if (fn != null && fn.getType() == XMLRegionContext.XML_TAG_NAME && documentPosition == fn.getStartOffset()) {
- ITextRegionList v = fn.getRegions();
- if (v.size() > 1) {
- // determine that it's a close tag
- if ((v.get(0)).getType() == XMLRegionContext.XML_END_TAG_OPEN) {
- Iterator it = v.iterator();
- ITextRegion region = null;
- // search for script tag name
- while (it.hasNext()) {
- region = (ITextRegion) it.next();
- if (fn.getText(region).equalsIgnoreCase("script")) { //$NON-NLS-1$
- // return JS content assist...
- JavaScriptContentAssistProcessor jsProcessor = new JavaScriptContentAssistProcessor();
- return jsProcessor.computeCompletionProposals(textViewer, documentPosition);
- }
- }
- }
- }
- }
-
- isXHTML = getXHTML(node);
-
- fGenerator = null; // force reload of content generator
-
- // handle blank HTML document case
- if (treeNode == null || isViewerEmpty(textViewer)) {
- // cursor is at the EOF
- ICompletionProposal htmlTagProposal = getHTMLTagPropsosal((StructuredTextViewer) textViewer, documentPosition);
- ICompletionProposal[] superResults = super.computeCompletionProposals(textViewer, documentPosition);
- if (superResults != null && superResults.length > 0 && htmlTagProposal != null) {
- ICompletionProposal[] blankHTMLDocResults = new ICompletionProposal[superResults.length + 1];
- blankHTMLDocResults[0] = htmlTagProposal;
- System.arraycopy(superResults, 0, blankHTMLDocResults, 1, superResults.length);
- return blankHTMLDocResults;
- }
- }
-
- if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
-
- // check embedded CSS proposals at the beginning of the STYLE end tag
- Element element = (Element) node;
- String tagName = element.getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) {//$NON-NLS-1$
- IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.getStartOffset() == documentPosition) {
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- int offset = startStructuredDocumentRegion.getEndOffset();
- int pos = documentPosition - offset;
- ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, (char) 0);
- if (proposals != null)
- return proposals;
- }
- }
- }
-
- // check inline CSS proposals
- // need to find attr region from sd region
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) textViewer, documentPosition);
- Iterator regions = sdRegion.getRegions().iterator();
- ITextRegion styleNameRegion = null;
- ITextRegion styleValueRegion = null;
- while (regions.hasNext()) {
- styleNameRegion = (ITextRegion) regions.next();
- if (styleNameRegion.getType().equals(XMLRegionContext.XML_TAG_ATTRIBUTE_NAME) && sdRegion.getText(styleNameRegion).equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) { //$NON-NLS-1$
- // the next region should be "="
- if (regions.hasNext()) {
- regions.next(); // skip the "="
- // next region should be attr value region
- if (regions.hasNext()) {
- styleValueRegion = (ITextRegion) regions.next();
- break;
- }
- }
- }
- }
-
- if (styleValueRegion != null) {
- int offset = sdRegion.getStartOffset(styleValueRegion);
- int end = sdRegion.getTextEndOffset(styleValueRegion);
- if (documentPosition >= offset && documentPosition <= end) {
- boolean askCSS = true;
- char quote = (char) 0;
- String text = sdRegion.getText(styleValueRegion);
- int length = (text != null ? text.length() : 0);
- if (length > 0) {
- char firstChar = text.charAt(0);
- if (firstChar == '"' || firstChar == '\'') {
- if (documentPosition == offset) {
- // before quote
- askCSS = false;
- }
- else {
- offset++;
- quote = firstChar;
- }
- }
- if (documentPosition == end) {
- if (length > 1 && text.charAt(length - 1) == quote) {
- // after quote
- askCSS = false;
- }
- }
- }
- if (askCSS) {
- int pos = documentPosition - offset;
- ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, quote);
- if (proposals != null)
- return proposals;
- }
- }
- }
- }
-
- return super.computeCompletionProposals(textViewer, documentPosition);
- }
-
- /**
- * Returns true if there is no text or it's all white space, otherwise returns false
- *
- * @param treeNode
- * @param textViewer
- * @return boolean
- */
- private boolean isViewerEmpty(ITextViewer textViewer) {
- boolean isEmpty = false;
- String text = textViewer.getTextWidget().getText();
- if (text == null || (text != null && text.trim().equals(""))) //$NON-NLS-1$
- isEmpty = true;
- return isEmpty;
- }
-
- /**
- * @return ICompletionProposal
- */
- private ICompletionProposal getHTMLTagPropsosal(StructuredTextViewer viewer, int documentPosition) {
-
- IModelManagerPlugin mmp = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- IModelManager mm = mmp.getModelManager();
- IStructuredModel model = null;
- try {
- if (mm != null)
- model = mm.getExistingModelForRead(viewer.getDocument());
-
- XMLDocument doc = ((XMLModel) model).getDocument();
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
- // XHTML requires lowercase tagname for lookup
- CMElementDeclaration htmlDecl = (CMElementDeclaration) mq.getCorrespondingCMDocument(doc).getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
- if (htmlDecl != null) {
- StringBuffer proposedTextBuffer = new StringBuffer();
- getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
-
- String proposedText = proposedTextBuffer.toString();
- String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
-
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, documentPosition, // start pos
- 0, // replace length
- requiredName.length() + 2, // cursor position after (relavtive to start)
- SharedEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC),
- requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
- return proposal;
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- return null;
- }
-
- /**
- * @see AbstractContentAssistProcessor#getContentGenerator()
- */
- public XMLContentModelGenerator getContentGenerator() {
- if (fGenerator == null) {
- if (isXHTML)
- fGenerator = XHTMLMinimalContentModelGenerator.getInstance();
- else
- fGenerator = HTMLMinimalContentModelGenerator.getInstance();
- }
- return fGenerator;
- }
-
- protected ICompletionProposal[] getCSSProposals(ITextViewer viewer, int pos, XMLNode element, int offset, char quote) {
-
- CSSContentAssistProcessor cssProcessor = new CSSContentAssistProcessor();
- cssProcessor.setDocumentOffset(offset);
- cssProcessor.setQuoteCharOfStyleAttribute(quote);
-
- return cssProcessor.computeCompletionProposals(viewer, pos);
- }
-
- protected String getEmptyTagCloseString() {
- if (isXHTML)
- return " />"; //$NON-NLS-1$
- return ">"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.contentassist.AbstractContentAssistProcessor#getTemplateCompletionProcessor()
- */
- protected AbstractTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new HTMLTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-
- /**
- * Determine if this Document is an XHTML Document. Oprates solely
- * off of the Document Type declaration
- */
- protected boolean getXHTML(Node node) {
- if (node == null)
- return false;
-
- Document doc = null;
- if (node.getNodeType() != Node.DOCUMENT_NODE)
- doc = node.getOwnerDocument();
- else
- doc = ((Document) node);
-
- if (doc instanceof XMLDocument)
- return ((XMLDocument) doc).isXMLType();
-
-
- if (doc instanceof INodeNotifier) {
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
- CMDocument cmdoc = null;
- if (adapter != null && adapter.getModelQuery() != null)
- cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
- if (cmdoc != null) {
- // treat as XHTML unless we've got the in-code HTML content model
- if (cmdoc instanceof HTMLCMDocument)
- return false;
- if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
- return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
- }
- }
- // this should never be reached
- DocumentType docType = doc.getDoctype();
- return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
- }
-
- protected void init() {
- getPreferenceStore().addPropertyChangeListener(this);
- reinit();
- }
-
- protected void reinit() {
- String key = PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.AUTO_PROPOSE, IContentTypeIdentifier.ContentTypeID_HTML);
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = PreferenceKeyGenerator.generateKey(CommonEditorPreferenceNames.AUTO_PROPOSE_CODE, IContentTypeIdentifier.ContentTypeID_HTML);
- completionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
- }
- else {
- completionProposalAutoActivationCharacters = null;
- }
- }
-
- public void release() {
- if (factoryForCSS != null) {
- factoryForCSS.release();
- }
- getPreferenceStore().removePropertyChangeListener(this);
- super.release();
- }
-
- protected boolean stringsEqual(String a, String b) {
- return a.equalsIgnoreCase(b);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
-
- if (property.compareTo(CommonEditorPreferenceNames.AUTO_PROPOSE) == 0 || property.compareTo(CommonEditorPreferenceNames.AUTO_PROPOSE_CODE) == 0) {
- reinit();
- }
- }
-
- protected IPreferenceStore getPreferenceStore() {
- if (fPreferenceStore == null)
- fPreferenceStore = EditorPlugin.getDefault().getPreferenceStore();
-
- return fPreferenceStore;
- }
-
- /**
- * @see com.ibm.sed.edit.adapters.ExtendedContentAssistAdapter#computeCompletionProposals(ITextViewer, int, IndexedRegion, ITextRegion)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, ITextRegion region) {
- return computeCompletionProposals(viewer, documentPosition);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
deleted file mode 100644
index 1d04f65b89..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,132 +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.html.ui.internal.contentassist;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.HTMLCorePlugin;
-import org.eclipse.wst.html.core.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.xml.ui.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Node;
-
-public class HTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
-
- private static HTMLMinimalContentModelGenerator instance = null;
- protected int fTagCase;
- protected int fAttrCase;
-
- /**
- * HTMLMinimalContentModelGenerator constructor comment.
- */
- private HTMLMinimalContentModelGenerator() {
- super();
- }
-
- private void init() {
- //IPreferenceStore prefs = CommonPreferencesPlugin.getDefault().getPreferenceStore(ContentType.ContentTypeID_HTML);
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
- fTagCase = prefs.getInt(CommonModelPreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(CommonModelPreferenceNames.ATTR_NAME_CASE);
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null)
- return;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
- return;
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- public String getRequiredName(Node ownerNode, CMNode cmnode) {
- String name = super.getRequiredName(ownerNode, cmnode);
- // don't change the case unless we're certain it is meaningless
- if (shouldIgnoreCase(cmnode)) {
- int caseVal = -1;
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION)
- caseVal = fTagCase;
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- caseVal = fAttrCase;
- switch (caseVal) {
- case CommonModelPreferenceNames.LOWER :
- {
- name = name.toLowerCase();
- }
- break;
- case CommonModelPreferenceNames.UPPER :
- {
- name = name.toUpperCase();
- }
- break;
- }
- }
- return name;
- }
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null)
- return other;
- if (elementDecl == null)
- return ">"; //$NON-NLS-1$
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return "/>"; //$NON-NLS-1$
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return ">"; //$NON-NLS-1$
- }
- }
- }
-
- return ">"; //$NON-NLS-1$
- }
-
- /**
- * Gets the instance.
- * @return Returns a HTMLMinimalContentModelGenerator
- */
- public synchronized static HTMLMinimalContentModelGenerator getInstance() {
- if (instance == null)
- instance = new HTMLMinimalContentModelGenerator();
- instance.init();
- return instance;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
deleted file mode 100644
index 1d9e798109..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,53 +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.html.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.wst.html.ui.HTMLEditorPlugin;
-import org.eclipse.wst.html.ui.templates.TemplateContextTypeHTML;
-import org.eclipse.wst.xml.ui.contentassist.AbstractTemplateCompletionProcessor;
-
-
-/**
- * Completion processor for HTML Templates
- */
-public class HTMLTemplateCompletionProcessor extends AbstractTemplateCompletionProcessor {
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.contentassist.AbstractTemplateCompletionProcessor#getTemplateStore()
- */
- protected TemplateStore getTemplateStore() {
- return getHTMLEditorPlugin().getTemplateStore();
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.contentassist.AbstractTemplateCompletionProcessor#getTemplateContextRegistry()
- */
- protected ContextTypeRegistry getTemplateContextRegistry() {
- return getHTMLEditorPlugin().getTemplateContextRegistry();
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.contentassist.AbstractTemplateCompletionProcessor#getContextTypeId()
- */
- protected String getContextTypeId() {
- // turn the context type id into content type specific
- return TemplateContextTypeHTML.generateContextTypeId(super.getContextTypeId());
- }
-
- /**
- * Returns the HTMLEditorPlugin
- * @return HTMLEditorPlugin
- */
- private HTMLEditorPlugin getHTMLEditorPlugin() {
- return (HTMLEditorPlugin) Platform.getPlugin(HTMLEditorPlugin.ID);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
deleted file mode 100644
index 10bf7fc184..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.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.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS;
-import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.javascript.common.ui.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.xml.ui.contentassist.NoRegionContentAssistProcessor;
-
-/**
- *
- * @author pavery
- */
-public class NoRegionContentAssistProcessorForHTML extends NoRegionContentAssistProcessor {
- /*
- * @see com.ibm.sse.editor.xml.contentassist.NoRegionContentAssistProcessor#initPartitionToProcessorMap()
- */
- protected void initPartitionToProcessorMap() {
- super.initPartitionToProcessorMap();
- IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
- fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, htmlProcessor);
- fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, htmlProcessor);
-
- IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
- fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_SCRIPT, jsContentAssistProcessor);
-
- IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
- fPartitionToProcessorMap.put(StructuredTextPartitionerForCSS.ST_STYLE, cssContentAssistProcessor);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
deleted file mode 100644
index e64bb1fe1c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.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.wst.html.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.common.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.xml.ui.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Node;
-
-public class XHTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
-
- private static XHTMLMinimalContentModelGenerator instance = null;
-
- private XHTMLMinimalContentModelGenerator() {
- super();
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null)
- return;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
- return;
- }
-
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null)
- return other;
- if (elementDecl == null)
- return ">"; //$NON-NLS-1$
- // EMPTY tag, do a self-close
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
- // if it's a JSP element, don't add the space since the JSP container doesn't/shouldn't care
- if (elementDecl instanceof HTMLElementDeclaration && (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()))
- // if it's not JSP, conform to XHTML guidelines and add the space
- return "/>"; //$NON-NLS-1$
- else
- return " />"; //$NON-NLS-1$
- }
- // not defined as EMPTY, but should be treated as such anyway
- else if (elementDecl instanceof HTMLElementDeclaration) {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return " />"; //$NON-NLS-1$
- }
- }
-
- return ">"; //$NON-NLS-1$
- }
-
- public synchronized static XHTMLMinimalContentModelGenerator getInstance() {
- if (instance == null)
- instance = new XHTMLMinimalContentModelGenerator();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
deleted file mode 100644
index 587ea0c2e1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,154 +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.html.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.html.ui.HTMLEditorPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- *
- * NOTE: For internal use only. For images used externally, please use the
- * Shared***ImageHelper class instead.
- *
- * @author amywu
- */
-public class HTMLEditorPluginImageHelper {
- private final String PLUGINID = HTMLEditorPlugin.ID;
- private static HTMLEditorPluginImageHelper instance = null;
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a HTMLEditorPluginImageHelper
- */
- public synchronized static HTMLEditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new HTMLEditorPluginImageHelper();
- return instance;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- //create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null)
- fImageDescRegistry = new HashMap();
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
- getImageRegistry().put(resource, image);
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
deleted file mode 100644
index fbf3aec847..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.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.html.ui.internal.editor;
-
-/**
- * Bundle of most images used by the HTML Editor plug-in.
- */
-public class HTMLEditorPluginImages {
- public static final String IMG_OBJ_TABLE = "icons/full/obj16/table.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_ANCHOR = "icons/full/obj16/tag-anchor.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_BODY = "icons/full/obj16/tag-body.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_BUTTON = "icons/full/obj16/tag-button.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_FONT = "icons/full/obj16/tag-font.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_FORM = "icons/full/obj16/tag-form.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_HTML = "icons/full/obj16/tag-html.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_IMAGE_MAP = "icons/full/obj16/tag-image-map.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_IMAGE = "icons/full/obj16/tag-image.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_JSP = "icons/full/obj16/tag-jsp.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_TITLE = "icons/full/obj16/tag-title.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG = "icons/full/obj16/tag.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index c7e40934a7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,43 +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.html.ui.internal.editor;
-
-import org.eclipse.wst.html.ui.HTMLEditorPlugin;
-
-/**
- * Help context ids for the HTML Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.wst.html.ui.
- public static final String PREFIX = HTMLEditorPlugin.ID + "."; //$NON-NLS-1$
-
- // HTML Source page editor
- public static final String HTML_SOURCEVIEW_HELPID = PREFIX + "ehtm0000"; //$NON-NLS-1$
-
- // HTML Files Preference page
- public static final String HTML_PREFWEBX_FILES_HELPID = PREFIX + "webx0030"; //$NON-NLS-1$
- // HTML Source Preference page
- public static final String HTML_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0031"; //$NON-NLS-1$
- // HTML Styles Preference page
- public static final String HTML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0032"; //$NON-NLS-1$
- // HTML Templates Preference page
- public static final String HTML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0033"; //$NON-NLS-1$
-
- // HTML Cleanup dialog
- public static final String CLEANUP_HTML_HELPID = PREFIX + "xmlm1100"; //$NON-NLS-1$
-
- // HTML Content Settings
- public static final String WEB_CONTENT_SETTINGS_HELPID = PREFIX + "misc0170"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/nls/ResourceHandler.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/nls/ResourceHandler.java
deleted file mode 100644
index a629f04897..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/nls/ResourceHandler.java
+++ /dev/null
@@ -1,70 +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.html.ui.internal.nls;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ResourceHandler {
-
-
- private static ResourceBundle fgResourceBundle;
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle("EditingHTML");//$NON-NLS-1$
- }
- catch (MissingResourceException e) {
- // does nothing - this method will return null and
- // getString(String) will return the key
- // it was called with
- }
- return null;
- }
-
- public static String getString(String key) {
- if (fgResourceBundle == null) {
- fgResourceBundle = getResourceBundle();
- }
-
- if (fgResourceBundle != null) {
- try {
- return fgResourceBundle.getString(key);
- }
- catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
- else {
- return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
-
- public static String getString(String key, Object[] args) {
-
- try {
- return MessageFormat.format(getString(key), args);
- }
- catch (IllegalArgumentException e) {
- return getString(key);
- }
-
- }
-
- public static String getString(String key, Object[] args, int x) {
-
- return getString(key);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java
deleted file mode 100644
index 5790f76aff..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.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.html.ui.internal.search;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.sse.ui.internal.search.BasicFindOccurrencesAction;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML;
-
-
-/**
- * Configures a BasicFindOccurrencesAction with HTML partitions and regions
- *
- * @author pavery
- */
-public class HTMLFindOccurrencesAction extends BasicFindOccurrencesAction {
-
- public HTMLFindOccurrencesAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- /**
- * @see com.ibm.sse.editor.internal.search.BasicFindOccurrencesAction#getPartitionTypes()
- */
- public String[] getPartitionTypes() {
-
- return new String[]{StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, StructuredTextPartitionerForXML.ST_DEFAULT_XML};
- }
-
- /**
- * @see com.ibm.sse.editor.internal.search.BasicFindOccurrencesAction#getRegionTypes()
- */
- public String[] getRegionTypes() {
-
- return new String[]{XMLRegionContext.XML_TAG_NAME, XMLRegionContext.XML_TAG_ATTRIBUTE_NAME, XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE};
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java
deleted file mode 100644
index 4ecfcc8c5d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.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.html.ui.openon;
-
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.util.PathHelper;
-import org.eclipse.wst.sse.core.util.URIResolver;
-import org.eclipse.wst.xml.ui.openon.DefaultOpenOnXML;
-
-/**
- * This action class retrieves the link/file selected by the cursor and
- * attempts to open the link/file in the default editor or web browser
- */
-public class DefaultOpenOnHTML extends DefaultOpenOnXML {
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.openon.DefaultOpenOnXML#resolveURI(java.lang.String, java.lang.String, java.lang.String)
- */
- protected String resolveURI(String baseLocation, String publicId, String systemId) {
- // currently using model's URI resolver until a better resolver is extended to common extensible URI resolver
- // future_TODO: should use the new common extensible URI resolver when clients start implementing it
- String resolvedURI = systemId;
-
- if (systemId != null) {
- IStructuredModel sModel = getModelManager().getExistingModelForRead(getDocument());
- if (sModel != null) {
- URIResolver resolver = sModel.getResolver();
- resolvedURI = resolver != null ? resolver.getLocationByURI(systemId, true) : systemId;
-
- sModel.releaseFromRead();
- }
- // special adjustment for file protocol
- if (systemId.startsWith(FILE_PROTOCOL)) {
- PathHelper.removeLeadingSeparator(resolvedURI);
- }
- }
- return resolvedURI;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java
deleted file mode 100644
index b224dd6b2b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java
+++ /dev/null
@@ -1,130 +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.html.ui.preferences.ui;
-
-
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.IModelManagerPlugin;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.preferences.ui.StyledTextColorPicker;
-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.ui.preferences.XMLColorPage;
-import org.eclipse.wst.xml.ui.style.IStyleConstantsXML;
-
-public class HTMLColorPage extends XMLColorPage {
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceKeyGenerator.generateKey((String)i.next(), IContentTypeIdentifier.ContentTypeID_HTML)));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- public String getSampleText() {
- return ResourceHandler.getString("Sample_HTML_doc"); //$NON-NLS-1$ = "<!DOCTYPE HTML\n\tPUBLIC \"-//W3C/DTD/ HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML>\n\t<HEAD>\n\t\t<META content=\"text/html\">\n\t\t<TITLE>HTML Highlighting Preferences</TITLE>\n\t</HEAD>\n<BODY>\n\t<!--\n\t\twe need a flaming logo!\n\t-->\n\t<%\t%>\n</BODY>\n</HTML>"
-
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
-
- initCommonContextStyleMap(contextStyleMap);
- initDocTypeContextStyleMap(contextStyleMap);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN, HTMLColorManager.SCRIPT_AREA_BORDER);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_CONTENT, HTMLColorManager.SCRIPT_AREA);
- // contextStyleMap.put(XMLJSPRegionContexts.BLOCK_TEXT, HTMLColorManager.SCRIPT_AREA);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_DECLARATION_OPEN, HTMLColorManager.SCRIPT_AREA_BORDER);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_EXPRESSION_OPEN, HTMLColorManager.SCRIPT_AREA_BORDER);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN, HTMLColorManager.SCRIPT_AREA_BORDER);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_DIRECTIVE_CLOSE, HTMLColorManager.SCRIPT_AREA_BORDER);
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_CLOSE, HTMLColorManager.SCRIPT_AREA_BORDER);
- contextStyleMap.put(XMLJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
- contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
- }
-
- protected void initDescriptions(Dictionary descriptions) {
-
- initCommonDescriptions(descriptions);
- initDocTypeDescriptions(descriptions);
- }
-
- protected void initStyleList(ArrayList list) {
- initCommonStyleList(list);
- initDocTypeStyleList(list);
- // list.add(HTMLColorManager.SCRIPT_AREA_BORDER);
-
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
-
- IModelManagerPlugin plugin = (IModelManagerPlugin) Platform.getPlugin(IModelManagerPlugin.ID);
- if (plugin != null) {
- IModelManager mmanager = plugin.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_HTML).getParser());
- }
- else
- picker.setParser(new XMLSourceParser());
-
- // create descriptions for hilighting types
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- // map region types to hilighting types
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
-
- picker.setGeneratorKey(IContentTypeIdentifier.ContentTypeID_HTML);
- // updatePickerFont(picker);
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- WorkbenchHelp.setHelp(c, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
- return c;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLFilesPreferencePage.java
deleted file mode 100644
index fd070b4aa2..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLFilesPreferencePage.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.html.ui.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.html.core.HTMLCorePlugin;
-import org.eclipse.wst.html.core.HTMLFilesPreferenceNames;
-import org.eclipse.wst.html.ui.HTMLEditorPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.xml.ui.preferences.EncodingSettings;
-import org.eclipse.wst.xml.ui.preferences.WorkbenchDefaultEncodingSettings;
-import org.eclipse.wst.xml.ui.preferences.XMLFilesPreferencePage;
-
-
-public class HTMLFilesPreferencePage extends XMLFilesPreferencePage {
- private WorkbenchDefaultEncodingSettings fInputEncodingSettings = null;
- private Text fHtmlext_Field;
- private Button fDoctype_Button;
- private Button fGenerator_Button;
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLEditorPlugin.getDefault().getPreferenceStore();
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#doSavePreferenceStore()
- */
- protected void doSavePreferenceStore() {
- HTMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite scrolledComposite = createScrolledComposite(parent);
- createContentsForCreatingOrSavingGroup(scrolledComposite);
- createContentsForCreatingGroup(scrolledComposite);
- createContentsForLoadingGroup(scrolledComposite);
-
- WorkbenchHelp.setHelp(scrolledComposite, IHelpContextIds.HTML_PREFWEBX_FILES_HELPID);
-
- setSize(scrolledComposite);
- loadPreferences();
-
- return scrolledComposite;
- }
-
- protected void createContentsForLoadingGroup(Composite parent) {
- Group group = createGroup(parent, 1);
- group.setText(ResourceHandler.getString("HTMLFilesPreferencePage.0")); //$NON-NLS-1$
-
- fInputEncodingSettings = new WorkbenchDefaultEncodingSettings(group);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- super.initializeValues();
- initializeValuesForLoadingGroup();
- }
-
- protected void initializeValuesForLoadingGroup() {
- String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
- fInputEncodingSettings.setIANATag(encoding);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- super.performDefaults();
- performDefaultsForLoadingGroup();
- }
-
- protected void performDefaultsForLoadingGroup() {
- String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
- fInputEncodingSettings.setIANATag(encoding);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#storeValues()
- */
- protected void storeValues() {
- super.storeValues();
- storeValuesForLoadingGroup();
- }
-
- protected void storeValuesForLoadingGroup() {
- getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#createContentsForCreatingGroup(org.eclipse.swt.widgets.Composite)
- */
- protected void createContentsForCreatingGroup(Composite parent) {
- Group creatingGroup = createGroup(parent, 2);
- creatingGroup.setText(org.eclipse.wst.sse.ui.nls.ResourceHandler.getString("Creating_files")); //$NON-NLS-1$
-
- // Add this suffix..
- createLabel(creatingGroup, ResourceHandler.getString("HTMLFilesPreferencePage.1")); //$NON-NLS-1$
- fHtmlext_Field = createTextField(creatingGroup);
-
- // Encoding..
- Label label = createLabel(creatingGroup, org.eclipse.wst.sse.ui.nls.ResourceHandler.getString("Encoding_desc")); //$NON-NLS-1$
- ((GridData)label.getLayoutData()).horizontalSpan = 2;
- fEncodingSettings = new EncodingSettings(creatingGroup);
- ((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
-
- // Insert DOCTYPE declaration
- fDoctype_Button = createCheckBox(creatingGroup, ResourceHandler.getString("HTMLFilesPreferencePage.2")); //$NON-NLS-1$
- ((GridData)fDoctype_Button.getLayoutData()).horizontalSpan = 2;
-
- // Insert GENERATOR with META tag
- fGenerator_Button = createCheckBox(creatingGroup, ResourceHandler.getString("HTMLFilesPreferencePage.3")); //$NON-NLS-1$
- ((GridData)fGenerator_Button.getLayoutData()).horizontalSpan = 2;
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#initializeValuesForCreatingGroup()
- */
- protected void initializeValuesForCreatingGroup() {
- super.initializeValuesForCreatingGroup();
-
- String defaultSuffix = getModelPreferences().getString(HTMLFilesPreferenceNames.DEFAULT_SUFFIX);
- if (defaultSuffix.length() > 0) {
- fHtmlext_Field.setText(defaultSuffix);
- }
-
- boolean bCheck;
- bCheck = getModelPreferences().getBoolean(HTMLFilesPreferenceNames.GENERATE_DOCUMENT_TYPE);
- fDoctype_Button.setSelection(bCheck);
-
- bCheck = getModelPreferences().getBoolean(HTMLFilesPreferenceNames.GENERATE_GENERATOR);
- fGenerator_Button.setSelection(bCheck);
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#performDefaultsForCreatingGroup()
- */
- protected void performDefaultsForCreatingGroup() {
- super.performDefaultsForCreatingGroup();
-
- fHtmlext_Field.setText(getModelPreferences().getDefaultString(HTMLFilesPreferenceNames.DEFAULT_SUFFIX));
-
- fDoctype_Button.setSelection(getModelPreferences().getDefaultBoolean(HTMLFilesPreferenceNames.GENERATE_DOCUMENT_TYPE));
- fGenerator_Button.setSelection(getModelPreferences().getDefaultBoolean(HTMLFilesPreferenceNames.GENERATE_GENERATOR));
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#storeValuesForCreatingGroup()
- */
- protected void storeValuesForCreatingGroup() {
- super.storeValuesForCreatingGroup();
-
- String str_ext = fHtmlext_Field.getText();
- getModelPreferences().setValue(HTMLFilesPreferenceNames.DEFAULT_SUFFIX, str_ext);
-
- getModelPreferences().setValue(HTMLFilesPreferenceNames.GENERATE_DOCUMENT_TYPE, fDoctype_Button.getSelection());
-
- getModelPreferences().setValue(HTMLFilesPreferenceNames.GENERATE_GENERATOR, fGenerator_Button.getSelection());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLSourcePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLSourcePreferencePage.java
deleted file mode 100644
index 35fbea7fe2..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLSourcePreferencePage.java
+++ /dev/null
@@ -1,143 +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.html.ui.preferences.ui;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.html.core.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.sse.ui.nls.ResourceHandler;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.xml.ui.preferences.XMLSourcePreferencePage;
-
-public class HTMLSourcePreferencePage extends XMLSourcePreferencePage {
-
- protected Button fTagNameAsIs = null;
- protected Button fTagNameUpper = null;
- protected Button fTagNameLower = null;
- protected Button fAttrNameAsIs = null;
- protected Button fAttrNameUpper = null;
- protected Button fAttrNameLower = null;
-
- protected void createContentsForGrammarConstraintsGroup(Composite parent) {
- // do nothing
- }
-
- protected void performDefaultsForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void initializeValuesForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void storeValuesForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void createContentsForContentAssistGroup(Composite parent) {
- super.createContentsForContentAssistGroup(parent);
-
- // add one more group of preferences
- createContentsForPreferredCaseGroup(parent, 2);
- }
-
- protected Composite createContentsForPreferredCaseGroup(Composite parent, int columnSpan) {
- Group caseGroup = createGroup(parent, columnSpan);
- caseGroup.setText(ResourceHandler.getString("Preferred_markup_case_UI_")); //$NON-NLS-1$ = "Preferred markup case"
-
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group tagNameGroup = createGroup(caseGroup, 1);
- tagNameGroup.setText(ResourceHandler.getString("Tag_names__UI_")); //$NON-NLS-1$ = "Tag names:"
- fTagNameUpper = createRadioButton(tagNameGroup, ResourceHandler.getString("Tag_names_Upper_case_UI_")); //$NON-NLS-1$ = "&Upper case"
- fTagNameLower = createRadioButton(tagNameGroup, ResourceHandler.getString("Tag_names_Lower_case_UI_")); //$NON-NLS-1$ = "&Lower case"
-
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group attrNameGroup = createGroup(caseGroup, 1);
- attrNameGroup.setText(ResourceHandler.getString("Attribute_names__UI_")); //$NON-NLS-1$ = "Attribute names:"
- fAttrNameUpper = createRadioButton(attrNameGroup, ResourceHandler.getString("Attribute_names_Upper_case_UI_")); //$NON-NLS-1$ = "U&pper case"
- fAttrNameLower = createRadioButton(attrNameGroup, ResourceHandler.getString("Attribute_names_Lower_case_UI_")); //$NON-NLS-1$ = "L&ower case"
-
- return parent;
-
- }
-
- protected void performDefaults() {
- fTagNameUpper.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.LOWER);
-
- super.performDefaults();
- }
-
- protected void initializeValues() {
- fTagNameUpper.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.LOWER);
-
- super.initializeValues();
- }
-
- protected void storeValues() {
- if (fTagNameUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.TAG_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.TAG_NAME_CASE, CommonModelPreferenceNames.LOWER);
- if (fAttrNameUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.ATTR_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.ATTR_NAME_CASE, CommonModelPreferenceNames.LOWER);
-
- super.storeValues();
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.xml.XMLSourcePreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLSourcePreferencePage#getKey(java.lang.String)
- */
- protected String getKey(String key) {
- String contentTypeId = IContentTypeIdentifier.ContentTypeID_HTML;
- return PreferenceKeyGenerator.generateKey(key, contentTypeId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- WorkbenchHelp.setHelp(c, IHelpContextIds.HTML_PREFWEBX_SOURCE_HELPID);
- return c;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLTemplatePreferencePage.java
deleted file mode 100644
index 509916a4f3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLTemplatePreferencePage.java
+++ /dev/null
@@ -1,59 +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.html.ui.preferences.ui;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.html.ui.HTMLEditorPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-
-/**
- * Preference page for HTML templates
- */
-public class HTMLTemplatePreferencePage extends TemplatePreferencePage {
-
- public HTMLTemplatePreferencePage() {
- HTMLEditorPlugin htmlEditorPlugin = (HTMLEditorPlugin) Platform.getPlugin(HTMLEditorPlugin.ID);
-
- setPreferenceStore(htmlEditorPlugin.getPreferenceStore());
- setTemplateStore(htmlEditorPlugin.getTemplateStore());
- setContextTypeRegistry(htmlEditorPlugin.getTemplateContextRegistry());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- Platform.getPlugin(HTMLEditorPlugin.ID).savePluginPreferences();
- return ok;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#isShowFormatterSetting()
- */
- protected boolean isShowFormatterSetting() {
- // template formatting has not been implemented
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite ancestor) {
- Control c = super.createContents(ancestor);
- WorkbenchHelp.setHelp(c, IHelpContextIds.HTML_PREFWEBX_TEMPLATES_HELPID);
- return c;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForEmbeddedHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForEmbeddedHTML.java
deleted file mode 100644
index 910c2e2071..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForEmbeddedHTML.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.html.ui.registry;
-
-import org.eclipse.wst.html.core.modelhandler.EmbeddedHTML;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.ui.registry.embedded.EmbeddedAdapterFactoryProvider;
-
-public class AdapterFactoryProviderForEmbeddedHTML implements EmbeddedAdapterFactoryProvider {
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
- // if (structuredModel instanceof XMLModel) {
- // XMLDocument doc = ((XMLModel) structuredModel).getDocument();
- // }
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(EmbeddedTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof EmbeddedHTML);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForHTML.java
deleted file mode 100644
index fa3530532a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/registry/AdapterFactoryProviderForHTML.java
+++ /dev/null
@@ -1,138 +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.html.ui.registry;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.html.core.modelhandler.ModelHandlerForHTML;
-import org.eclipse.wst.html.ui.views.contentoutline.JFaceNodeAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.sse.core.IFactoryRegistry;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.util.Assert;
-import org.eclipse.wst.sse.ui.views.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.core.document.XMLModel;
-import org.eclipse.wst.xml.ui.views.properties.XMLPropertySourceAdapterFactory;
-
-/**
- *
- */
-public class AdapterFactoryProviderForHTML implements AdapterFactoryProvider {
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
-
- // these are the normal edit side content based factories
- addContentBasedFactories(structuredModel);
- // ===
- // Must update/add to propagating adapter here too
- if (structuredModel instanceof XMLModel) {
- addPropagatingAdapters(structuredModel);
- }
- // ===
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
-
- IFactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- AdapterFactory factory = null;
- // == this list came from the previous "HTML only" list
- // factory = factoryRegistry.getFactoryFor(ContentAssistAdapter.class);
-
- // Doc Partion change: no more adapter factories for edit side functions
-
- // if (factory == null) {
- // factory = new HTMLContentAssistAdapterFactory();
- // factoryRegistry.addFactory(factory);
- // }
-
- // factory = factoryRegistry.getFactoryFor(DoubleClickAdapter.class);
- // if (factory == null) {
- // factory = new DoubleClickAdapterFactory(DoubleClickAdapter.class, true);
- // factoryRegistry.addFactory(factory);
- // }
- // // == New adapter factories for tagInfo
- // factory = factoryRegistry.getFactoryFor(HoverHelpAdapter.class);
- // if (factory == null) {
- // factory = new HTMLHoverHelpAdapterFactory(HoverHelpAdapter.class, true);
- // factoryRegistry.addFactory(factory);
- // }
- // factory = factoryRegistry.getFactoryFor(TagInfoProviderAdapter.class);
- // if (factory == null) {
- // factory = new JSTagInfoProviderAdapterFactory(TagInfoProviderAdapter.class, true);
- // factoryRegistry.addFactory(factory);
- // }
- // ==
- // == this list came from the previous 'for both XML and HTML' list
- factory = factoryRegistry.getFactoryFor(IPropertySource.class);
- if (factory == null) {
- factory = new XMLPropertySourceAdapterFactory();
- factoryRegistry.addFactory(factory);
- }
- factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
- if (factory == null) {
- factory = new JFaceNodeAdapterFactoryForHTML();
- factoryRegistry.addFactory(factory);
- }
- // factory = factoryRegistry.getFactoryFor(com.ibm.sed.edit.adapters.LineStyleProvider.class);
- // if (factory == null) {
- // factory = new LineStyleProviderFactoryForHTML();
- // factoryRegistry.addFactory(factory);
- // }
-
- // factory = factoryRegistry.getFactoryFor(ReconcilerAdapter.class);
- // if (factory == null) {
- // // can't use Propagating system since the Node tree is already built by now
- // ReconcilerAdapterFactoryForXML reconcilerFactory = new ReconcilerAdapterFactoryForXML();
- // factoryRegistry.addFactory(reconcilerFactory);
- // reconcilerFactory.adaptAll((XMLModel) structuredModel);
- // }
- }
-
- protected void addPropagatingAdapters(IStructuredModel structuredModel) {
-// XMLModel xmlModel = (XMLModel) structuredModel;
-// XMLDocument document = xmlModel.getDocument();
-// PropagatingAdapter propagatingAdapter = (PropagatingAdapter) document.getAdapterFor(PropagatingAdapter.class);
-// if (propagatingAdapter != null) {
- // no longer needs?
- // factory = new HTMLLineStyeUpdaterFactory();
- // propagatingAdapter.addAdaptOnCreateFactory(factory);
- // propagatingAdapter.initializeForFactory(factory, document);
-
- // checking if we should bother adding this factory
- // if the preference says not to check validity, we don't bother creating this factory
- // to improve performance...
- //if(structuredModel.getStructuredPreferenceStore().getPreferenceString(CommonPreferenceNames.EDITOR_VALIDATION_METHOD).equals(CommonPreferenceNames.EDITOR_VALIDATION_CONTENT_MODEL)) {
- //factory = new ReconcilerAdapterFactoryForXML();
- //propagatingAdapter.addAdaptOnCreateFactory(factory);
- // (pa) perf:
- //propagatingAdapter.initializeForFactory(factory, xmlModel.getDocument());
- //}
-
-// }
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForHTML);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- // nothing to do, since no embedded type
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/IStyleConstantsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/IStyleConstantsHTML.java
deleted file mode 100644
index d0df826f56..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/IStyleConstantsHTML.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.html.ui.style;
-
-import org.eclipse.wst.xml.ui.style.IStyleConstantsXML;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider, ColorManager, and
- * any others who may be interested
- */
-public interface IStyleConstantsHTML extends IStyleConstantsXML {
- public static final String SCRIPT_AREA_BORDER = "SCRIPT_AREA_BORDER";//$NON-NLS-1$
- public static final String SCRIPT_AREA = "SCRIPT_AREA";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/LineStyleProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/LineStyleProviderForHTML.java
deleted file mode 100644
index a1d4e5445e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/style/LineStyleProviderForHTML.java
+++ /dev/null
@@ -1,95 +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.html.ui.style;
-
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.ui.preferences.PreferenceKeyGenerator;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-import org.eclipse.wst.xml.ui.style.IStyleConstantsXML;
-import org.eclipse.wst.xml.ui.style.LineStyleProviderForXML;
-
-public class LineStyleProviderForHTML extends LineStyleProviderForXML implements LineStyleProvider {
-
- public LineStyleProviderForHTML() {
- super();
- }
-
- /**
- * a method to centralize all the "format rules" for regions
- * specifically associated for how to "open" the region.
- */
- // NOTE: this method was just copied down form LineStyleProviderForXML
- public TextAttribute getAttributeFor(ITextRegion region) {
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- if (region.getType() == XMLRegionContext.BLOCK_TEXT) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- // first try "standard" tag attributes from super class
- TextAttribute result = super.getAttributeFor(region);
- if (result == null) {
- // the HTML adapter is used for *embedded* JSP code,
- // so the HTML adapter can decide whether to treat
- // as HTML, or as JSP code. By *embedded* when mean when
- // it is postioned as something other than content (e.g. an
- // attribute value)
- // String type = region.getType();
- // if ((type == XMLJSPRegionContexts.JSP_SCRIPTLET_OPEN) // || (type == XMLJSPRegionContexts.JSP_DECLARATION_OPEN)
- // || (type == XMLJSPRegionContexts.JSP_EXPRESSION_OPEN) // || (type == XMLJSPRegionContexts.JSP_DIRECTIVE_OPEN)
- // // || (type == XMLJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
- // || (type == XMLJSPRegionContexts.JSP_CLOSE)) {
- // result = fStructuredTextColors.SCRIPT_AREA_BORDER;
- // } else
- // // Nitin: do you recall why these were put here? from their name, sounds like
- // // they should be in "XML one"?
- // if ((type == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == XMLRegionContext.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- // result = fStructuredTextColors.RTF_TAG_ATTRIBUTE_VALUE;
- // }
-
- }
- return result;
- }
-
- protected String getPreferenceKey(String key) {
- String contentTypeId = IContentTypeIdentifier.ContentTypeID_HTML;
- return PreferenceKeyGenerator.generateKey(key, contentTypeId);
- }
-
- protected void loadColors() {
- super.loadColors();
-
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- }
-
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (getPreferenceKey(IStyleConstantsHTML.SCRIPT_AREA_BORDER).equals(prefKey)) {
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
-
- // this is what AbstractLineStyleProvider.propertyChange() does
- getHighlighter().refreshDisplay();
- } else {
- super.handlePropertyChange(event);
- }
- } else {
- super.handlePropertyChange(event);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLBestMatchHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLBestMatchHoverProcessor.java
deleted file mode 100644
index 6437dff225..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLBestMatchHoverProcessor.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.html.ui.taginfo;
-
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.wst.sse.ui.taginfo.AbstractBestMatchHoverProcessor;
-
-/**
- * Provides the best html hover help documentation (by using other hover help processors)
- * Priority of hover help processors is:
- * ProblemHoverProcessor, HTMLTagInfoHoverProcessor, AnnotationHoverProcessor
- */
-public class HTMLBestMatchHoverProcessor extends AbstractBestMatchHoverProcessor {
- HTMLTagInfoHoverProcessor fTagInfoHover;
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.structured.taginfo.AbstractBestMatchHoverProcessor#getTagInfoHover()
- */
- protected ITextHover getTagInfoHover() {
- if (fTagInfoHover == null) {
- fTagInfoHover = new HTMLTagInfoHoverProcessor();
- }
- return fTagInfoHover;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLInformationProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLInformationProvider.java
deleted file mode 100644
index 8f78ff2eb7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLInformationProvider.java
+++ /dev/null
@@ -1,53 +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.html.ui.taginfo;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-
-/**
- * Provides context information for HTML tags (Shows tooltip description)
- *
- * @author amywu
- */
-public class HTMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
-
- private HTMLBestMatchHoverProcessor fTextHover = null;
-
- public HTMLInformationProvider() {
- fTextHover = new HTMLBestMatchHoverProcessor();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
- */
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
- */
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String)getInformation2(textViewer, subject);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
- */
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLTagInfoHoverProcessor.java
deleted file mode 100644
index 7633baaa03..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/taginfo/HTMLTagInfoHoverProcessor.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.html.ui.taginfo;
-
-
-
-import org.eclipse.wst.xml.ui.taginfo.XMLTagInfoHoverProcessor;
-
-/**
- * Provides hover help documentation for HTML tags
- *
- * @author amywu
- */
-public class HTMLTagInfoHoverProcessor extends XMLTagInfoHoverProcessor {
- // currently empty because XMLTagInfoHoverProcessor handles all cases relevant to HTML
- public HTMLTagInfoHoverProcessor() {
- super();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTML.java
deleted file mode 100644
index a06a0377e9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTML.java
+++ /dev/null
@@ -1,51 +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.html.ui.templates;
-
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.xml.ui.templates.TemplateContextTypeIds;
-import org.eclipse.wst.xml.ui.templates.TemplateContextTypeXML;
-
-
-/**
- * Base class for HTML template context types. Templates of this context
- * type apply to any place within HTML content type.
- */
-public class TemplateContextTypeHTML extends TemplateContextTypeXML {
- public static final String HTML_PREFIX = "html_"; //$NON-NLS-1$
-
- public TemplateContextTypeHTML() {
- this(generateContextTypeId(TemplateContextTypeIds.ALL), ResourceHandler.getString("TemplateContextTypeHTML.0")); //$NON-NLS-1$
- }
-
- /**
- * @param id
- */
- public TemplateContextTypeHTML(String id) {
- this(id, null);
- }
-
- /**
- * @param id
- * @param name
- */
- public TemplateContextTypeHTML(String id, String name) {
- super(id, name);
- }
-
- /*
- * (non-Javadoc)
- * @see com.ibm.sse.editor.xml.templates.TemplateContextTypeXML#generateContextTypeId(java.lang.String)
- */
- public static String generateContextTypeId(String base_contextTypeId) {
- return HTML_PREFIX+base_contextTypeId;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttribute.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttribute.java
deleted file mode 100644
index 1ad10c7050..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttribute.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.html.ui.templates;
-
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.xml.ui.templates.TemplateContextTypeIds;
-
-
-
-/**
- * Templates of this context type apply to any attributes within HTML content type.
- */
-public class TemplateContextTypeHTMLAttribute extends TemplateContextTypeHTML {
-
- public TemplateContextTypeHTMLAttribute() {
- super(generateContextTypeId(TemplateContextTypeIds.ATTRIBUTE), ResourceHandler.getString("TemplateContextTypeHTMLAttribute.0")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttributeValue.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttributeValue.java
deleted file mode 100644
index 33f1ecb949..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLAttributeValue.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.html.ui.templates;
-
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.xml.ui.templates.TemplateContextTypeIds;
-
-
-/**
- * Templates of this context type apply to any attribute values
- * within HTML content type.
- */
-public class TemplateContextTypeHTMLAttributeValue extends TemplateContextTypeHTML {
-
- public TemplateContextTypeHTMLAttributeValue() {
- super(generateContextTypeId(TemplateContextTypeIds.ATTRIBUTEVALUE), ResourceHandler.getString("TemplateContextTypeHTMLAttributeValue.0")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLTag.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLTag.java
deleted file mode 100644
index ee62385096..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/templates/TemplateContextTypeHTMLTag.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.html.ui.templates;
-
-import org.eclipse.wst.html.ui.internal.nls.ResourceHandler;
-import org.eclipse.wst.xml.ui.templates.TemplateContextTypeIds;
-
-
-/**
- * Templates of this context type apply to any tags within HTML content type.
- */
-public class TemplateContextTypeHTMLTag extends TemplateContextTypeHTML {
-
- public TemplateContextTypeHTMLTag() {
- super(generateContextTypeId(TemplateContextTypeIds.TAG), ResourceHandler.getString("TemplateContextTypeHTMLTag.0")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/text/HTMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/text/HTMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 4507f4304d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/text/HTMLDocumentRegionEdgeMatcher.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.html.ui.text;
-
-import org.eclipse.jdt.internal.ui.text.JavaPairMatcher;
-import org.eclipse.wst.sse.ui.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.parser.XMLRegionContext;
-
-public class HTMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public HTMLDocumentRegionEdgeMatcher() {
- super(new String[]{XMLRegionContext.XML_TAG_NAME, XMLRegionContext.XML_COMMENT_TEXT, XMLRegionContext.XML_CDATA_TEXT, XMLRegionContext.XML_PI_OPEN, XMLRegionContext.XML_PI_CONTENT}, new JavaPairMatcher(BRACKETS));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
deleted file mode 100644
index 0df237a563..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.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.html.ui.views.contentoutline;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
-import org.eclipse.wst.xml.ui.views.contentoutline.XMLNodeActionManager;
-
-public class HTMLContentOutlineConfiguration extends XMLContentOutlineConfiguration {
-
- /**
- * @param editor
- */
- public HTMLContentOutlineConfiguration() {
- super();
- }
-
- /**
- * @see com.ibm.sse.editor.xml.views.contentoutline.XMLContentOutlineConfiguration#createNodeActionManager(org.eclipse.jface.viewers.TreeViewer)
- */
- protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
- return new HTMLNodeActionManager(getEditor().getModel(), treeViewer);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLNodeActionManager.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLNodeActionManager.java
deleted file mode 100644
index c35883d375..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLNodeActionManager.java
+++ /dev/null
@@ -1,136 +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.html.ui.views.contentoutline;
-
-
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.common.contentmodel.CMNode;
-import org.eclipse.wst.common.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.common.encoding.content.IContentTypeIdentifier;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.PreferenceNames;
-import org.eclipse.wst.html.core.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.preferences.HTMLContentBuilder;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.xml.ui.views.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- *
- */
-public class HTMLNodeActionManager extends XMLNodeActionManager {
- protected String fTagCase;
- protected String fAttrCase;
-
- public HTMLNodeActionManager(IStructuredModel model, Viewer viewer) {
- super(model, viewer);
- updateCase();
- }
-
- /**
- * If neccessary, employ a DOMContentBuilder that understands how to
- * change the case of HTML tags (but NOT taglib derived tags).
- */
- public DOMContentBuilder createDOMContentBuilder(Document document) {
- DOMContentBuilder builder = null;
- if (model.getModelHandler().getId().equals(IContentTypeIdentifier.ContentTypeID_HTML))
- builder = new HTMLContentBuilder(document);
- else
- builder = super.createDOMContentBuilder(document);
-
- return builder;
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- /**
- * Modify the displayed menuitem label to change the case of HTML children
- * but neither XML nor taglib-derived children.
- */
- public String getLabel(Node parent, CMNode cmnode) {
- String result = null;
- //CMNode cmnode = action.getCMNode();
- // don't change the case unless we're certain it is meaningless
- if (shouldIgnoreCase(cmnode)) {
- String name = cmnode.getNodeName();
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- if (fTagCase.length() > 0) {
- if (fTagCase.equals(PreferenceNames.LOWER))
- name = name.toLowerCase();
- else if (fTagCase.equals(PreferenceNames.UPPER))
- name = name.toUpperCase();
- // else do nothing
- }
- }
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- if (fAttrCase.length() > 0) {
- if (fAttrCase.equals(PreferenceNames.LOWER))
- name = name.toLowerCase();
- else if (fAttrCase.equals(PreferenceNames.UPPER))
- name = name.toUpperCase();
- // else do nothing
- }
- }
- result = name;
- }
- else {
- result = super.getLabel(parent, cmnode);
- }
-
- return result;
- }
-
- /**
- * Another HTML specific detail.
- */
- protected void updateCase() {
- if (model.getModelHandler().getAssociatedContentTypeId().equals(IContentTypeIdentifier.ContentTypeID_HTML)) {
- Preferences prefs = Platform.getPlugin("com.ibm.sse.model.html").getPluginPreferences(); //$NON-NLS-1$
- fTagCase = prefs.getString(CommonModelPreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getString(CommonModelPreferenceNames.ATTR_NAME_CASE);
- // Element caseSettings = HTMLPreferenceManager.getHTMLInstance().getElement(PreferenceNames.PREFERRED_CASE);
- // fTagCase = caseSettings.getAttribute(PreferenceNames.TAGNAME);
- // fAttrCase = caseSettings.getAttribute(PreferenceNames.ATTRIBUTENAME);
- }
- else {
- fTagCase = "";//$NON-NLS-1$
- fAttrCase = "";//$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.ui.actions.AbstractNodeActionManager#reformat(org.w3c.dom.Node, boolean)
- */
- public void reformat(Node newElement, boolean deep) {
- try {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- // format selected node
- IStructuredFormatProcessor formatProcessor = new HTMLFormatProcessorImpl();
- formatProcessor.formatNode(newElement);
- }
- finally {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterFactoryForHTML.java
deleted file mode 100644
index 22c2483321..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,50 +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.html.ui.views.contentoutline;
-
-
-
-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.views.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.views.contentoutline.JFaceNodeAdapterFactory;
-
-/**
- * An adapter factory to create JFaceNodeAdapters. Use this
- * adapter factory with a JFaceAdapterContentProvider to display
- * DOM nodes in a tree.
- */
-public class JFaceNodeAdapterFactoryForHTML extends JFaceNodeAdapterFactory {
-
-
- public JFaceNodeAdapterFactoryForHTML() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- singletonAdapter = new JFaceNodeAdapterForHTML(this);
- initAdapter(singletonAdapter, node);
- }
- return singletonAdapter;
- }
-
- public AdapterFactory copy() {
- return new JFaceNodeAdapterFactoryForHTML(this.adapterKey, this.shouldRegisterAdapter);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterForHTML.java
deleted file mode 100644
index 1dc777e615..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/JFaceNodeAdapterForHTML.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.wst.html.ui.views.contentoutline;
-
-
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.core.HTML40Namespace;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.sse.core.AdapterFactory;
-import org.eclipse.wst.xml.ui.views.contentoutline.JFaceNodeAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-public class JFaceNodeAdapterForHTML extends JFaceNodeAdapter {
-
- private Image createHTMLImage(String imageResourceName) {
- ImageDescriptor imageDescriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(imageResourceName);
- if (imageDescriptor != null)
- return imageDescriptor.createImage();
- return null;
- }
-
- /**
- * Constructor for JFaceNodeAdapterForHTML.
- * @param adapterFactory
- */
- public JFaceNodeAdapterForHTML(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- protected Image createImage(Node node) {
- Image image = null;
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- if (node.getNodeName().equalsIgnoreCase("table")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TABLE);
- else if (node.getNodeName().equalsIgnoreCase("a")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR);
- else if (node.getNodeName().equalsIgnoreCase("body")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BODY);
- else if (node.getNodeName().equalsIgnoreCase("button")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON);
- else if (node.getNodeName().equalsIgnoreCase("font")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FONT);
- else if (node.getNodeName().equalsIgnoreCase("form")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FORM);
- else if (node.getNodeName().equalsIgnoreCase("html")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_HTML);
- else if (node.getNodeName().equalsIgnoreCase("img")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE);
- else if (node.getNodeName().equalsIgnoreCase("map")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP);
- else if (node.getNodeName().equalsIgnoreCase("title")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE);
- else
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG);
- }
- if (image == null) {
- image = super.createImage(node);
- }
- return image;
- }
-
- /*
- * @see IJFaceNodeAdapter#getLabelText(Node)
- */
- public String getLabelText(Node node) {
- // TODO (pa) eventually showing ID, NAME, etc..might be a preference
- // - like in the package explorer for java.. (along w/ being able to customize delimiters)
- // - possibly for all (or filtered list of) elements
- String text = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- if (node.getNodeName().equalsIgnoreCase("table")) { //$NON-NLS-1$
- // won't update properly as-is
- // it will only update if you change the attr name,
- // delete a ", or add a new element to the tree
- text = node.getNodeName();
-
- // get attr values
- String tableID = null;
- tableID = ((Element) node).getAttribute(HTML40Namespace.ATTR_NAME_ID);
- String tableName = null;
- tableName = ((Element) node).getAttribute(HTML40Namespace.ATTR_NAME_NAME);
-
- // if there's ID or NAME, add a ">"
- if ((tableID != null && tableID.length() > 0) || (tableName != null && tableName.length() > 0)) {
- text += " > "; //$NON-NLS-1$
- }
-
- if (tableID != null && tableID.length() > 0)
- text += " ID:[" + tableID + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- if (tableName != null && tableName.length() > 0)
- text += " NAME:[" + tableName + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (text == null)
- text = super.getLabelText(node);
- return text;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
deleted file mode 100644
index 7498861ece..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
+++ /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
-###############################################################################
-Templates.comment.name=comment
-Templates.comment.desc=comment
-Templates.ul.name=ul
-Templates.ul.desc=ul (template)
-Templates.ul.content=<ul>\n <li> Item one </li>\n <li> Item two </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (template)
-Templates.dl.content=<dl>\n <dt> First definition <dd> First explanation\n <dt> Second definition <dd> Second explanation\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=table (template)
-Templates.table.content=<table border>\n <tr>\n <th>Column 1 Heading</th>\n <th>Column 2 Heading</th>\n </tr>\n <tr>\n <td>Row 1: Col 1</td>\n <td>Row 1: Col 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (template)
-Templates.ol.content=<ol>\n <li> Item one </li>\n <li> Item two </li>\n</ol>\n
-Templates.html.name=html
-Templates.html.desc=html (template)
-Templates.html.content=<html>\n<head>\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=script (commented)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=style (commented)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (map) \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
deleted file mode 100644
index 7d145b2ffc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-
-<template name="%Templates.comment.name" description="%Templates.comment.desc" id="com.ibm.sse.editor.html.templates.comment" context="html_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
-
-<template name="%Templates.imgmap.name" description="%Templates.imgmap.desc" id="com.ibm.sse.editor.html.templates.imgmap" context="html_tag" enabled="true">&lt;img ismap&gt;</template>
-
-<template name="%Templates.ul.name" description="%Templates.ul.desc" id="com.ibm.sse.editor.html.templates.ul" context="html_tag" enabled="true">%Templates.ul.content</template>
-
-<template name="%Templates.dl.name" description="%Templates.dl.desc" id="com.ibm.sse.editor.html.templates.dl" context="html_tag" enabled="true">%Templates.dl.content</template>
-
-<template name="%Templates.table.name" description="%Templates.table.desc" id="com.ibm.sse.editor.html.templates.table" context="html_tag" enabled="true">%Templates.table.content</template>
-
-<template name="%Templates.ol.name" description="%Templates.ol.desc" id="com.ibm.sse.editor.html.templates.ol" context="html_tag" enabled="true">%Templates.ol.content</template>
-
-<template name="%Templates.html.name" description="%Templates.html.desc" id="com.ibm.sse.editor.html.templates.html" context="html_tag" enabled="true">%Templates.html.content</template>
-
-<template name="%Templates.html.name" description="%Templates.html.desc" id="com.ibm.sse.editor.html.templates.html" context="html_tag" enabled="true">%Templates.html.content</template>
-
-<template name="%Templates.script.name" description="%Templates.script.desc" id="com.ibm.sse.editor.html.templates.script" context="html_tag" enabled="true">%Templates.script.content</template>
-
-<template name="%Templates.style.name" description="%Templates.style.desc" id="com.ibm.sse.editor.html.templates.style" context="html_tag" enabled="true">%Templates.style.content</template>
-
-</templates>
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_de.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_de.properties
deleted file mode 100644
index 58df23f7e8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_de.properties
+++ /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
-###############################################################################
-Templates.comment.name=Kommentar
-Templates.comment.desc=Kommentar
-Templates.ul.name=ul
-Templates.ul.desc=ul (Schablone)
-Templates.ul.content=<ul>\n <li> Eintrag 1</li>\n <li> Eintrag 2</li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (Schablone)
-Templates.dl.content=<dl>\n <dt> Erste Definition <dd> Erste Erl\u00e4uterung\n <dt> Zweite Definition <dd> Zweite Erl\u00e4uterung\n</dl>\n
-Templates.table.name=Tabelle
-Templates.table.desc=Tabelle (Schablone)
-Templates.table.content=<table border>\n <tr>\n <th>Spalte 1 \u00dcberschrift</th>\n <th>Spalte 2 \u00dcberschrift</th>\n </tr>\n <tr>\n <td>Zeile 1: Spalte 1</td>\n <td>Zeile 1: Spalte 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (Schablone)
-Templates.ol.content=<ol>\n <li> Eintrag 1</li>\n <li> Eintrag 2</li>\n </ol>\n
-Templates.html.name=html
-Templates.html.desc=html (Schablone)
-Templates.html.content=<html>\n<head>\n<title>Hier Titel einf\u00fcgen</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=Script
-Templates.script.desc=Script (Kommentar)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=Darstellung
-Templates.style.desc=Darstellung (Kommentar)
-Templates.style.content=<style>\n<!--\n${Cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (Abbildung)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_es.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_es.properties
deleted file mode 100644
index 58a3cd638e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_es.properties
+++ /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
-###############################################################################
-Templates.comment.name=comment
-Templates.comment.desc=comment
-Templates.ul.name=ul
-Templates.ul.desc=ul (plantilla)
-Templates.ul.content=<ul>\n <li> Elemento uno </li>\n <li> Elemento dos </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (plantilla)
-Templates.dl.content=<dl>\n <dt> Primera definici\u00f3n <dd> Primera explicaci\u00f3n\n <dt> Segunda definici\u00f3n <dd> Segunda explicaci\u00f3n\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=table (plantilla)
-Templates.table.content=<table border>\n <tr>\n <th>Cabecera de columna 1</th>\n <th>Cabecera de columna 2</th>\n </tr>\n <tr>\n <td>Fila 1: Col 1</td>\n <td>Fila 1: Col 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (plantilla)
-Templates.ol.content=<ol>\n <li> Elemento uno </li>\n <li> Elemento dos </li>\n</ol>\n
-Templates.html.name=html
-Templates.html.desc=html (plantilla)
-Templates.html.content=<html>\n<head>\n<title>Insertar t\u00edtulo aqu\u00ed</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=script (comentado)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=style (comentado)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (mapa)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_fr.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_fr.properties
deleted file mode 100644
index f5973262b9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_fr.properties
+++ /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
-###############################################################################
-Templates.comment.name=commentaire
-Templates.comment.desc=commentaire
-Templates.ul.name=ul
-Templates.ul.desc=ul (mod\u00e8le)
-Templates.ul.content=<ul>\n <li> El\u00e9ment un </li>\n <li> El\u00e9ment deux </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (mod\u00e8le)
-Templates.dl.content=<dl>\n <dt> Premi\u00e8re d\u00e9finition <dd> Premi\u00e8re explication\n <dt> Seconde d\u00e9finition <dd> Seconde explication\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=table (mod\u00e8le)
-Templates.table.content=<table border>\n <tr>\n <th>Colonne 1 En-t\u00eate</th>\n <th>Colonne 2 En-t\u00eate</th>\n </tr>\n <tr>\n <td>Ligne 1 : Col 1</td>\n <td>Ligne 1 : Col 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (mod\u00e8le)
-Templates.ol.content=<ol>\n <li> El\u00e9ment un </li>\n <li> El\u00e9ment deux </li>\n </ol>\n
-Templates.html.name=html
-Templates.html.desc=html (mod\u00e8le)
-Templates.html.content=<html>\n<head>\n<title>Ins\u00e9rer le titre ici</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=script (comment\u00e9)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=style (comment\u00e9)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (mappe)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_it.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_it.properties
deleted file mode 100644
index 1e159ce6c4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_it.properties
+++ /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
-###############################################################################
-Templates.comment.name=commento
-Templates.comment.desc=commento
-Templates.ul.name=ul
-Templates.ul.desc=ul (modello)
-Templates.ul.content=<ul>\n <li> Elemento uno </li>\n <li> Elemento due </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (modello)
-Templates.dl.content=<dl>\n <dt> Prima definizione <dd> Prima spiegazione\n <dt> Seconda definizione <dd> Seconda spiegazione\n</dl>\n
-Templates.table.name=tabella
-Templates.table.desc=tabella (modello)
-Templates.table.content=<table border>\n <tr>\n <th>Intestazione colonna 1</th>\n <th>Intestazione colonna 2</th>\n </tr>\n <tr>\n <td>Riga 1: Colonna 1</td>\n <td>Riga 1: Colonna 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (modello)
-Templates.ol.content=<ol>\n <li> Elemento uno </li>\n <li> Elemento due </li>\n</ol>\n
-Templates.html.name=html
-Templates.html.desc=html (modello)
-Templates.html.content=<html>\n<head>\n<title>Inserire il titolo in questo punto</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=script (commentato)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=stile
-Templates.style.desc=stile (commentato)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (mappa)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ja.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ja.properties
deleted file mode 100644
index 229ced96a1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ja.properties
+++ /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
-###############################################################################
-Templates.comment.name=\u30b3\u30e1\u30f3\u30c8
-Templates.comment.desc=\u30b3\u30e1\u30f3\u30c8
-Templates.ul.name=ul
-Templates.ul.desc=ul (\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8)
-Templates.ul.content=<ul>\n <li> \u9805\u76ee 1 </li>\n <li> \u9805\u76ee 2 </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8)
-Templates.dl.content=<dl>\n <dt> 1 \u756a\u76ee\u306e\u5b9a\u7fa9 <dd> 1 \u756a\u76ee\u306e\u8aac\u660e\n <dt> 2 \u756a\u76ee\u306e\u5b9a\u7fa9 <dd> 2 \u756a\u76ee\u306e\u8aac\u660e\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=\u30c6\u30fc\u30d6\u30eb (\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8)
-Templates.table.content=<table border>\n <tr>\n <th>\u5217 1 \u898b\u51fa\u3057</th>\n <th>\u5217 2 \u898b\u51fa\u3057</th>\n </tr>\n <tr>\n <td>\u884c 1: \u5217 1</td>\n <td>\u884c 1: \u5217 2</td>\n </tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8)
-Templates.ol.content=<ol>\n <li> \u9805\u76ee 1 </li>\n <li> \u9805\u76ee 2 </li>\n</ol>\n
-Templates.html.name=html
-Templates.html.desc=html (\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8)
-Templates.html.content=<html>\n<head>\n<title>\u3053\u3053\u306b\u30bf\u30a4\u30c8\u30eb\u3092\u633f\u5165</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=\u30b9\u30af\u30ea\u30d7\u30c8 (\u30b3\u30e1\u30f3\u30c8)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=\u30b9\u30bf\u30a4\u30eb (\u30b3\u30e1\u30f3\u30c8)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (\u30de\u30c3\u30d7)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ko.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ko.properties
deleted file mode 100644
index c45f44b70c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_ko.properties
+++ /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
-###############################################################################
-Templates.comment.name=\uc8fc\uc11d
-Templates.comment.desc=\uc8fc\uc11d
-Templates.ul.name=ul
-Templates.ul.desc=ul (\ud15c\ud50c\ub9ac\ud2b8)
-Templates.ul.content=<ul>\n<li> \ud56d\ubaa9 1 </li>\n<li> \ud56d\ubaa9 2 </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (\ud15c\ud50c\ub9ac\ud2b8)
-Templates.dl.content=<dl>\n<dt> \uc81c1 \uc815\uc758 <dd> \uc81c1 \uc124\uba85\n<dt> \uc81c2 \uc815\uc758 <dd> \uc81c2 \uc124\uba85\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=table (\ud15c\ud50c\ub9ac\ud2b8)
-Templates.table.content=<table border>\n<tr>\n<th>\uc5f4 1 \ud45c\uc81c</th>\n<th>\uc5f4 2 \ud45c\uc81c</th>\n</tr>\n<tr>\n<td>\ud589 1: \uc5f4 1</td>\n<td>\ud589 1: \uc5f4 2</td>\n</tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (\ud15c\ud50c\ub9ac\ud2b8)
-Templates.ol.content=<ol>\n<li> \ud56d\ubaa9 1 </li>\n<li> \ud56d\ubaa9 2 </li>\n</ol>\n
-Templates.html.name=html
-Templates.html.desc=html (\ud15c\ud50c\ub9ac\ud2b8)
-Templates.html.content=<html>\n<head>\n<title>\uc5ec\uae30\uc5d0 \uc81c\ubaa9 \uc0bd\uc785</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=script (\uc8fc\uc11d\ucc98\ub9ac)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=style (\uc8fc\uc11d\ucc98\ub9ac)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (\ub9f5)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_pt_BR.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_pt_BR.properties
deleted file mode 100644
index 282472b2fd..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_pt_BR.properties
+++ /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
-###############################################################################
-Templates.comment.name=coment\u00e1rio
-Templates.comment.desc=coment\u00e1rio
-Templates.ul.name=ul
-Templates.ul.desc=ul (modelo)
-Templates.ul.content=<ul>\n<li> Item um </li>\n<li> Item dois </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl (modelo)
-Templates.dl.content=<dl>\n<dt> Primeira defini\u00e7\u00e3o <dd> Primeira explica\u00e7\u00e3o\n<dt> Segunda defini\u00e7\u00e3o <dd> Segunda explica\u00e7\u00e3o\n</dl>\n
-Templates.table.name=tabela
-Templates.table.desc=tabela (modelo)
-Templates.table.content=<table border>\n<tr>\n<th>T\u00edtulo da Coluna 1</th>\n<th>T\u00edtulo da Coluna 2</th>\n</tr>\n <tr>\n<td>Linha 1: Col 1</td>\n<td>Linha 1: Col 2</td>\n</tr>\n</table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol (modelo)
-Templates.ol.content=<ol>\n<li> Item um </li>\n<li> Item dois </li>\n</ol>\n
-Templates.html.name=html
-Templates.html.desc=html (modelo)
-Templates.html.content=<html>\n<head>\n<title>Inserir t\u00edtulo aqui</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=script
-Templates.script.desc=script (comentado)
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=estilo
-Templates.style.desc=estilo (comentado)
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img (mapa)
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_CN.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_CN.properties
deleted file mode 100644
index 0ccbd24f73..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_CN.properties
+++ /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
-###############################################################################
-Templates.comment.name=\u6ce8\u91ca
-Templates.comment.desc=\u6ce8\u91ca
-Templates.ul.name=ul
-Templates.ul.desc=ul \uff08\u6a21\u677f\uff09
-Templates.ul.content=<ul>\n <li> \u7b2c\u4e00\u9879 </li>\n <li> \u7b2c\u4e8c\u9879 </li>\n </ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl \uff08\u6a21\u677f\uff09
-Templates.dl.content=<dl>\n <dt> \u7b2c\u4e00\u4e2a\u5b9a\u4e49 <dd> \u7b2c\u4e00\u4e2a\u8bf4\u660e\n <dt> \u7b2c\u4e8c\u4e2a\u5b9a\u4e49 <dd> \u7b2c\u4e8c\u4e2a\u8bf4\u660e\n </dl>\n
-Templates.table.name=\u8868
-Templates.table.desc=\u8868 \uff08\u6a21\u677f\uff09
-Templates.table.content=<table border>\n <tr>\n <th>\u7b2c 1 \u5217\u6807\u9898</th>\n <th>\u7b2c 2 \u5217\u6807\u9898</th>\n </tr>\n <tr>\n <td>\u7b2c 1 \u884c\uff1a\u7b2c 1 \u5217</td>\n <td>\u7b2c 1 \u884c\uff1a\u7b2c 2 \u5217</td>\n </tr>\n </table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol \uff08\u6a21\u677f\uff09
-Templates.ol.content=<ol>\n <li> \u7b2c\u4e00\u9879 </li>\n <li> \u7b2c\u4e8c\u9879 </li>\n </ol>\n
-Templates.html.name=html
-Templates.html.desc=html \uff08\u6a21\u677f\uff09
-Templates.html.content=<html>\n<head>\n<title>\u5728\u6b64\u5904\u63d2\u5165\u6807\u9898</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=\u811a\u672c
-Templates.script.desc=\u811a\u672c \uff08\u5df2\u52a0\u6ce8\u91ca\uff09
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=\u6837\u5f0f
-Templates.style.desc=\u6837\u5f0f \uff08\u5df2\u52a0\u6ce8\u91ca\uff09
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img \uff08\u6620\u5c04\uff09
diff --git a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_TW.properties b/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_TW.properties
deleted file mode 100644
index ff357930e9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates_zh_TW.properties
+++ /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
-###############################################################################
-Templates.comment.name=\u8a3b\u89e3
-Templates.comment.desc=\u8a3b\u89e3
-Templates.ul.name=ul
-Templates.ul.desc=ul \uff08\u7bc4\u672c\uff09
-Templates.ul.content=<ul>\n <li> \u9805\u76ee 1 </li>\n <li> \u9805\u76ee 2 </li>\n </ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=dl \uff08\u7bc4\u672c\uff09
-Templates.dl.content=<dl>\n <dt> \u7b2c\u4e00\u500b\u5b9a\u7fa9 <dd> \u7b2c\u4e00\u500b\u8aaa\u660e\n <dt> \u7b2c\u4e8c\u500b\u5b9a\u7fa9 <dd> \u7b2c\u4e8c\u500b\u8aaa\u660e\n </dl>\n
-Templates.table.name=table
-Templates.table.desc=table \uff08\u7bc4\u672c\uff09
-Templates.table.content=<table border>\n <tr>\n <th>\u7b2c 1 \u6b04\u6a19\u984c</th>\n <th>\u7b2c 2 \u6b04\u6a19\u984c</th>\n </tr>\n <tr>\n <td>\u5217 1\uff1a\u76f4\u6b04 1</td>\n <td>\u5217 1\uff1a\u76f4\u6b04 2</td>\n </tr>\n </table>\n
-Templates.ol.name=ol
-Templates.ol.desc=ol \uff08\u7bc4\u672c\uff09
-Templates.ol.content=<ol>\n <li> \u9805\u76ee 1 </li>\n <li> \u9805\u76ee 2 </li>\n </ol>\n
-Templates.html.name=html
-Templates.html.desc=html \uff08\u7bc4\u672c\uff09
-Templates.html.content=<html>\n<head>\n<title>\u5728\u9019\u88e1\u63d2\u5165\u6a19\u984c</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.script.name=Script
-Templates.script.desc=script \uff08\u52a0\u8a3b\uff09
-Templates.script.content=<script type=\"${cursor}text/javascript\">\n<!--\n\n//-->\n</script>
-Templates.style.name=style
-Templates.style.desc=style \uff08\u52a0\u8a3b\uff09
-Templates.style.content=<style>\n<!--\n${cursor}\n-->\n</style>
-Templates.imgmap.name=img
-Templates.imgmap.desc=img \uff08\u5c0d\u6620\uff09
diff --git a/bundles/org.eclipse.wst.sse.core/.classpath b/bundles/org.eclipse.wst.sse.core/.classpath
deleted file mode 100644
index df094ee4a7..0000000000
--- a/bundles/org.eclipse.wst.sse.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.sse.core/.compatibility b/bundles/org.eclipse.wst.sse.core/.compatibility
deleted file mode 100644
index b10de480da..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.compatibility
+++ /dev/null
@@ -1,2 +0,0 @@
-#Wed Mar 24 13:53:52 EST 2004
-.project=7955
diff --git a/bundles/org.eclipse.wst.sse.core/.cvsignore b/bundles/org.eclipse.wst.sse.core/.cvsignore
deleted file mode 100644
index 826c644da0..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-model.jar
-build.xml
-temp.folder
-org.eclipse.wst.sse.core_1.0.0.jar
diff --git a/bundles/org.eclipse.wst.sse.core/.options b/bundles/org.eclipse.wst.sse.core/.options
deleted file mode 100644
index 08bcfef279..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.options
+++ /dev/null
@@ -1,15 +0,0 @@
-org.eclipse.wst.sse.core/debug=true
-org.eclipse.wst.sse.core/debug/tracefilter=
-org.eclipse.wst.sse.core/dom/adapter/notification/time=false
-org.eclipse.wst.sse.core/dom/adapter/notification/time/criteria=10
-org.eclipse.wst.sse.core/resourcechangehandling=false
-org.eclipse.wst.sse.core/structuredmodel/lifecycle=false
-org.eclipse.wst.sse.core/structuredmodel/state=false
-org.eclipse.wst.sse.core/builder=false
-org.eclipse.wst.sse.core/builder/detection=false
-org.eclipse.wst.sse.core/builder/time=false
-org.eclipse.wst.sse.core/participantregistry=false
-org.eclipse.wst.sse.core/builder/participant/tasktag=false
-org.eclipse.wst.sse.core/builder/modelprovider=false
-org.eclipse.wst.sse.core/filebuffers/modelmanagement=false
-org.eclipse.wst.sse.core/filebuffers/lifecycle=false
diff --git a/bundles/org.eclipse.wst.sse.core/.project b/bundles/org.eclipse.wst.sse.core/.project
deleted file mode 100644
index 13fb18b9d1..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.project
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.sse.core</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.wst.common.encoding</project>
- <project>org.eclipse.wst.common.contentmodel</project>
- <project>org.eclipse.wst.xml.uriresolver.xmlutility</project>
- <project>org.eclipse.core.filebuffers</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.emf.common</project>
- <project>org.eclipse.jface.text</project>
- </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.sse.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b5d794de3b..0000000000
--- a/bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,69 +0,0 @@
-#Wed Nov 17 14:00:42 EST 2004
-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=error
-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=warning
-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=ignore
-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=error
-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=500
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-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.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
deleted file mode 100644
index 00c56b7b3f..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex
+++ /dev/null
@@ -1,286 +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.wst.common.encoding.contentspecific.css;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-%%
-
-%{
-
-
- 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;
-
- /* 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;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
- 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);
- }
-
-
-%}
-
-%eof{
- hasMore=false;
-%eof}
-
-%public
-%class CSSHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-%debug
-%switch
-
-
-UTF16BE = \xFE\xFF
-UTF16LE = \xFF\xFE
-UTF83ByteBOM = \xEF\xBB\xBF
-
-//SpaceChar = [\x20\x09]
-
-
-
-// [3] S ::= (0x20 | 0x9 | 0xD | 0xA)+
-S = [\x20\x09\x0D\x0A]
-
-BeginAttribeValue = {S}* \= {S}*
-
-LineTerminator = \r|\n
-
-
-%state ST_XMLDecl
-%state CHARSET_RULE
-%state QuotedAttributeValue
-%state DQ_STRING
-%state SQ_STRING
-%state UnDelimitedString
-
-%%
-
-
-<YYINITIAL>
-{
- {UTF16BE} {hasMore = false; return EncodingParserConstants.UTF16BE;}
- {UTF16LE} {hasMore = false; return EncodingParserConstants.UTF16LE;}
- {UTF83ByteBOM} {hasMore = false; return EncodingParserConstants.UTF83ByteBOM;}
-
- // force to be started on first line, but we do allow preceeding spaces
- ^ {S}* "<\?xml" {S}+ {if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;}}
-
- ^ {S}* "@charset" {if (yychar == 0 ) {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;}}
-
-
-}
-
-// I don't think there's really an XML form of CSS files ... but will leave here for consistency
-<ST_XMLDecl>
-{
- //"version" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDeclVersion;}
- "encoding" {BeginAttribeValue} {pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding;}
- // note this "forced end" once end of XML Declaration found
- "\?>" {yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd;}
-}
-
-<CHARSET_RULE>
-{
-
- {S}* {pushCurrentState(); yybegin(QuotedAttributeValue);}
- ";" { yybegin(YYINITIAL); hasMore = false; return CSSHeadTokenizerConstants.RuleEnd;}
-}
-
-
-<QuotedAttributeValue>
-{
- \" { yybegin(DQ_STRING); string.setLength(0); }
- \' { yybegin(SQ_STRING); string.setLength(0); }
- // in this state, anything other than a space character can start an undelimited string
- {S}*. { yypushback(1); yybegin(UnDelimitedString); string.setLength(0);}
-
-}
-
-
-<DQ_STRING>
-{
-
- \" { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- {LineTerminator} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\?>" { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "<" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
-
- ">" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\/>" { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- ";" { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
-
- . { string.append( yytext() ); }
-
-
-}
-
-<SQ_STRING>
-{
-
- \' { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue;}
- {LineTerminator} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "%>" { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "<" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- ">" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\/>" { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- ";" { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- . { string.append( yytext() ); }
-
-
-}
-
-<UnDelimitedString>
-{
-
-
- {S} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- {LineTerminator} { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\?>" { yypushback(2);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "<" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- // these are a bit special, since we started an undelimit string, but found a quote ... probably indicates a missing beginning quote
- \' { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
- \" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;}
-
- ">" { yypushback(1);popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- "\/>" { yypushback(2); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue;}
- ";" { yypushback(1); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- . { string.append( yytext() ); }
-
-}
-
-// The "match anything" rule should always be in effect except for when looking for end of string
-// (That is, remember to update state list if/when new states added)
-<YYINITIAL, ST_XMLDecl, QuotedAttributeValue, CHARSET_RULE>
-{
-// this is the fallback (match "anything") rule (for this scanner, input is ignored, and position advanced, if not recognized)
-.|\n {if (yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;}}
-}
-
-// this rule always in effect
-<<EOF>> {hasMore = false; return EncodingParserConstants.EOF;}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
deleted file mode 100644
index 4dfc385756..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java
+++ /dev/null
@@ -1,977 +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
- *
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:42 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.common.encoding.contentspecific.css;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.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;
-
- /** 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 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;
-
- /* 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;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
- 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 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 (java.io.IOException e) {
- System.out.println("Error opening file \""+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);
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd
deleted file mode 100644
index 9ef06e965e..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-
-rem The following variables need to be set/specified for each "development machine"
-set PATH=%PATH%;d:jdks\j2sdk1.4.1_02\bin
-set WORKSPACE_LOCATION=D:\builds\Workspaces\PureHeadWorkspace
-set JFLEX_LIB_LOCATION=D:\DevTimeSupport\JFlex\lib
-
-rem The following variables differ from project to project, but should be otherwise constant
-set MAIN_NAME=CSSHeadTokenizer
-set PROJECT_SRC=\org.eclipse.wst.common.encoding.contentspecific\src\
-set PACKAGE_DIR=com\ibm\encoding\resource\contentspecific\css\
-
-rem Given the above "framework" and the command themselves, these variables should never need to be modified
-set JAVA_FILE=%MAIN_NAME%.java
-set JFLEX_RULES=%MAIN_NAME%.jflex
-set SKELETON_FILE=%MAIN_NAME%.skeleton
-
-IF EXIST %JAVA_FILE% del %JAVA_FILE%
-rem java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% -skel %SKELETON_FILE% 1>jflexout.txt 2>jflexerr.txt
-java -Xmx470000000 -cp %JFLEX_LIB_LOCATION%\sed-jflex.jar;. JFlex.Main %JFLEX_RULES% 1>jflexout.txt 2>jflexerr.txt
-IF EXIST %JAVA_FILE% copy %JAVA_FILE% %WORKSPACE_LOCATION%%PROJECT_SRC%%PACKAGE_DIR%%JAVA_FILE%
-
-rem pause
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt
+++ /dev/null
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt
deleted file mode 100644
index e0743ca042..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading "CSSHeadTokenizer.jflex"
-Constructing NFA : 458 states in NFA
-Converting NFA to DFA :
-........................................................................................
-102 states before minimization, 64 states in minimized DFA
-Writing code to "CSSHeadTokenizer.java"
diff --git a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex b/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
deleted file mode 100644
index eb109216fa..0000000000
--- a/bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex
+++ /dev/null
@@ -1,285 +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.wst.common.encoding.contentspecific.html;
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.common.encoding.contentspecific.EncodingParserConstants;
-import org.eclipse.wst.common.encoding.contentspecific.HeadParserToken;
-import org.eclipse.wst.common.encoding.contentspecific.IntStack;
-import org.eclipse.wst.common.encoding.contentspecific.xml.XMLHeadTokenizerConstants;
-
-
-
-%%
-
-%{
-
-
- 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;
- boolean foundContentTypeValue = false;
-
-
-
- public HTMLHeadTokenizer() {
- 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 */
- 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
- */
- 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);
- }
-
-
-%}
-
-%eof{
- hasMore=false;
-%eof}
-
-%public
-%class HTMLHeadTokenizer
-%function primGetNextToken
-%type String
-%char
-%unicode
-%ignorecase
-%debug
-%switch
-