Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.wst.wsdl.tests.performance/data/1000WSDLsNoDepends/sample832.wsdl')
-rw-r--r--tests/org.eclipse.wst.wsdl.tests.performance/data/1000WSDLsNoDepends/sample832.wsdl36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/org.eclipse.wst.wsdl.tests.performance/data/1000WSDLsNoDepends/sample832.wsdl b/tests/org.eclipse.wst.wsdl.tests.performance/data/1000WSDLsNoDepends/sample832.wsdl
deleted file mode 100644
index b7536b919..000000000
--- a/tests/org.eclipse.wst.wsdl.tests.performance/data/1000WSDLsNoDepends/sample832.wsdl
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions name="sample" targetNamespace="http://www.example.org/sample832" xmlns:tns="http://www.example.org/sample832" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
-<wsdl:types>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/sample832">
-<xsd:element name="NewOperationResponse" type="xsd:string"/><xsd:element name="NewOperationRequest" type="xsd:string"/></xsd:schema>
-</wsdl:types>
-<wsdl:message name="NewOperationResponse">
-<wsdl:part name="NewOperationResponse" element="tns:NewOperationResponse"/>
-</wsdl:message>
-<wsdl:message name="NewOperationRequest">
-<wsdl:part name="NewOperationRequest" element="tns:NewOperationRequest"/>
-</wsdl:message>
-<wsdl:portType name="sample">
-<wsdl:operation name="NewOperation">
-<wsdl:input message="tns:NewOperationRequest"/>
-<wsdl:output message="tns:NewOperationResponse"/>
-</wsdl:operation>
-</wsdl:portType>
-<wsdl:binding name="sampleSOAP" type="tns:sample">
-<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
-<wsdl:operation name="NewOperation">
-<soap:operation soapAction="http://www.example.org/sample/NewOperation"/>
-<wsdl:input>
-<soap:body use="literal" parts=" NewOperationRequest"/>
-</wsdl:input>
-<wsdl:output>
-<soap:body use="literal" parts=" NewOperationResponse"/>
-</wsdl:output>
-</wsdl:operation>
-</wsdl:binding>
-<wsdl:service name="sample">
-<wsdl:port name="sampleSOAP" binding="tns:sampleSOAP">
-<soap:address location="http://www.example.org/"/>
-</wsdl:port>
-</wsdl:service>
-</wsdl:definitions> \ No newline at end of file

Back to the top

editing/webtools.sourceediting.git/diff/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif?h=v200910161534'>bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gifbin176 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gifbin118 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gifbin87 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gifbin119 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gifbin124 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gifbin604 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gifbin603 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gifbin600 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gifbin586 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gifbin595 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gifbin592 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gifbin574 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gifbin152 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gifbin227 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gifbin183 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gifbin182 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gifbin193 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gifbin194 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gifbin98 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gifbin135 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gifbin3040 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gifbin190 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gifbin124 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gifbin213 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gifbin531 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gifbin338 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gifbin82 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gifbin358 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/plugin.properties84
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/plugin.xml680
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java25
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java188
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java441
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java19
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java21
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java107
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java98
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties87
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java144
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java187
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java104
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java268
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java105
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java81
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java220
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java64
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java142
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java442
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java42
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java20
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java27
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java285
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java55
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java1273
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java304
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java10
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java139
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java82
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java239
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java259
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java209
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java164
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java173
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java216
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java300
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java134
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java121
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java96
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java104
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java244
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java19
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java66
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java94
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java53
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java179
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java48
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java62
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java110
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java160
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java60
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java67
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java237
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java221
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java114
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java75
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java161
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java79
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java503
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java372
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java60
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java67
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java80
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java47
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java116
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java68
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java74
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java41
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java109
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java66
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java82
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java60
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java69
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java80
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java63
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java141
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java40
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java82
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java29
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java117
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java81
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java38
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java45
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java98
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java70
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java65
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java167
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java122
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java105
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java42
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java58
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java54
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java205
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java77
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java291
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java26
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java196
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java399
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java79
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java5
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java225
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java82
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java20
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java109
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java82
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java26
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java32
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java349
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java18
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java83
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java102
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java26
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java32
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java333
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java216
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java42
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java144
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java43
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java51
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java69
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java38
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java50
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java33
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java28
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java252
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java202
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java269
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java278
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java474
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java132
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java51
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties40
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml23
-rw-r--r--bundles/org.eclipse.wst.html.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.html.core/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.html.core/.options2
-rw-r--r--bundles/org.eclipse.wst.html.core/.project28
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF37
-rw-r--r--bundles/org.eclipse.wst.html.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.html.core/build.properties23
-rw-r--r--bundles/org.eclipse.wst.html.core/component.xml15
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref.properties108
-rw-r--r--bundles/org.eclipse.wst.html.core/data/htmref.xml306
-rw-r--r--bundles/org.eclipse.wst.html.core/plugin.properties14
-rw-r--r--bundles/org.eclipse.wst.html.core/plugin.xml199
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java144
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java86
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java692
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java147
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java150
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java1285
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java114
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java75
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java183
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java93
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java175
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java334
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java72
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java140
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java244
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java881
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java837
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java122
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java24
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java66
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java125
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java35
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java60
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java366
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java76
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java102
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java99
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java96
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java51
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java101
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java94
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java92
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java78
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java84
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java76
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java88
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java122
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java93
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java54
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java30
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java53
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java88
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java33
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java79
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java86
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java66
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java104
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java91
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java41
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java81
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java79
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java46
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java90
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java112
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java28
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java895
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java23
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java360
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java314
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java152
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java112
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java76
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java144
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java174
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java50
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java69
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java251
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java492
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java837
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java118
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java126
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java32
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java369
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java98
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java51
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java59
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java49
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java91
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java71
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java75
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java80
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java84
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java87
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java108
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java30
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java86
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java58
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java63
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java104
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java90
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java65
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java52
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java45
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java43
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java48
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java62
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java57
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java364
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java158
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java194
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java238
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java261
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java109
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java231
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java173
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java1690
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java20
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java187
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java99
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java37
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java96
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java73
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java302
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java257
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java170
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java19
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java130
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java142
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java107
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java356
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java83
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java28
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java301
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java166
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java82
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java165
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java112
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java90
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java376
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java61
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java651
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java109
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java299
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java233
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java105
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java249
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java137
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java115
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java398
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java141
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java77
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java275
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java162
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java248
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java452
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java22
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java33
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java445
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java166
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java55
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java67
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java119
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java201
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java109
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java200
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java29
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java121
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java54
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java54
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java117
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java156
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java47
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java212
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java128
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java68
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java241
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java675
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java116
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java33
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java35
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java35
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java40
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java40
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java21
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java208
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java40
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java200
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java74
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java52
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java44
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java56
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java41
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java78
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java255
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java196
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java70
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java180
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java39
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java42
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java72
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java283
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java132
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java34
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java25
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java36
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java64
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java345
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java21
-rw-r--r--bundles/org.eclipse.wst.html.ui/.classpath8
-rw-r--r--bundles/org.eclipse.wst.html.ui/.cvsignore7
-rw-r--r--bundles/org.eclipse.wst.html.ui/.options1
-rw-r--r--bundles/org.eclipse.wst.html.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs15
-rw-r--r--bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF53
-rw-r--r--bundles/org.eclipse.wst.html.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.html.ui/build.properties23
-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gifbin232 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gifbin352 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gifbin353 -> 0 bytes-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-generic.gifbin98 -> 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-template.gifbin205 -> 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/full/wizban/newhfile_wiz.gifbin3032 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.properties54
-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.xml461
-rw-r--r--bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd109
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java141
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java64
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java47
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java517
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java65
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java44
-rw-r--r--bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java436
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java328
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java126
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java98
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties101
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java160
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java188
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java143
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java40
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java488
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java130
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java164
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java38
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java104
-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/contentoutline/HTMLNodeActionManager.java129
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java50
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java73
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java33
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java32
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java173
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java27
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java28
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java59
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java280
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java282
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java19
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java373
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java51
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java67
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java29
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java162
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java318
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java149
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java32
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java49
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java159
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java60
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java79
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java503
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java89
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java65
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java124
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java128
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java139
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java58
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java329
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java54
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java205
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java291
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java196
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java326
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java66
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java34
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java32
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java22
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java75
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java62
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java28
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java38
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java34
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java50
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java27
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java54
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java244
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java986
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java277
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java57
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java251
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java474
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java131
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java44
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties44
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml28
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.classpath10
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.options66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.project27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs15
-rw-r--r--bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF65
-rw-r--r--bundles/org.eclipse.wst.sse.ui/README.txt2
-rw-r--r--bundles/org.eclipse.wst.sse.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/build.properties30
-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/plugin.properties81
-rw-r--r--bundles/org.eclipse.wst.sse.ui/plugin.xml474
-rw-r--r--bundles/org.eclipse.wst.sse.ui/reexport-info.txt4
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd256
-rw-r--r--bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd191
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java109
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java151
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java50
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java62
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java63
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java373
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java450
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java269
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java353
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/EditorExecutionContext.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java165
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/InformationProvider.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java3349
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java471
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerUndoManager.java200
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/AbstractDropAction.java94
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/CaretMediator.java284
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedConfigurationBuilder.java265
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorActionBuilder.java789
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ExtendedEditorDropTargetAdapter.java351
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FileDropAction.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/FormatProcessorsExtensionReader.java102
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/GotoAnnotationAction.java370
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IActionValidator.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IDropAction.java37
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedContributor.java30
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedEditorAction.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedMarkupEditor.java47
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IExtendedSimpleEditor.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IModelProvider.java21
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IPopupMenuContributor.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/IReleasable.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ISourceViewerActionBarContributor.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ITemporaryAnnotation.java17
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/Logger.java161
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/PreferenceInitializer.java74
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ReadOnlyAwareDropTargetAdapter.java50
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIMessages.java422
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPlugin.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties395
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ShowViewAction.java99
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StorageModelProvider.java681
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredDocumentToTextAdapter.java1332
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredLineChangeHover.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredMarkerAnnotation.java125
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModel.java108
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredResourceMarkerAnnotationModelFactory.java49
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextAnnotationHover.java391
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextLineBreakingReader.java114
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextSelectionChangedEvent.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextViewer.java793
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TextDropAction.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/TransferBuilder.java662
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/UnknownContentTypeDialog.java67
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java377
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActiveEditorActionHandler.java286
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java228
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java75
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java44
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompoundContentAssistProcessor.java422
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java92
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java333
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java28
-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/contentassist/StructuredContentAssistant.java143
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/ConfigurableContentOutlinePage.java707
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapter.java44
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/IJFaceNodeAdapterFactory.java26
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateAction.java80
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java85
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboList.java287
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ComboListOnPropertyPage.java39
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentproperties/ui/ContentSettingsPropertyPage.java297
-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/CorrectionAssistantProvider.java31
-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.java77
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/StructuredCorrectionProcessor.java158
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java304
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java438
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/EditBreakpointAction.java63
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ManageBreakpointAction.java90
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java200
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointsTarget.java189
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTML2TextReader.java304
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/HTMLTextPresenter.java194
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/LineBreakingReader.java124
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SingleCharReader.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/derived/SubstitutionTextReader.java158
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/edit/util/SharedEditorPluginImageHelper.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/EditorModelUtil.java77
-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/IHelpContextIds.java58
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/editor/StructuredModelDocumentProvider.java263
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ActionDescriptor.java378
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/BreakpointProviderBuilder.java405
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxyForDelayLoading.java752
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/IExtendedEditorActionProxyForDelayLoading.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ImageUtil.java84
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/RegistryReader.java176
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/format/StructuredFormattingStrategy.java91
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/HighlighterHyperlinkPresenter.java468
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/hyperlink/OpenHyperlinkAction.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/AbstractOpenOn.java267
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/ExternalFileEditorInput.java116
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/IOpenOn.java46
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenFileHyperlinkTracker.java660
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnAction.java74
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnBuilder.java267
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnDefinition.java157
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/openon/OpenOnProvider.java143
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/EditorPreferenceNames.java86
-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/preferences/ui/AbstractColorPage.java279
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferencePage.java284
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/AbstractPreferenceTab.java266
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorEditor.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorHelper.java147
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/ColorNames.java27
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/EmptyFilePreferencePage.java100
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/FilePreferencePage.java132
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/IPreferenceTab.java29
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StatusInfo.java202
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StructuredTextEditorPreferencePage.java451
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/StyledTextColorPicker.java948
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TextHoverPreferenceTab.java453
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/preferences/ui/TranslucencyPreferenceTab.java149
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/projection/IStructuredTextFoldingProvider.java45
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/AdapterPropertySheetEntryLabelProvider.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ConfigurablePropertySheetPage.java214
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/CustomPropertyDescriptor.java89
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/RemoveAction.java45
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/properties/ShowPropertiesAction.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/preferences/CommonEditorPreferenceNames.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryProvider.java33
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistry.java32
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryExtension.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryImpl.java210
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/registry/AdapterFactoryRegistryReader.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/AbstractLineStyleProvider.java348
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/Highlighter.java906
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/IHighlighter.java34
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProvider.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/LineStyleProviderForNoOp.java48
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java527
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DirtyRegionProcessor.java776
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentAdapter.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/DocumentRegionProcessor.java245
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IConfigurableReconciler.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IReconcileAnnotationKey.java35
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcileStep.java66
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/IStructuredReconcilingStrategy.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/ReconcileAnnotationKey.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java193
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java351
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredTextReconcilingStrategy.java65
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java230
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/AnnotationInfo.java38
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ISourceValidator.java42
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalHelper.java57
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/IncrementalReporter.java111
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ReconcileStepForValidator.java345
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java139
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorMetaData.java241
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java327
-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.java217
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesActionDelegate.java147
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/search/FindOccurrencesProcessor.java121
-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.java184
-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.java140
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/SelectionHistory.java117
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectAction.java110
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructureSelectHistoryAction.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectActionDelegate.java124
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/selection/StructuredSelectHistoryActionDelegate.java83
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/spelling/SpellcheckStrategy.java424
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AbstractHoverProcessor.java83
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/AnnotationHoverProcessor.java204
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/BestMatchHover.java129
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/DebugInfoHoverProcessor.java95
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/ProblemAnnotationHoverProcessor.java51
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/taginfo/TextHoverManager.java243
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/text/DocumentRegionEdgeMatcher.java118
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/OffsetStatusLineContributionItem.java1039
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/ui/StructuredTextAnnotationImageProvider.java56
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Assert.java120
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/EditorUtility.java142
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/PlatformStatusLineUtil.java171
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/RegistryReader.java175
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/util/Sorter.java77
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/CaretEvent.java52
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ICaretListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/INodeSelectionListener.java22
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/ITextSelectionListener.java20
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/NodeSelectionChangedEvent.java43
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/view/events/TextSelectionChangedEvent.java41
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/ContentOutlineConfiguration.java307
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/IPropertySourceExtension.java41
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/PropertySheetConfiguration.java104
-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/.classpath12
-rw-r--r--bundles/org.eclipse.wst.xml.core/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.xml.core/.options2
-rw-r--r--bundles/org.eclipse.wst.xml.core/.project27
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.pde.prefs15
-rw-r--r--bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XML10Names.jFlex100
-rw-r--r--bundles/org.eclipse.wst.xml.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer.jFlex256
-rw-r--r--bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildNames.xml32
-rw-r--r--bundles/org.eclipse.wst.xml.core/DevTimeSupport/buildParser.xml32
-rw-r--r--bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF73
-rw-r--r--bundles/org.eclipse.wst.xml.core/README.txt1
-rw-r--r--bundles/org.eclipse.wst.xml.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.xml.core/build.properties34
-rw-r--r--bundles/org.eclipse.wst.xml.core/component.xml21
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.properties25
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.xml215
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd113
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd286
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/documentFactories.exsd116
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd123
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/modelQueryExtensions.exsd116
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/Catalog.java556
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogContributorRegistryReader.java269
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogElement.java155
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEntry.java73
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogEvent.java47
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogReader.java218
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java65
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogWriter.java231
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/NextCatalog.java59
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/OASISCatalogConstants.java83
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/XMLCatalogURIResolverExtension.java102
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalog.java233
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogElement.java83
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEntry.java71
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogEvent.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/ICatalogListener.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/provisional/INextCatalog.java53
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAnyElement.java24
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMAttributeDeclaration.java52
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMContent.java32
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDataType.java78
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocument.java38
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMDocumentation.java22
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMElementDeclaration.java68
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMEntityDeclaration.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMGroup.java39
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamedNodeMap.java41
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNamespace.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNode.java61
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/CMNodeList.java31
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/ContentModelManager.java80
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/Annotation.java53
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/annotation/AnnotationMap.java101
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAnyElementImpl.java51
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMAttributeDeclarationImpl.java123
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMContentImpl.java46
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDataTypeImpl.java73
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMDocumentImpl.java88
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMElementDeclarationImpl.java121
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMEntityDeclarationImpl.java47
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMGroupImpl.java43
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNamedNodeMapImpl.java91
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeImpl.java46
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/basic/CMNodeListImpl.java77
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactory.java22
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryDescriptor.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistry.java53
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/factory/CMDocumentFactoryRegistryReader.java78
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileInfo.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileParser.java207
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistry.java52
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationFileRegistryReader.java77
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/AnnotationUtility.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/annotation/ResourceBundleHelper.java57
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/InferredGrammarFactory.java156
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionDescriptor.java65
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionManagerImpl.java111
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/modelqueryimpl/ModelQueryExtensionRegistry.java97
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMDataTypeValueHelper.java161
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/CMValidator.java1244
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/internal/util/DOMValidator.java424
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManager.java133
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentManagerListener.java23
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReference.java20
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/CMDocumentReferenceProvider.java27
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQuery.java195
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAction.java36
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryAssociationProvider.java35
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/ModelQueryCMProvider.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtension.java36
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java28
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/BaseAssociationProvider.java88
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentLoader.java214
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentManagerImpl.java282
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/CMDocumentReferenceImpl.java42
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/InferredGrammarBuildingCMDocumentLoader.java189
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryActionHelper.java574
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/ModelQueryImpl.java856
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/SimpleAssociationProvider.java49
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java403
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDescriptionBuilder.java138
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCache.java203
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMDocumentCacheListener.java33
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/CMVisitor.java118
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/ContentBuilder.java171
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilder.java53
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMContentBuilderImpl.java692
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceHelper.java198
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMNamespaceInfoManager.java225
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMVisitor.java133
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/DOMWriter.java411
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/InferredGrammarFactory.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceAttributeVisitor.java94
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceInfo.java83
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/util/NamespaceTable.java251
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java334
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java565
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERendererFactory.java32
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java73
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java50
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java379
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java111
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java20
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java73
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java105
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties0
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java80
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java78
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java217
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java117
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java212
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/ValidatorHelper.java355
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java64
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java190
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationReport.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java664
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java471
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/Helper.java259
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/LazyURLInputStream.java161
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/NestedValidatorContext.java22
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationInfo.java286
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationMessage.java201
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/ValidationReport.java45
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/CommandLineLogger.java32
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/EclipseLogger.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/ILogger.java35
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/logging/LoggerFactory.java100
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java81
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/Validator.java102
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java108
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLValidator.java49
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java72
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java110
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java97
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java72
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java34
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/xmlvalidation.properties35
-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/internal/DebugAdapterFactory.java77
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/EveryNodeDebugAdapter.java284
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/IDebugAdapter.java19
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/Logger.java157
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCoreMessages.java42
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java80
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePluginResources.properties26
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/CleanupProcessorXML.java88
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/ElementNodeCleanupHandler.java557
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/NodeCleanupHandler.java63
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/cleanup/XMLCleanupPreferencesImpl.java142
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementAdapter.java103
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/CommentElementHandler.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/BasicCommentElementHandler.java135
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementConfiguration.java223
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/impl/CommentElementRegistry.java84
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/CommentElementFactory.java65
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/commentelement/util/TagScanner.java196
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/AbstractResourceEncodingDetector.java258
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ByteReader.java108
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/ContentDescriberForXML.java264
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/EncodingParserConstants.java30
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/IntStack.java99
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/NullMemento.java37
-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.java1033
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizerConstants.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLResourceEncodingDetector.java144
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java748
-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.java352
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CommentImpl.java197
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DOMModelImpl.java915
-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.java1169
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapter.java51
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentTypeAdapterImpl.java119
-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.java1466
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java241
-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/InvalidCharacterException.java67
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/JSPTag.java34
-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.java925
-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.java343
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/SourceValidator.java346
-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.java435
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionManagementException.java33
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionProxy.java369
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/StructuredDocumentRegionUtil.java166
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TagAdapter.java35
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/TextImpl.java1176
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLGeneratorImpl.java735
-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/XMLModelNotifier.java139
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelNotifierImpl.java496
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelParser.java2369
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/XMLModelUpdater.java1700
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentCharsetDetector.java37
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/encoding/XMLDocumentLoader.java82
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/EmbeddedXML.java98
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/ModelHandlerForXML.java59
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelhandler/XMLModelLoader.java93
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedXML.java50
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryAdapterFactoryForXML.java217
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/ModelQueryUtil.java64
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java92
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryAssociationProvider.java60
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLModelQueryImpl.java38
-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.java310
-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.java592
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java621
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLStructuredDocumentReParser.java124
-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.java1881
-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.java165
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/AttributeValueRegion.java162
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/GenericTemplateRegion.java102
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/RegionToStringUtil.java29
-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.java89
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagNameRegion.java93
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/TagOpenRegion.java94
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/WhiteSpaceOnlyRegion.java188
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLCDataTextRegion.java175
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLContentRegion.java175
-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.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/XMLParserRegionFactory.java97
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java57
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java165
-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.java144
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLCharEntity.java39
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLNamespace.java26
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/IXMLPreferenceNames.java55
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/NameValidator.java60
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocumentTracker.java32
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMNodeWrapper.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/ContentModelAdapter.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/NullContentModel.java101
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contenttype/ContentTypeIdForXML.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMAttr.java128
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocument.java100
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMDocumentType.java43
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMElement.java196
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMEntity.java33
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMImplementation.java48
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMModel.java59
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMNode.java272
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/IDOMText.java129
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/document/ISourceGenerator.java201
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/CommentNodeFormatter.java99
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/DocumentNodeFormatter.java55
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/ElementNodeFormatter.java384
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java109
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/IStructuredFormatPreferencesXML.java21
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java840
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java27
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java239
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java32
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/regions/DOMRegionContext.java69
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapter.java31
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/ModelQueryAdapterImpl.java76
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/ssemodelquery/MovableModelQuery.java23
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/tasks/XMLFileTaskScanner.java28
-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/text/rules/StructuredTextPartitionerForXML.java132
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/AbstractPropagatingValidator.java43
-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/text/IXMLPartitions.java32
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.classpath11
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.cvsignore10
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.options1
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.project27
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.pde.prefs15
-rw-r--r--bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF60
-rw-r--r--bundles/org.eclipse.wst.xml.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.xml.ui/build.properties30
-rw-r--r--bundles/org.eclipse.wst.xml.ui/examples/EditingAndValidatingXML.zipbin13213 -> 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-deemphasized.gifbin853 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag-generic-emphasized.gifbin863 -> 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.properties70
-rw-r--r--bundles/org.eclipse.wst.xml.ui/plugin.xml486
-rw-r--r--bundles/org.eclipse.wst.xml.ui/schema/catalogFileType.exsd120
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/AdvancedOptionsDialog.java255
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java89
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java969
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ElementNodePage.java38
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/ImageFactory.java205
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/URIUtils.java44
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java306
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java121
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java57
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java135
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java269
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties111
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java261
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java92
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/catalogEntry.gifbin1736 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/etool50/nextCatalog.gifbin1701 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/entry_obj.gifbin3213 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_expand.gifbin323 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/file_obj.gifbin561 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/nextCatalog_obj.gifbin608 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/obj16/xmlcatalog_obj.gifbin598 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/icons/ovr16/error-overlay.gifbin82 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/DOMPropertyDescriptorFactory.java133
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java23
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java19
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java210
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourcePageActionContributor.java62
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java470
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java553
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java63
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java32
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java50
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java152
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImages.java27
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorResources.properties30
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorActionBarContributor.java88
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java796
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeActionBarContributor.java319
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeContentProvider.java314
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeHelpContextIds.java31
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreePropertyDescriptorFactory.java116
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java261
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java167
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/XMLValidationUIMessages.java41
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorActionDelegate.java160
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java285
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java131
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java182
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/xmlvalidation.properties29
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationOperation.java205
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java231
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java109
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/IXMLWizardHelpContextIds.java48
-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.java352
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java382
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java842
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java86
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java68
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java43
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java83
-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/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties80
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java257
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java193
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java159
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java312
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java116
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties320
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java115
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java676
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java204
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java82
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java514
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java136
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java197
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java82
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java189
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditElementAction.java119
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditProcessingInstructionAction.java96
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java166
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java145
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/NodeAction.java50
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/RemoveBlockCommentActionXMLDelegate.java86
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ReplacePrefixAction.java84
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java170
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java187
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java143
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java2332
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java86
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java113
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java120
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java208
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java256
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java65
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/CustomTemplateProposal.java40
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NoRegionContentAssistProcessor.java262
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/NonValidatingModelQueryAction.java159
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ProposalComparator.java48
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java104
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SimpleCMElementDeclaration.java170
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/SourceEditorImageHelper.java48
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistProcessor.java157
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java490
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java135
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLRelevanceConstants.java52
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLTemplateCompletionProcessor.java167
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java246
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapterFactory.java173
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeContentProvider.java114
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java74
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java248
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java52
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java48
-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.java179
-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.java147
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java161
-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.java109
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java170
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java234
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java143
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java71
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java255
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java119
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditSchemaInfoDialog.java80
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoErrorHelper.java99
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java391
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdDialog.java87
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectFileOrXMLCatalogIdPanel.java180
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java112
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java150
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/UpdateListener.java20
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/XMLCatalogTableViewer.java198
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java289
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/XMLDragAndDropManager.java54
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/doubleclick/XMLDoubleClickStrategy.java285
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java98
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java45
-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.java55
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileEditorInput.java158
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java60
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java79
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java503
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java265
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java210
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java319
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesTargetFieldDialog.java104
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonNamespaceInfoTable.java340
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java356
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java137
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java223
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java306
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java353
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java67
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java105
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java85
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionAnnotationModelChanges.java54
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterFactoryXML.java157
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionModelNodeAdapterXML.java296
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionViewerInformation.java196
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java324
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java69
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java111
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java738
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/IDOMSourceEditingTextTools.java68
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/provisional/XMLSourceEditingTextTools.java176
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java88
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesActionDelegate.java34
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesProcessor.java31
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectEnclosingXMLActionDelegate.java70
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java105
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java85
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java41
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java170
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java174
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java66
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java337
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/EncodingTemplateVariableResolverXML.java38
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeIdsXML.java50
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/templates/TemplateContextTypeXML.java35
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/text/XMLDocumentRegionEdgeMatcher.java25
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/SharedXMLEditorPluginImageHelper.java72
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonResources.java93
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/util/XMLCommonUIContextIds.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidator.java566
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java62
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java649
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java521
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java257
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties18
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml7
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.classpath9
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.cvsignore6
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.project28
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs59
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF25
-rw-r--r--bundles/org.eclipse.wst.xsd.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsd.core/build.properties22
-rw-r--r--bundles/org.eclipse.wst.xsd.core/plugin.properties22
-rw-r--r--bundles/org.eclipse.wst.xsd.core/plugin.xml66
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java45
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMNodeImpl.java41
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDCMManager.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java2861
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDTypeUtil.java121
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDVisitor.java190
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorAdapterFactory.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/util/XSDSchemaLocatorImpl.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationConfiguration.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidationMessages.java32
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java237
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java119
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDDelegatingValidator.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDMessageInfoHelper.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/XSDValidator.java48
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/xsdvalidation.properties12
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/XSDCorePlugin.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceInitializer.java34
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.classpath36
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/build.properties25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/component.xml7
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/XSDFile.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/blank.gifbin832 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/browsebutton.gifbin825 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/collapse_attr.gifbin854 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/delete_obj.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/schemaview_co.gifbin336 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dlcl16/showproperties_obj.gifbin577 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dtool16/help_contents.gifbin253 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/dtool16/showproperties_obj.gifbin577 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/elcl16/schemaview_co.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/elcl16/showproperties_obj.gifbin577 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/help_contents.gifbin259 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/etool16/showproperties_obj.gifbin577 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/expand_attr.gifbin856 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/filter.gifbin219 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnyAttributedis.gifbin358 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAnydis.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroup.gifbin215 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRef.gifbin327 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupRefdis.gifbin212 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeGroupdis.gifbin209 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributeRefdis.gifbin233 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDAttributedis.gifbin164 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexContent.gifbin348 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexType.gifbin345 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDComplexTypedis.gifbin229 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementRefdis.gifbin349 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDElementdis.gifbin223 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroup.gifbin327 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRef.gifbin331 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupRefdis.gifbin215 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDGroupdis.gifbin209 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/XSDSimpleContent.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/all_obj.gifbin116 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/alldis_obj.gifbin73 -> 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.gifbin369 -> 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/choice_obj.gifbin130 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/choicedis_obj.gifbin97 -> 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/error_marker.gifbin292 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsn_obj.gifbin185 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/extnsndis_obj.gifbin130 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/groupsheader.gifbin372 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/index.gifbin1109 -> 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/sequence_obj.gifbin120 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/sequencedis_obj.gifbin91 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletype_obj.gifbin149 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/simpletypedis_obj.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_list_obj.gifbin350 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_listdis_obj.gifbin224 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrict_obj.gifbin231 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_restrictdis_obj.gifbin213 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_union_obj.gifbin243 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/obj16/smpl_uniondis_obj.gifbin230 -> 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/extnsn_ovr.gifbin111 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/icons/ovr16/extnsndis_ovr.gifbin111 -> 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.properties848
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/plugin.xml451
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/TypeVizEditorMode.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/BoxFigure.java103
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/CompartmentFigure.java188
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/FieldFigure.java253
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/HeadingFigure.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/RoundedLineBorder.java66
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/StructureFigure.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/figures/TypeVizFigureFactory.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/ColumnData.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd-typeviz/org/eclipse/wst/xsd/ui/internal/adt/typeviz/design/layouts/RowLayout.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/CreateElementAction.java360
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/DOMAttribute.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/IXSDToolbarAction.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAction.java149
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/MoveAttributeAction.java245
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/actions/XSDEditNamespacesAction.java286
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/CategoryAdapter.java175
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAdapterFactory.java142
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeDeclarationAdapter.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeGroupDefinitionAdapter.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAttributeUseAdapter.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAdapter.java199
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDBaseAttributeAdapter.java208
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDChildUtility.java280
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java418
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDElementDeclarationAdapter.java295
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDEmptyFieldAdapter.java120
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupAdapter.java231
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDModelGroupDefinitionAdapter.java228
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDParticleAdapter.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaAdapter.java503
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSchemaDirectiveAdapter.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java151
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDTypeDefinitionAdapter.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitor.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDVisitorForFields.java177
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDWildcardAdapter.java227
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/commands/DragAndDropCommand.java505
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/AttributeGroupDefinitionEditPart.java109
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/CategoryEditPart.java223
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ConnectableEditPart.java207
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupDefinitionReferenceEditPart.java117
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ModelGroupEditPart.java224
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/ReferenceConnection.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/SpaceFillerForFieldEditPart.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TargetConnectionSpacingFigureEditPart.java41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/TopLevelComponentEditPart.java375
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDAttributesForAnnotationEditPart.java59
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDBaseFieldEditPart.java99
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDEditPartFactory.java160
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDGroupsForAnnotationEditPart.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDModelGroupRouter.java379
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSchemaEditPart.java333
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/XSDSimpleTypeEditPart.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/TargetConnectionSpaceFiller.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/DragAndDropEditPolicy.java45
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/GraphNodeDragTracker.java33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/SelectionHandlesEditPolicyImpl.java237
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelComponentLabelCellEditorLocator.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editpolicies/TopLevelNameDirectEditManager.java171
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CategoryFigure.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/CenteredIconFigure.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/GenericGroupFigure.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/HyperLinkLabel.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IExtendedFigureFactory.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/IModelGroupFigure.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/ModelGroupFigure.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/figures/SpacingFigure.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ContainerLayout.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/FillLayout.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/layouts/ModelGroupLayout.java197
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/BuiltInTypesTreeViewerProvider.java221
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewComponentDialog.java196
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementButtonHandler.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewElementDialog.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeButtonHandler.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/NewTypeDialog.java209
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/dialogs/SelectBuiltInTypesForFilteringDialog.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java267
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java1028
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java112
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java125
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java134
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java192
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java460
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java370
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java131
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java104
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java151
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java301
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java254
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java141
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java190
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gifbin806 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gifbin605 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gifbin609 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gifbin860 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.gifbin3261 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gifbin54 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gifbin92 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gifbin88 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gifbin613 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gifbin384 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gifbin121 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gifbin235 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gifbin350 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gifbin211 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gifbin155 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gifbin594 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gifbin368 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gifbin585 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gifbin101 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gifbin227 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gifbin361 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gifbin899 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gifbin114 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gifbin324 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gifbin323 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gifbin558 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gifbin115 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gifbin373 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gifbin136 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gifbin91 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gifbin105 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gifbin120 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gifbin141 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gifbin150 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gifbin150 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gifbin138 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gifbin210 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gifbin323 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gifbin583 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gifbin873 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gifbin825 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gifbin339 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gifbin874 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gifbin612 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gifbin225 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.gifbin3241 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gifbin159 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gifbin598 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties113
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java189
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java124
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java234
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/DesignViewNavigationLocation.java334
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/navigation/MultiPageEditorTextSelectionNavigationLocation.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/SchemaPrefixChangeHandler.java208
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/TargetNamespaceChangeHandler.java152
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/nsedit/XSDVisitor.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/preferences/XSDPreferencePage.java298
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelAdapter.java193
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelQueryExtension.java220
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/text/XSDModelReconcileAdapter.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/DocumentAdapter.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ModelReconcileAdapter.java147
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/SelectionAdapter.java83
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/TypesHelper.java403
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/ViewUtility.java246
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDDOMHelper.java456
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverAdapterFactory.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/util/XSDSchemaLocationResolverImpl.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/utils/OpenOnSelectionHelper.java346
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/validation/DelegatingSourceValidatorForXSD.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/EnumerationsDialog.java111
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/TypeSection.java335
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/widgets/XSDEditSchemaInfoDialog.java176
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/NewXSDWizard.java172
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexCompositionPage.java947
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexNode.java421
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexTestingPage.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/RegexWizard.java68
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDLocationChoicePage.java69
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDNewFilePage.java129
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/wizards/XSDSelectIncludeFileWizard.java371
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/AddFieldAction.java77
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseDirectEditAction.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/BaseSelectionAction.java127
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java77
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/ShowPropertiesViewAction.java56
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java149
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewContextMenuProvider.java161
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java300
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewerGraphicConstants.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/FlatCCombo.java1493
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IAnnotationProvider.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/IKeyboardDrag.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/ImageOverlayDescriptor.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ADTComboBoxCellEditor.java367
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ComboBoxCellEditorManager.java224
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/ElementReferenceDirectEditManager.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelCellEditorLocator.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/LabelEditManager.java132
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/directedit/TypeReferenceDirectEditManager.java187
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ADTEditPartFactory.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BackToSchemaEditPart.java134
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseEditPart.java201
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseFieldEditPart.java449
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BaseTypeConnectingEditPart.java183
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/BoxEditPart.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CenteredConnectionAnchor.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ColumnEditPart.java112
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/CompartmentEditPart.java213
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/EditPartNavigationHandlerUtil.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/FieldEditPart.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/IConnectionContainer.java6
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/INamedEditPart.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootEditPart.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/StructureEditPart.java223
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java102
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TypeReferenceConnection.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/AbstractModelCollection.java65
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Annotation.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/Compartment.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/FocusTypeColumn.java47
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IActionProvider.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IFeedbackHandler.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IGraphElement.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/IModelProxy.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/model/ReferencedTypeColumn.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTDirectEditPolicy.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/ADTSelectionFeedbackEditPolicy.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/DirectEditPolicyDelegate.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/IADTUpdateCommand.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/KeyBoardAccessibilityEditPolicy.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editpolicies/SimpleDirectEditPolicy.java58
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IADTFigure.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/ICompartmentFigure.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFieldFigure.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IFigureFactory.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/figures/IStructureFigure.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/ComponentReferenceEditManager.java26
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/edit/IComponentDialog.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ADTMultiPageEditor.java256
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonMultiPageEditor.java736
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/CommonSelectionManager.java111
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ContextMenuParticipant.java15
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorMode.java27
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/EditorModeManager.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/IEditorModeListener.java6
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/Messages.java41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/ProductCustomizationProvider.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/editor/messages.properties24
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObject.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IADTObjectListener.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java34
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IModel.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IStructure.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlinePage.java217
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTContentOutlineProvider.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ADTLabelProvider.java79
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/outline/ITreeElement.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/properties/ADTTabbedPropertySheetPage.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyAttributeAction.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAnyElementAction.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeDeclarationAction.java105
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDAttributeGroupDefinitionAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDComplexTypeDefinitionAction.java52
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDElementAction.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupAction.java95
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDModelGroupDefinitionAction.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSchemaDirectiveAction.java75
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/AddXSDSimpleTypeDefinitionAction.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/DeleteXSDConcreteComponentAction.java53
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java166
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetMultiplicityAction.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/SetTypeAction.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/XSDBaseAction.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddDocumentationCommand.java132
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddEnumerationsCommand.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensibilityElementCommand.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionAttributeCommand.java110
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionCommand.java48
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddExtensionElementCommand.java152
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyAttributeCommand.java64
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAnyElementCommand.java45
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeDeclarationCommand.java176
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDAttributeGroupDefinitionCommand.java159
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDComplexTypeDefinitionCommand.java122
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDElementCommand.java340
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDImportCommand.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDIncludeCommand.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupCommand.java151
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDModelGroupDefinitionCommand.java116
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDRedefineCommand.java44
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSchemaDirectiveCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/AddXSDSimpleTypeDefinitionCommand.java91
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/BaseCommand.java196
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ChangeToLocalSimpleTypeCommand.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java164
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleAddExtensionCommand.java214
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/ExtensibleRemoveExtensionNodeCommand.java94
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionAttributerCommand.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionElementCommand.java46
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/RemoveExtensionNodeCommand.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeAndManagerDirectivesCommand.java37
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetBaseTypeCommand.java85
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetMultiplicityCommand.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetTypeCommand.java116
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/SetXSDFacetValueCommand.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateAttributeValueCommand.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComplexTypeDerivationBy.java51
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateComponentReferenceAndManageDirectivesCommand.java150
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateContentModelCommand.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceAndManageDirectivesCommand.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateElementReferenceCommand.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMaxOccursCommand.java65
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateMinOccursCommand.java92
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNameCommand.java90
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNamespaceInformationCommand.java298
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateNumericBoundsFacetCommand.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateStringLengthFacetCommand.java230
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTextValueCommand.java61
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceAndManageDirectivesCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateTypeReferenceCommand.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDPatternFacetCommand.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/UpdateXSDWhiteSpaceFacetCommand.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/providers/XSDSectionLabelProvider.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractExtensionsSection.java609
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSection.java365
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AbstractSectionDescriptor.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/AnnotationSection.java162
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/CommonDirectivesSection.java156
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/EnumerationsSection.java405
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/ExtensionsSection.java294
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/FacetViewer.java559
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/IDocumentChangedNotifier.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/MultiplicitySection.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/RefactoringSection.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SchemaLocationSection.java207
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SimpleContentUnionMemberTypesDialog.java312
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/SpecificConstraintsWidget.java692
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDActionManager.java148
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAnyElementContentsSection.java251
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeDeclarationSection.java399
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDAttributeGroupDefinitionSection.java284
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeAdvancedSection.java221
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDComplexTypeSection.java357
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationAdvancedSection.java367
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDElementDeclarationSection.java583
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSection.java979
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDFacetSectionFilter.java42
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDImportSection.java376
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupDefinitionSection.java334
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDModelGroupSection.java163
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSchemaSection.java312
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDSimpleTypeSection.java752
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/XSDTableTreeViewer.java126
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddExtensionsComponentDialog.java784
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/AddNewCategoryDialog.java385
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/CategoryProvider.java81
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionDetailsContentProvider.java201
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItem.java216
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemEditManager.java40
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionItemMenuListener.java117
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeContentProvider.java73
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/DOMExtensionTreeLabelProvider.java80
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsContentProvider.java9
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionDetailsViewer.java326
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItem.java21
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemEditManager.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionItemFilter.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/ExtensionsSchemasRegistry.java361
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SelectFromCatalogDialog.java212
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/SpecificationForExtensionsSchema.java219
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/XSDExtensionTreeContentProvider.java109
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DefaultListNodeEditorConfiguration.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/DialogNodeEditorConfiguration.java23
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/ListNodeEditorConfiguration.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeCustomizationRegistry.java157
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorConfiguration.java33
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeEditorProvider.java8
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/properties/sections/appinfo/custom/NodeFilter.java11
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/Messages.java113
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/XSDCommonUIUtils.java520
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/util/messages.properties96
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/Checks.java38
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/INameUpdating.java25
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/IReferenceUpdating.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/PerformUnsavedRefactoringOperation.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringComponent.java62
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java49
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/TextChangeManager.java115
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/XMLRefactoringComponent.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java158
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java76
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java118
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java156
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameTargetNamespaceAction.java78
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java195
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorActionGroup.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java50
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDSelectionDispatchAction.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties41
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameArguments.java52
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java501
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java174
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameTargetNamespaceProcessor.java419
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java108
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java296
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/SortingSearchRequestor.java87
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XMLComponentRenameParticipant.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/rename/XSDComponentRenameParticipant.java43
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/AbstractCommand.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeAnonymousTypeGlobalCommand.java84
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeLocalElementGlobalCommand.java98
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java168
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java220
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/util/TextChangeCompatibility.java97
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorActionGroup.java215
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupActionDelegate.java146
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactorGroupSubMenu.java57
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RefactoringWizardMessages.java70
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameInputWizardPage.java257
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/RenameRefactoringWizard.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/wizard/messages.properties55
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/IXSDSearchConstants.java29
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/SearchMessages.java31
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchContributor.java93
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchParticipant.java51
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/XSDSearchQuery.java54
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/BaseGroupActionDelegate.java146
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/CompositeActionGroup.java99
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/DeclarationsSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindAction.java30
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesAction.java149
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInProjectAction.java45
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/FindReferencesInWorkingSetAction.java88
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ImplementorsSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/OccurrencesSearchGroup.java17
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/ReferencesSearchGroup.java179
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/SearchGroup.java20
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchActionGroup.java35
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchDeclarationsGroupActionDelegate.java22
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchGroupSubMenu.java72
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src-search/org/eclipse/wst/xsd/ui/internal/search/actions/XSDSearchReferencesGroupActionDelegate.java46
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/.project17
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/build.properties5
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/buildnotes_org.eclipse.wst.web_core.feature.patch.html19
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/eclipse_update_120.jpgbin21695 -> 0 bytes-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/epl-v10.html328
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/feature.properties154
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/feature.xml31
-rw-r--r--features/org.eclipse.wst.web_core.feature.patch/license.html93
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/.project17
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/build.properties5
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/buildnotes_org.eclipse.wst.xml_ui.feature.patch.html23
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/eclipse_update_120.jpgbin21695 -> 0 bytes-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/epl-v10.html328
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/feature.properties156
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/feature.xml45
-rw-r--r--features/org.eclipse.wst.xml_ui.feature.patch/license.html93
2063 files changed, 0 insertions, 272807 deletions
diff --git a/bundles/org.eclipse.jst.jsp.ui/.classpath b/bundles/org.eclipse.jst.jsp.ui/.classpath
deleted file mode 100644
index cb0105380b..0000000000
--- a/bundles/org.eclipse.jst.jsp.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.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.jst.jsp.ui/.cvsignore b/bundles/org.eclipse.jst.jsp.ui/.cvsignore
deleted file mode 100644
index d00c268006..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-jspeditor.jar
-temp.folder
-org.eclipse.jst.jsp.ui_6.0.0.jar
-build.xml
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.jst.jsp.ui/.options b/bundles/org.eclipse.jst.jsp.ui/.options
deleted file mode 100644
index 7174d6096c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.jst.jsp.ui/debug/jspcontentassist=false
-org.eclipse.jst.jsp.ui/projectionperf=false \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/.project b/bundles/org.eclipse.jst.jsp.ui/.project
deleted file mode 100644
index 2d42e46796..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsp.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.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4e75d340f1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:49 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 782e417e41..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 17:23:39 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=ignore
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index a2b5427133..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,65 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jst.jsp.ui; singleton:=true
-Bundle-Version: 1.1.104.qualifier
-Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.jsp.ui,
- org.eclipse.jst.jsp.ui.internal;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.autoedit;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.breakpointproviders;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.contentassist;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.derived;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.editor;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.format;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.hyperlink;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.java.refactoring;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.java.search;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.java.search.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.preferences;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.projection;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.registry;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.style;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.style.java;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.style.jspel;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.taginfo;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.templates;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.text;x-internal:=true,
- org.eclipse.jst.jsp.ui.internal.wizard;x-internal:=true,
- org.eclipse.jst.jsp.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.editors;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.0.101,1.1.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jdt.ui;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.debug.core;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jdt.debug;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.search;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ltk.ui.refactoring;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.ui.ide;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.javascript.ui;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.ui.views;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,1.2.0)",
- com.ibm.icu;bundle-version="[3.4.4,3.5.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,1.2.0)"
-Eclipse-LazyStart: true
diff --git a/bundles/org.eclipse.jst.jsp.ui/about.html b/bundles/org.eclipse.jst.jsp.ui/about.html
deleted file mode 100644
index 4ec5989581..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 2, 2006</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.jst.jsp.ui/build.properties b/bundles/org.eclipse.jst.jsp.ui/build.properties
deleted file mode 100644
index 6b33ae3a68..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/build.properties
+++ /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
-###############################################################################
-source.. = src/
-bin.includes = .,\
- templates/,\
- plugin.xml,\
- META-INF/,\
- icons/,\
- plugin.properties,\
- about.html
-bin.excludes = @dot/**,\
- temp.folder/**
-src.includes = build.properties
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif
deleted file mode 100644
index 5ff9b3973d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif
deleted file mode 100644
index 14944ace0e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif
deleted file mode 100644
index c00118d098..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif
deleted file mode 100644
index 49a14611e8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/default_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif
deleted file mode 100644
index 6929d3d13f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_default_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif
deleted file mode 100644
index 1fe064e6ca..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_private_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif
deleted file mode 100644
index 3377b1ebe7..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_protected_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif
deleted file mode 100644
index d4cb4254d9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/field_public_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif
deleted file mode 100644
index 4244a7f39d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_default_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif
deleted file mode 100644
index 7392f191d8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_private_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif
deleted file mode 100644
index 5105577d5b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_protected_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif
deleted file mode 100644
index e4c2a836f8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerclass_public_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif
deleted file mode 100644
index ab1b576aad..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_default_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif
deleted file mode 100644
index a1cbff36f6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_private_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif
deleted file mode 100644
index f58eef07c1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_protected_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif
deleted file mode 100644
index 2ebc46e1d3..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/innerinterface_public_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif
deleted file mode 100644
index 8adce9541f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/localvariable_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif
deleted file mode 100644
index 131c28da40..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/package_obj.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif
deleted file mode 100644
index 5b881d8b2b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/private_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif
deleted file mode 100644
index cd83b96c20..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/protected_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif
deleted file mode 100644
index 7d24707ee8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif
deleted file mode 100644
index a9af5d538d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/public_co.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif
deleted file mode 100644
index 65f516e80a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-generic.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif
deleted file mode 100644
index 4084602119..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-jsp.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif
deleted file mode 100644
index 5d1f81b6d4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/tag-template.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gif b/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gif
deleted file mode 100644
index 972597bce9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif
deleted file mode 100644
index 35f48efff8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspdecl.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif
deleted file mode 100644
index ab4d74bcb1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspexp.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif
deleted file mode 100644
index 2584c31853..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspincl.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif
deleted file mode 100644
index 1753b96272..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jspscr.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif
deleted file mode 100644
index cb55e33b5e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/jsptaglib.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif
deleted file mode 100644
index 5e7fb33399..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-generic.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif b/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif
deleted file mode 100644
index ea4de338fb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/snippets/tag-jsp.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.properties b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
deleted file mode 100644
index 310de731eb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ /dev/null
@@ -1,84 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-providerName=Eclipse.org
-pluginName=SSE JSP Source Editor
-JSP_Source_Page_Editor.name=JSP Editor
-CSS_JSP_Source_Page_Editor.name=CSS JSP Editor
-JSP_Files.name=JSP Files
-JSP_Source.name=JSP Source
-JSP_Templates.name=JSP Templates
-JSP_Styles.name=JSP Styles
-
-# Snippets contributions for helping with JSP syntax
-jsp_scriptlet=<%..%> scriptlet
-jsp_scr_content=<% %>
-jsp_hidden_comment=<%--..--%> comment
-jsp_hidden_comment_content=<%-- --%>
-jsp_declaration=<%!..%> declaration
-jsp_declaration_content=<%! %>
-jsp_expression=<%=..%> expression
-jsp_expression_content=<%= %>
-jsp_include_directive=include directive
-jsp_include_directive_content=<%@ include file="" %>
-jsp_page_directive=page directive
-jsp_page_directive_content=<%@ page contentType="text/html; charset=" %>
-jsp_taglib_directive=taglib directive
-jsp_taglib_directive_content=<%@ taglib uri="${uri}" prefix="${prefix}" %>
-jsp_taglib_directive_uri=URI to the containing JAR file or taglib descriptor (.tld)
-jsp_taglib_directive_prefix=Namespace prefix for tags from this library
-JSPFragmentContentSettings.name=JSP Fragment
-command.jsp.refactor.rename.name=Rename
-command.jsp.refactor.rename.description=Rename a Java Element
-command.jsp.refactor.move.name=Move
-command.jsp.refactor.move.description=Move a Java Element to another package
-scope.structured.text.editor.jsp.name=Editing JSP Source
-scope.structured.text.editor.jsp.description=Editing JSP Source
-JSP_Type_Rename_Participant_Extension_Element.name=JSP Type Rename Participant
-JSP_Method_Rename_Participant_Extension_Element.name=JSP Method Rename Participant
-JSP_Package_Rename_Participant_Extension_Element.name=JSP Package Rename Participant
-JSP_Type_Move_Participant_Extension_Element.name=JSP Type Move Participant
-All_JSP_context_type_Extension_Element.name=All JSP
-JSP_New_context_type_Extension_Element.name=New JSP
-JSP_Tag_context_type_Extension_Element.name=JSP Tag
-JSP_Attribute_context_type_Extension_Element.name=JSP Attribute
-JSP_Attribute_value_context_type_Extension_Element.name=JSP Attribute value
-JSP_Query_Participant_Extension_Element.name=JSP Query Participant
-JSP_Extension_Element.label=JSP
-#org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = JSP
-_UI_WIZARD_CREATE_NEW_FILE = Create a new JavaServer Page
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-## EL Error Message
-##
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-ToggleComment_label=Toggle Comment
-ToggleComment_tooltip=Toggle Comment
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-RenameElement_label=Rename
-MoveElement_label=Move
-StructureSelectEnclosing_label=Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectNext_label=Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectPrevious_label=Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectHistory_label=Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
deleted file mode 100644
index 95a4d97086..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ /dev/null
@@ -1,680 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%JSP_Source_Page_Editor.name"
- icon="$nl$/icons//full/obj16/sourceEditor.gif"
- extensions="jsp, jsf, jspf, jspx, tag, tagf"
- contributorClass="org.eclipse.jst.jsp.ui.internal.editor.ActionContributorJSP"
- class="org.eclipse.wst.sse.ui.StructuredTextEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.jst.jsp.core.jspsource.source">
- <contentTypeBinding
- contentTypeId="org.eclipse.jst.jsp.core.jspsource" />
- </editor>
- <editor
- name="%CSS_JSP_Source_Page_Editor.name"
- icon="$nl$/icons//full/obj16/sourceEditor.gif"
- contributorClass="org.eclipse.jst.jsp.ui.internal.editor.ActionContributorJSP"
- class="org.eclipse.wst.sse.ui.StructuredTextEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.jst.jsp.core.cssjspsource.source">
- <contentTypeBinding
- contentTypeId="org.eclipse.jst.jsp.core.cssjspsource" />
- <contentTypeBinding
- contentTypeId="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
- </editor>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <contentOutlineConfiguration
- class="org.eclipse.jst.jsp.ui.views.contentoutline.JSPContentOutlineConfiguration"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <propertySheetConfiguration
- class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalConfiguration
- type="sourceeditingtexttools"
- class="org.eclipse.jst.jsp.ui.internal.editor.JSPSourceEditingTextTools"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.jst.jsp.ui.internal.text.JSPDocumentRegionEdgeMatcher"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalConfiguration
- type="structuredtextfoldingprovider"
- class="org.eclipse.jst.jsp.ui.internal.projection.StructuredTextFoldingProviderJSP"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.sse.ui.preferences.jsp, org.eclipse.wst.sse.ui.preferences.jsp.source, org.eclipse.wst.sse.ui.preferences.jsp.templates, org.eclipse.wst.sse.ui.preferences.jsp.styles"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalDefinition
- type="showintarget"
- value="org.eclipse.jdt.ui.PackageExplorer"
- target="org.eclipse.jst.jsp.core.jspsource" />
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.xml.ui.internal.validation.MarkupValidator"
- id="org.eclipse.jst.jsp.ui.internal.validation.markupvalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- <validator
- scope="total"
- class="org.eclipse.wst.html.internal.validation.HTMLValidator"
- id="org.eclipse.jst.jsp.ui.internal.validation.htmlsyntaxvalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE"/>
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- <validator
- scope="total"
- class="org.eclipse.jst.jsp.ui.internal.validation.JSPActionSourceValidator"
- id="org.eclipse.jst.jsp.ui.internal.validation.jspactionvalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
- </partitionType>
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.jst.jsp.ui.internal.registry.AdapterFactoryProviderForJSP">
- <contentType id="org.eclipse.jst.jsp.core.jspsource" />
- </adapterFactoryDescription>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.jst.jsp.core.jspsource"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages">
-
- <!--======================================================================================-->
- <!-- JSP PREFERENCE PAGES -->
- <!--======================================================================================-->
- <page
- name="%JSP_Files.name"
- category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPFilesPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.jsp" />
-
- <page
- name="%JSP_Source.name"
- category="org.eclipse.wst.sse.ui.preferences.jsp"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSourcePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.source" />
-
- <page
- name="%JSP_Templates.name"
- category="org.eclipse.wst.sse.ui.preferences.jsp"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPTemplatePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.templates" />
-
- <page
- name="%JSP_Styles.name"
- category="org.eclipse.wst.sse.ui.preferences.jsp"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPColorPage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.styles" />
-
- </extension>
-
- <!--======================================================================================-->
- <!-- FOR JSP/JAVA RENAME PARTICIPATION -->
- <!--======================================================================================-->
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <renameParticipant
- name="%JSP_Type_Rename_Participant_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPTypeRenameParticipant"
- id="org.eclipse.jst.jsp.ui.java.refactoring.JSPTypeRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.jdt.core.javanature" />
-
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IType" />
-
- </with>
- </enablement>
- </renameParticipant>
-
- <renameParticipant
- name="%JSP_Method_Rename_Participant_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMethodRenameParticipant"
- id="org.eclipse.jst.jsp.ui.java.refactoring.JSPMethodRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.jdt.core.javanature" />
-
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IMethod" />
-
- </with>
- </enablement>
- </renameParticipant>
-
- <renameParticipant
- name="%JSP_Package_Rename_Participant_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPPackageRenameParticipant"
- id="org.eclipse.jst.jsp.ui.java.refactoring.JSPPackageRenameParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.jdt.core.javanature" />
-
- </iterate>
- </with>
- <with variable="element">
- <instanceof
- value="org.eclipse.jdt.core.IPackageFragment" />
-
- </with>
- </enablement>
- </renameParticipant>
- </extension>
-
- <!--======================================================================================-->
- <!-- FOR JSP/JAVA MOVE PARTICIPATION -->
- <!--======================================================================================-->
- <extension
- point="org.eclipse.ltk.core.refactoring.moveParticipants">
-
- <moveParticipant
- id="org.eclipse.jst.jsp.ui.java.refactoring.JSPTypeMoveParticipant"
- name="%JSP_Type_Move_Participant_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPTypeMoveParticipant">
- <enablement>
- <with variable="affectedNatures">
- <iterate operator="or">
- <equals value="org.eclipse.jdt.core.javanature" />
- </iterate>
- </with>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IType" />
-
- </with>
- </enablement>
- </moveParticipant>
- </extension>
-
- <!--======================================================================================-->
- <!-- for breakpoint -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.breakpoint">
- <breakpointContribution id="org.eclipse.jst.jsp.ui.providers">
- <!--
- <provider
- extensions="jsp, jspf, jsf"
- class="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider"
- id="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider">
- </provider>
- -->
- <provider
- contentTypes="org.eclipse.jst.jsp.core.jspsource"
- id="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider">
- <class class="org.eclipse.jst.jsp.ui.internal.breakpointproviders.JavaStratumBreakpointProvider">
- <parameter name="org.eclipse.jst.jsp.core.jspsource" value="*jsp,jsp_servlet._*"/>
- <parameter name="org.eclipse.jst.jsp.core.tagsource" value="*tag,*tagx,tag._*,tagx._*"/>
- </class>
- </provider>
- </breakpointContribution>
- </extension>
-
-
- <!--======================================================================================-->
- <!-- Snippet View contributions -->
- <!--======================================================================================-->
- <extension
- point="org.eclipse.wst.common.snippets.SnippetContributions">
- <category
- label="%JSP_Extension_Element.label"
- smallicon="icons/snippets/tag-jsp.gif"
- id="org.eclipse.jst.jsp.ui.category0"
- contenttypes="org.eclipse.jst.jsp.core.jspsource">
- <item
- label="%jsp_hidden_comment"
- smallicon="icons/snippets/tag-generic.gif"
- id="org.eclipse.jst.jsp.ui.jsp_hidden_comment">
- <content>%jsp_hidden_comment_content</content>
- </item>
- <item
- label="%jsp_scriptlet"
- smallicon="icons/snippets/jspscr.gif"
- id="org.eclipse.jst.jsp.ui.jsp_scriptlet">
- <content>%jsp_scr_content</content>
- </item>
- <item
- label="%jsp_expression"
- smallicon="icons/snippets/jspexp.gif"
- id="org.eclipse.jst.jsp.ui.jsp_expression">
- <content>%jsp_expression_content</content>
- </item>
- <item
- label="%jsp_declaration"
- smallicon="icons/snippets/jspdecl.gif"
- id="org.eclipse.jst.jsp.ui.jsp_declaration">
- <content>%jsp_declaration_content</content>
- </item>
- <item
- label="%jsp_include_directive"
- smallicon="icons/snippets/jspincl.gif"
- id="org.eclipse.jst.jsp.ui.jsp_include_directive">
- <content>%jsp_include_directive_content</content>
- </item>
- <item
- label="%jsp_page_directive"
- id="org.eclipse.jst.jsp.ui.jsp_page_directive">
- <content>%jsp_page_directive_content</content>
- </item>
- <item
- label="%jsp_taglib_directive"
- smallicon="icons/snippets/jsptaglib.gif"
- id="org.eclipse.jst.jsp.ui.jsp_taglib_directive">
- <content>%jsp_taglib_directive_content</content>
- <variable
- description="%jsp_taglib_directive_uri"
- id="uri" />
-
- <variable
- default="mylib"
- description="%jsp_taglib_directive_prefix"
- id="prefix" />
-
- </item>
- </category>
- </extension>
-
- <!-- Editor actionsets -->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part id="org.eclipse.jst.jsp.core.jspsource.source" />
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.jst.jsp.core.jspsource.source" />
- </actionSetPartAssociation>
- </extension>
-
- <!--======================================================================================-->
- <!-- JSP Editor specific actions -->
- <!--======================================================================================-->
- <extension point="org.eclipse.ui.commands">
- <!-- rename refactor -->
- <command
- name="%command.jsp.refactor.rename.name"
- description="%command.jsp.refactor.rename.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.jst.jsp.ui.refactor.rename" />
-
- <!-- move refactor -->
- <command
- name="%command.jsp.refactor.move.name"
- description="%command.jsp.refactor.move.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.jst.jsp.ui.refactor.move" />
- </extension>
-
- <!-- Keybinding scope for jsp source editor -->
- <extension point="org.eclipse.ui.contexts">
- <context
- name="%scope.structured.text.editor.jsp.name"
- parentId="org.eclipse.ui.textEditorScope"
- description="%scope.structured.text.editor.jsp.description"
- id="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope">
- </context>
- </extension>
-
- <!-- Keybindings for jsp source editor -->
- <extension point="org.eclipse.ui.bindings">
- <!-- win32: M1=CTRL, M2=SHIFT, M3=ALT -->
- <!-- rename refactor -->
- <key
- sequence="M2+M3+R"
- contextId="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope"
- commandId="org.eclipse.jst.jsp.ui.refactor.rename"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
-
- <!-- move refactor -->
- <key
- sequence="M2+M3+V"
- contextId="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope"
- commandId="org.eclipse.jst.jsp.ui.refactor.move"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- </extension>
-
- <!--======================================================================================-->
- <!-- Templates -->
- <!--======================================================================================-->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- name="%All_JSP_context_type_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
- id="jsp_all" />
-
- <contextType
- name="%JSP_New_context_type_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
- id="jsp_new" />
-
- <contextType
- name="%JSP_Tag_context_type_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
- id="jsp_tag" />
-
- <contextType
- name="%JSP_Attribute_context_type_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
- id="jsp_attribute" />
-
- <contextType
- name="%JSP_Attribute_value_context_type_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
- id="jsp_attribute_value" />
-
- <include
- file="templates/jspdefault-templates.xml"
- translations="$nl$/templates/jspdefault-templates.properties" />
-
- </extension>
-
- <!--======================================================================================-->
- <!-- queryParticipant to participate in java seraches -->
- <!--======================================================================================-->
- <extension point="org.eclipse.jdt.ui.queryParticipants">
- <queryParticipant
- name="%JSP_Query_Participant_Extension_Element.name"
- nature="org.eclipse.jdt.core.javanature"
- class="org.eclipse.jst.jsp.ui.internal.java.search.ui.JSPQueryParticipant"
- id="org.eclipse.jst.jsp.ui.java.search.ui.JSPQueryParticipant" />
-
- </extension>
- <!-- initialize xml ui preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceInitializer" />
- </extension>
-
- <!--======================================================================================-->
- <!-- Document provider for ExternalFileEditorInput -->
- <!--======================================================================================-->
- <extension point="org.eclipse.ui.editors.documentProviders">
- <provider
- inputTypes="org.eclipse.jst.jsp.ui.internal.hyperlink.ExternalFileEditorInput"
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- id="org.eclipse.jst.jsp.ui.internal.ExternalFileDocumentProvider" />
-
- </extension>
-
- <!-- New JSP wizard -->
- <extension point="org.eclipse.ui.newWizards">
- <wizard
- id="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"
- name="%_UI_WIZARD_NAME"
- class="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard"
- category="org.eclipse.wst.web.ui"
- icon="$nl$/icons/full/etool16/newjsp_wiz.gif">
- <description>%_UI_WIZARD_CREATE_NEW_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <!-- Add new JSP wizard to J2EE Project Navigator -->
- <extension
- id="org.eclipse.jst.jsp.commonWizard.newJSP"
- point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard
- menuGroupId="org.eclipse.wst.web.ui"
- type="new"
- wizardId="org.eclipse.jst.jsp.ui.internal.wizard.NewJSPWizard">
- <enablement>
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web"/>
- </adapt>
- </or>
- </enablement>
- </commonWizard>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.jst.jsp.core.jspsource.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction" />
-
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction" />
-
- </viewerContribution>
- </extension>
-
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.jst.jsp.core.jspsource.source.editorActions"
- targetID="org.eclipse.jst.jsp.core.jspsource.source">
- <action
- id="CleanupDocument"
- label="%CleanupDocument_label"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- tooltip="%CleanupDocument_tooltip"
- class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
- actionID="CleanupDocument">
- </action>
- <action
- id="ToggleComment"
- label="%ToggleComment_label"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- tooltip="%ToggleComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- actionID="ToggleComment">
- </action>
- <action
- id="AddBlockComment"
- label="%AddBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- tooltip="%AddBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- actionID="AddBlockComment">
- </action>
- <action
- id="RemoveBlockComment"
- label="%RemoveBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- tooltip="%RemoveBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- actionID="RemoveBlockComment">
- </action>
- <action
- id="RenameElement"
- label="%RenameElement_label"
- definitionId="org.eclipse.jst.jsp.ui.refactor.rename"
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPRenameElementActionDelegate"
- actionID="RenameElement">
- </action>
- <action
- id="MoveElement"
- label="%MoveElement_label"
- definitionId="org.eclipse.jst.jsp.ui.refactor.move"
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.JSPMoveElementActionDelegate"
- actionID="MoveElement">
- </action>
- <action
- id="FindOccurrences"
- label="%FindOccurrences_label"
- definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
- class="org.eclipse.jst.jsp.ui.internal.java.search.JSPFindOccurrencesActionDelegate"
- actionID="FindOccurrences">
- </action>
- <action
- id="StructureSelectEnclosing"
- label="%StructureSelectEnclosing_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- tooltip="%StructureSelectEnclosing_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- actionID="StructureSelectEnclosing">
- </action>
- <action
- id="StructureSelectNext"
- label="%StructureSelectNext_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- tooltip="%StructureSelectNext_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- actionID="StructureSelectNext">
- </action>
- <action
- id="StructureSelectPrevious"
- label="%StructureSelectPrevious_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- tooltip="%StructureSelectPrevious_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- actionID="StructureSelectPrevious">
- </action>
- <action
- id="StructureSelectHistory"
- label="%StructureSelectHistory_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- tooltip="%StructureSelectHistory_tooltip"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- actionID="StructureSelectHistory">
- </action>
- </editorContribution>
- <editorContribution
- targetID="org.eclipse.jst.jsp.core.jspsource.source"
- id="org.eclipse.jst.jsp.core.jspsource.ruler.actions">
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
- <action
- label="%SelectRuler.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction"/>
- </editorContribution>
- </extension>
- <!-- JSP Fragment Property Page -->
- <extension point="org.eclipse.ui.propertyPages">
- <!-- for j2ee web project -->
- <page
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- name="%JSPFragmentContentSettings.name"
- class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.ProjectJSPFContentSettingsPropertyPage"
- id="org.eclipse.jst.jsp.ui.internal.contentproperties.ProjectJSPFContentSettingsPropertyPage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%JSPFragmentContentSettings.name"
- class="org.eclipse.jst.jsp.ui.internal.contentproperties.ui.JSPFContentSettingsPropertyPage"
- id="org.eclipse.jst.jsp.ui.internal.contentproperties.JSPFContentSettingsPropertyPage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IFile">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.jspfragmentsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- </page>
- </extension>
- <!-- jsp-for-css editor configurations -->
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <contentOutlineConfiguration
- class="org.eclipse.wst.css.ui.views.contentoutline.CSSContentOutlineConfiguration"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <sourceViewerConfiguration
- class="org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <propertySheetConfiguration
- class="org.eclipse.jst.jsp.css.ui.internal.views.properties.JSPedCSSPropertySheetConfiguration"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.css.ui.internal.text.CSSDocumentRegionEdgeMatcher"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <provisionalConfiguration
- type="structuredtextfoldingprovider"
- class="org.eclipse.wst.css.ui.internal.projection.StructuredTextFoldingProviderCSS"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.sse.ui.preferences.css, org.eclipse.wst.sse.ui.preferences.css.source, org.eclipse.wst.css.ui.preferences.templates, org.eclipse.wst.sse.ui.preferences.css.styles"
- target="org.eclipse.jst.jsp.core.cssjspsource" />
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.jst.jsp.css.ui.internal.registry.AdapterFactoryProviderJSPedCSS">
- <contentType id="org.eclipse.jst.jsp.core.cssjspsource" />
- </adapterFactoryDescription>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java
deleted file mode 100644
index 09c7828b9b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/properties/JSPedCSSPropertySource.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.css.ui.internal.properties;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.ui.internal.properties.CSSPropertySource;
-
-
-
-public class JSPedCSSPropertySource extends CSSPropertySource {
-
- public JSPedCSSPropertySource(ICSSNode target) {
- super(target);
- }
-
- public void setPropertyValue(Object name, Object value) {
- // workaround to avoid DOMException: if value contains jsp element, nothing happen.
- String v = value.toString();
- if (v.indexOf("${") != -1 || v.indexOf("<%=") != -1){
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- String title = JSPUIMessages.Title_InvalidValue; //$NON-NLS-1$
- String message = JSPUIMessages.Message_InvalidValue; //$NON-NLS-1$
- MessageDialog.openWarning(window.getShell(), title, message);
- return;
- }
- super.setPropertyValue(name, value);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java
deleted file mode 100644
index 809e87b0d9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/registry/AdapterFactoryProviderJSPedCSS.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.css.ui.internal.registry;
-
-import org.eclipse.jst.jsp.css.core.internal.modelhandler.ModelHandlerForJSPedCSS;
-import org.eclipse.wst.css.ui.internal.registry.AdapterFactoryProviderCSS;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-
-public class AdapterFactoryProviderJSPedCSS extends AdapterFactoryProviderCSS {
-
-
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForJSPedCSS);
- }
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java
deleted file mode 100644
index 7403816675..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/css/ui/internal/views/properties/JSPedCSSPropertySheetConfiguration.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.css.ui.internal.views.properties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jst.jsp.css.ui.internal.properties.JSPedCSSPropertySource;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-
-public class JSPedCSSPropertySheetConfiguration extends PropertySheetConfiguration {
- private class CSSPropertySheetRefreshAdapter implements INodeAdapter {
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (fPropertySheetPage != null) {
- getPropertiesRefreshJob().addPropertySheetPage(fPropertySheetPage);
- }
- }
- }
-
- private class CSSPropertySourceProvider implements IPropertySourceProvider {
- private IPropertySource fPropertySource = null;
- private ICSSNode fSource = null;
-
- public IPropertySource getPropertySource(Object object) {
- if (fSource != null && object.equals(fSource)) {
- return fPropertySource;
- }
-
- if (object instanceof ICSSNode) {
- fSource = (ICSSNode)object;
- fPropertySource = new JSPedCSSPropertySource(fSource);
- }
- else {
- fSource = null;
- fPropertySource = null;
- }
- return fPropertySource;
- }
- }
-
- private class PropertiesRefreshJob extends UIJob {
- public static final int UPDATE_DELAY = 200;
-
- private Set propertySheetPages = null;
-
- public PropertiesRefreshJob() {
- super(XMLUIMessages.JFaceNodeAdapter_1);
- setSystem(true);
- setPriority(Job.SHORT);
- propertySheetPages = new HashSet(1);
- }
-
- void addPropertySheetPage(IPropertySheetPage page) {
- propertySheetPages.add(page);
- schedule(UPDATE_DELAY);
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- Object[] pages = propertySheetPages.toArray();
- propertySheetPages.clear();
-
- for (int i = 0; i < pages.length; i++) {
- PropertySheetPage page = (PropertySheetPage) pages[i];
- if (page.getControl() != null && !page.getControl().isDisposed()) {
- page.refresh();
- }
- }
-
- return Status.OK_STATUS;
- }
- }
-
- private PropertiesRefreshJob fPropertiesRefreshJob = null;
-
- IPropertySheetPage fPropertySheetPage;
-
- private IPropertySourceProvider fPropertySourceProvider = null;
-
- private INodeAdapter fRefreshAdapter = new CSSPropertySheetRefreshAdapter();
-
- private INodeNotifier[] fSelectedNotifiers;
-
- /**
- * Create new instance of CSSPropertySheetConfiguration
- */
- public JSPedCSSPropertySheetConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public ISelection getInputSelection(IWorkbenchPart selectingPart, ISelection selection) {
- // remove UI refresh adapters
- if (fSelectedNotifiers != null) {
- for (int i = 0; i < fSelectedNotifiers.length; i++) {
- fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
- }
- fSelectedNotifiers = null;
- }
-
- ISelection preferredSelection = super.getInputSelection(selectingPart, selection);
- if (preferredSelection instanceof IStructuredSelection) {
- Object[] selectedObjects = new Object[((IStructuredSelection) selection).size()];
- System.arraycopy(((IStructuredSelection) selection).toArray(), 0, selectedObjects, 0, selectedObjects.length);
- for (int i = 0; i < selectedObjects.length; i++) {
- if (selectedObjects[i] instanceof ICSSNode) {
- ICSSNode node = (ICSSNode) selectedObjects[i];
- while (node.getNodeType() == ICSSNode.PRIMITIVEVALUE_NODE || node.getNodeType() == ICSSNode.STYLEDECLITEM_NODE) {
- node = node.getParentNode();
- selectedObjects[i] = node;
- }
- }
- }
-
- /*
- * Add UI refresh adapters and remember notifiers for later
- * removal
- */
- if (selectedObjects.length > 0) {
- List selectedNotifiers = new ArrayList(1);
- for (int i = 0; i < selectedObjects.length; i++) {
- if (selectedObjects[i] instanceof INodeNotifier) {
- selectedNotifiers.add(selectedObjects[i]);
- ((INodeNotifier) selectedObjects[i]).addAdapter(fRefreshAdapter);
- }
- }
- fSelectedNotifiers = (INodeNotifier[]) selectedNotifiers.toArray(new INodeNotifier[selectedNotifiers.size()]);
- }
- preferredSelection = new StructuredSelection(selectedObjects);
- }
- return preferredSelection;
- }
-
- PropertiesRefreshJob getPropertiesRefreshJob() {
- if (fPropertiesRefreshJob == null) {
- fPropertiesRefreshJob = new PropertiesRefreshJob();
- }
- return fPropertiesRefreshJob;
- }
-
- public IPropertySourceProvider getPropertySourceProvider(IPropertySheetPage page) {
- if (fPropertySourceProvider == null) {
- fPropertySourceProvider = new CSSPropertySourceProvider();
- fPropertySheetPage = page;
- }
- return fPropertySourceProvider;
- }
-
- public void unconfigure() {
- super.unconfigure();
- if (fSelectedNotifiers != null) {
- for (int i = 0; i < fSelectedNotifiers.length; i++) {
- fSelectedNotifiers[i].removeAdapter(fRefreshAdapter);
- }
- fSelectedNotifiers = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
deleted file mode 100644
index 6b9473c275..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.IJavaPartitions;
-import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-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.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.jst.jsp.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSP;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPELContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor;
-import org.eclipse.jst.jsp.ui.internal.contentassist.NoRegionContentAssistProcessorForJSP;
-import org.eclipse.jst.jsp.ui.internal.format.FormattingStrategyJSPJava;
-import org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector;
-import org.eclipse.jst.jsp.ui.internal.hyperlink.TaglibHyperlinkDetector;
-import org.eclipse.jst.jsp.ui.internal.hyperlink.XMLHyperlinkDetector;
-import org.eclipse.jst.jsp.ui.internal.style.LineStyleProviderForJSP;
-import org.eclipse.jst.jsp.ui.internal.style.java.LineStyleProviderForJava;
-import org.eclipse.jst.jsp.ui.internal.style.jspel.LineStyleProviderForJSPEL;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPInformationProvider;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocInformationProvider;
-import org.eclipse.jst.jsp.ui.internal.taginfo.JSPTagInfoHoverProcessor;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * Configuration for a source viewer which shows JSP content.
- * <p>
- * Clients can subclass and override just those methods which must be specific
- * to their needs.
- * </p>
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- * @since 1.0
- */
-public class StructuredTextViewerConfigurationJSP extends StructuredTextViewerConfiguration {
- /*
- * One instance per configuration because not sourceviewer-specific and
- * it's a String array
- */
- private String[] fConfiguredContentTypes;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForJava;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForJSP;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForJSPEL;
- private StructuredTextViewerConfiguration fHTMLSourceViewerConfiguration;
- private JavaSourceViewerConfiguration fJavaSourceViewerConfiguration;
- private StructuredTextViewerConfiguration fXMLSourceViewerConfiguration;
-
- /**
- * Create new instance of StructuredTextViewerConfigurationJSP
- */
- public StructuredTextViewerConfigurationJSP() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer,
- * java.lang.String)
- */
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- IAutoEditStrategy[] strategies = null;
-
- if (contentType == IXMLPartitions.XML_DEFAULT) {
- // xml autoedit strategies
- strategies = getXMLSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, contentType);
- }
- else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA) {
- // jsp java autoedit strategies
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] javaStrategies = getJavaSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, IJavaPartitions.JAVA_PARTITIONING);
- for (int i = 0; i < javaStrategies.length; i++) {
- allStrategies.add(javaStrategies[i]);
- }
- // be sure this is added last, after others, so it can modify
- // results from earlier steps.
- // add auto edit strategy that handles when tab key is pressed
- allStrategies.add(new AutoEditStrategyForTabs());
-
- strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
- else if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) {
- // html and jsp autoedit strategies
- List allStrategies = new ArrayList(0);
-
- // add the jsp autoedit strategy first then add all html's
- allStrategies.add(new StructuredAutoEditStrategyJSP());
-
- IAutoEditStrategy[] htmlStrategies = getHTMLSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < htmlStrategies.length; i++) {
- allStrategies.add(htmlStrategies[i]);
- }
-
- strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
- else {
- // default autoedit strategies
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- // be sure this is added last, after others, so it can modify
- // results from earlier steps.
- // add auto edit strategy that handles when tab key is pressed
- allStrategies.add(new AutoEditStrategyForTabs());
-
- strategies = (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
-
- return strategies;
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (fConfiguredContentTypes == null) {
- /*
- * A little bit of cheating because assuming html's configured
- * content types will add default, unknown, and all xml configured
- * content types
- */
- String[] htmlTypes = getHTMLSourceViewerConfiguration().getConfiguredContentTypes(sourceViewer);
- String[] jspTypes = StructuredTextPartitionerForJSP.getConfiguredContentTypes();
- fConfiguredContentTypes = new String[htmlTypes.length + jspTypes.length];
-
- int index = 0;
- System.arraycopy(htmlTypes, 0, fConfiguredContentTypes, index, htmlTypes.length);
- System.arraycopy(jspTypes, 0, fConfiguredContentTypes, index += htmlTypes.length, jspTypes.length);
- }
-
- return fConfiguredContentTypes;
- }
-
- protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
- IContentAssistProcessor[] processors = null;
-
- if (partitionType == IHTMLPartitions.SCRIPT) {
- // HTML JavaScript
- IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
- IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(IHTMLPartitions.SCRIPT);
- processors = new IContentAssistProcessor[]{processor};
- }
- else if (partitionType == ICSSPartitions.STYLE) {
- // HTML CSS
- IContentAssistant htmlContentAssistant = getHTMLSourceViewerConfiguration().getContentAssistant(sourceViewer);
- IContentAssistProcessor processor = htmlContentAssistant.getContentAssistProcessor(ICSSPartitions.STYLE);
- processors = new IContentAssistProcessor[]{processor};
- }
- // // jspcontentassistprocessor handles this?
- // else if ((partitionType == IHTMLPartitionTypes.HTML_DEFAULT) ||
- // (partitionType == IHTMLPartitionTypes.HTML_COMMENT)) {
- // processors = new IContentAssistProcessor[]{new
- // HTMLContentAssistProcessor()};
- // }
- else if ((partitionType == IXMLPartitions.XML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_COMMENT) || (partitionType == IJSPPartitions.JSP_DEFAULT) || (partitionType == IJSPPartitions.JSP_DIRECTIVE) || (partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) || (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) || (partitionType == IJSPPartitions.JSP_COMMENT)) {
- // jsp
- processors = new IContentAssistProcessor[]{new JSPContentAssistProcessor()};
- }
- else if ((partitionType == IXMLPartitions.XML_CDATA) || (partitionType == IJSPPartitions.JSP_CONTENT_JAVA)) {
- // jsp java
- processors = new IContentAssistProcessor[]{new JSPJavaContentAssistProcessor()};
- }
- else if (partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
- // jsp el
- processors = new IContentAssistProcessor[]{new JSPELContentAssistProcessor()};
- }
- else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
- // unknown
- processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForJSP()};
- }
-
- return processors;
- }
-
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
-
- formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
- formatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA);
-
- return formatter;
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- ITextDoubleClickStrategy strategy = null;
-
- // html or javascript
- if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT)
- strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
- else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA || contentType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT)
- // JSP Java or JSP JavaScript
- strategy = getJavaSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType);
- else if (contentType == IJSPPartitions.JSP_DEFAULT)
- // JSP (just treat like html)
- strategy = getHTMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
- else
- strategy = super.getDoubleClickStrategy(sourceViewer, contentType);
-
- return strategy;
- }
-
- private StructuredTextViewerConfiguration getHTMLSourceViewerConfiguration() {
- if (fHTMLSourceViewerConfiguration == null) {
- fHTMLSourceViewerConfiguration = new StructuredTextViewerConfigurationHTML();
- }
- return fHTMLSourceViewerConfiguration;
- }
-
- public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
- if (fPreferenceStore == null)
- return null;
- if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
- return null;
-
- List allDetectors = new ArrayList(0);
- allDetectors.add(new JSPJavaHyperlinkDetector());
- allDetectors.add(new TaglibHyperlinkDetector());
- allDetectors.add(new XMLHyperlinkDetector());
-
- IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
- for (int m = 0; m < superDetectors.length; m++) {
- IHyperlinkDetector detector = superDetectors[m];
- if (!allDetectors.contains(detector)) {
- allDetectors.add(detector);
- }
- }
- return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
- }
-
- public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- String[] indentations = null;
-
- if (contentType == IXMLPartitions.XML_DEFAULT)
- indentations = getXMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
- else
- indentations = getHTMLSourceViewerConfiguration().getIndentPrefixes(sourceViewer, contentType);
-
- return indentations;
- }
-
- protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
- IInformationProvider provider = null;
- if (partitionType == IHTMLPartitions.HTML_DEFAULT) {
- // HTML
- IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
- provider = htmlPresenter.getInformationProvider(IHTMLPartitions.HTML_DEFAULT);
- }
- else if (partitionType == IHTMLPartitions.SCRIPT) {
- // HTML JavaScript
- IInformationPresenter htmlPresenter = getHTMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
- provider = htmlPresenter.getInformationProvider(IHTMLPartitions.SCRIPT);
- }
- else if (partitionType == IXMLPartitions.XML_DEFAULT) {
- // XML
- IInformationPresenter xmlPresenter = getXMLSourceViewerConfiguration().getInformationPresenter(sourceViewer);
- provider = xmlPresenter.getInformationProvider(IXMLPartitions.XML_DEFAULT);
- }
- else if ((partitionType == IJSPPartitions.JSP_DEFAULT) || (partitionType == IJSPPartitions.JSP_DIRECTIVE)) {
- // JSP tags
- provider = new JSPInformationProvider();
- }
- else if (partitionType == IJSPPartitions.JSP_CONTENT_JAVA) {
- // JSP java
- provider = new JSPJavaJavadocInformationProvider();
- }
- return provider;
- }
-
- private JavaSourceViewerConfiguration getJavaSourceViewerConfiguration() {
- if (fJavaSourceViewerConfiguration == null) {
- IPreferenceStore store = PreferenceConstants.getPreferenceStore();
- /*
- * NOTE: null text editor is being passed to
- * JavaSourceViewerConfiguration because
- * StructuredTextViewerConfiguration does not know current editor.
- * this is okay because editor is not needed in the cases we are
- * using javasourceviewerconfiguration.
- */
- fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(JavaUI.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING);
- }
- return fJavaSourceViewerConfiguration;
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
-
- if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
- providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.HTML_DEFAULT);
- }
- else if (partitionType == IHTMLPartitions.SCRIPT || partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
- providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IHTMLPartitions.SCRIPT);
- }
- else if (partitionType == ICSSPartitions.STYLE) {
- providers = getHTMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, ICSSPartitions.STYLE);
- }
- else if (partitionType == IXMLPartitions.XML_DEFAULT || partitionType == IXMLPartitions.XML_CDATA || partitionType == IXMLPartitions.XML_COMMENT || partitionType == IXMLPartitions.XML_DECLARATION || partitionType == IXMLPartitions.XML_PI) {
- providers = getXMLSourceViewerConfiguration().getLineStyleProviders(sourceViewer, IXMLPartitions.XML_DEFAULT);
- }
- else if (partitionType == IJSPPartitions.JSP_CONTENT_JAVA) {
- providers = new LineStyleProvider[]{getLineStyleProviderForJava()};
- }
- else if (partitionType == IJSPPartitions.JSP_DEFAULT_EL) {
- providers = new LineStyleProvider[]{getLineStyleProviderForJSPEL()};
- }
- else if (partitionType == IJSPPartitions.JSP_COMMENT || partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER || partitionType == IJSPPartitions.JSP_DEFAULT || partitionType == IJSPPartitions.JSP_DIRECTIVE) {
- providers = new LineStyleProvider[]{getLineStyleProviderForJSP()};
- }
-
- return providers;
- }
-
- private LineStyleProvider getLineStyleProviderForJava() {
- if (fLineStyleProviderForJava == null) {
- fLineStyleProviderForJava = new LineStyleProviderForJava();
- }
- return fLineStyleProviderForJava;
- }
-
- private LineStyleProvider getLineStyleProviderForJSP() {
- if (fLineStyleProviderForJSP == null) {
- fLineStyleProviderForJSP = new LineStyleProviderForJSP();
- }
- return fLineStyleProviderForJSP;
- }
-
- private LineStyleProvider getLineStyleProviderForJSPEL() {
- if (fLineStyleProviderForJSPEL == null) {
- fLineStyleProviderForJSPEL = new LineStyleProviderForJSPEL();
- }
- return fLineStyleProviderForJSPEL;
- }
-
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- ITextHover hover = null;
-
- if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.SCRIPT) {
- // html and javascript regions
- hover = getHTMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
- }
- else if (contentType == IXMLPartitions.XML_DEFAULT) {
- // xml regions
- hover = getXMLSourceViewerConfiguration().getTextHover(sourceViewer, contentType, stateMask);
- }
- else if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE) || (contentType == IJSPPartitions.JSP_CONTENT_JAVA)) {
- TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
- TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
- int i = 0;
- while (i < hoverDescs.length && hover == null) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
- if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE)) {
- // JSP
- hover = manager.createBestMatchHover(new JSPTagInfoHoverProcessor());
- }
- else {
- // JSP Java
- hover = manager.createBestMatchHover(new JSPJavaJavadocHoverProcessor());
- }
- }
- else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
- if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE)) {
- // JSP
- hover = new JSPTagInfoHoverProcessor();
- }
- else {
- // JSP Java
- hover = new JSPJavaJavadocHoverProcessor();
- }
- }
- }
- i++;
- }
- }
-
- // no appropriate text hovers found, try super
- if (hover == null)
- hover = super.getTextHover(sourceViewer, contentType, stateMask);
- return hover;
- }
-
- private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
- if (fXMLSourceViewerConfiguration == null) {
- fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
- }
- return fXMLSourceViewerConfiguration;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.java
deleted file mode 100644
index a400780e48..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionConstantsJSP.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.ui.internal;
-
-/**
- * @author pavery
- */
-public interface IActionConstantsJSP {
- public final static String ACTION_NAME_RENAME_ELEMENT = "RenameElement"; //$NON-NLS-1$
- public final static String ACTION_NAME_MOVE_ELEMENT = "MoveElement"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.java
deleted file mode 100644
index f90607e7b2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/IActionDefinitionIdsJSP.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.ui.internal;
-
-import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds;
-
-/**
- * @author pavery
- */
-public interface IActionDefinitionIdsJSP {
- public final static String RENAME_ELEMENT = IJavaEditorActionDefinitionIds.RENAME_ELEMENT;
- public final static String MOVE_ELEMENT = IJavaEditorActionDefinitionIds.MOVE_ELEMENT;
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
deleted file mode 100644
index 338b245834..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.jst.jsp.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by JSP UI
- *
- * @plannedfor 1.0
- */
-public class JSPUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsp.ui.internal.JSPUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, JSPUIMessages.class);
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- public static String Sample_JSP_doc;
- public static String JSP_Delimiters_UI_;
- public static String Refactor_label;
- public static String RenameElement_label; // resource bundle
- public static String MoveElement_label; // resource bundle
- public static String MoveElementWizard;
- public static String OK;
- public static String JSP_changes;
- public static String ActionContributorJSP_0;
- public static String JSPRenameElementAction_0;
- public static String JSPMoveElementAction_0;
- public static String BasicRefactorSearchRequestor_0;
- public static String BasicRefactorSearchRequestor_1;
- public static String BasicRefactorSearchRequestor_2;
- public static String BasicRefactorSearchRequestor_3;
- public static String BasicRefactorSearchRequestor_4;
- public static String BasicRefactorSearchRequestor_5;
- public static String BasicRefactorSearchRequestor_6;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _ERROR_FILENAME_MUST_END_JSP;
- public static String _WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT;
- public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
- public static String ResourceGroup_nameExists;
- public static String NewJSPTemplatesWizardPage_0;
- public static String NewJSPTemplatesWizardPage_1;
- public static String NewJSPTemplatesWizardPage_2;
- public static String NewJSPTemplatesWizardPage_3;
- public static String NewJSPTemplatesWizardPage_4;
- public static String NewJSPTemplatesWizardPage_5;
- public static String NewJSPTemplatesWizardPage_6;
- public static String ToggleComment_label; // resource bundle
- public static String ToggleComment_tooltip; // resource bundle
- public static String ToggleComment_description; // resource bundle
- public static String AddBlockComment_label; // resource bundle
- public static String AddBlockComment_tooltip; // resource bundle
- public static String AddBlockComment_description; // resource bundle
- public static String RemoveBlockComment_label; // resource bundle
- public static String RemoveBlockComment_tooltip; // resource bundle
- public static String RemoveBlockComment_description; // resource bundle
- public static String CleanupDocument_label; // resource bundle
- public static String CleanupDocument_tooltip; // resource bundle
- public static String CleanupDocument_description; // resource bundle
- public static String FindOccurrences_label; // resource bundle
- public static String OccurrencesSearchQuery_0;
- public static String OccurrencesSearchQuery_2;
- public static String Override_method_in;
- public static String Creating_files_encoding;
- public static String Content_Assist_not_availab_UI_;
- public static String Java_Content_Assist_is_not_UI_;
- public static String JSPSourcePreferencePage_0;
- public static String JSPSourcePreferencePage_1;
- public static String JSPSourcePreferencePage_2;
- public static String JSPColorPage_jsp_content;
- public static String JSPFilesPreferencePage_0;
- public static String JSPFilesPreferencePage_1;
- public static String JSPFContentSettingsPropertyPage_0;
- public static String JSPFContentSettingsPropertyPage_1;
- public static String JSPFContentSettingsPropertyPage_2;
- public static String JSPFContentSettingsPropertyPage_3;
- public static String JSPFContentSettingsPropertyPage_4;
- public static String ProjectJSPFContentSettingsPropertyPage_0;
- public static String Title_InvalidValue;
- public static String Message_InvalidValue;
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java
deleted file mode 100644
index 8aaeba0717..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
-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.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class JSPUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.jst.jsp.ui"; //$NON-NLS-1$
-
- protected static JSPUIPlugin instance = null;
-
- /**
- * The template store for the jsp editor.
- */
- private TemplateStore fTemplateStore;
-
- /**
- * The template context type registry for the jsp editor.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- public JSPUIPlugin() {
- super();
- instance = this;
- }
-
- public static JSPUIPlugin getDefault() {
- return instance;
- }
-
- public synchronized static JSPUIPlugin getInstance() {
- return instance;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /**
- * Returns the template store for the jsp editor templates.
- *
- * @return the template store for the jsp editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore= new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), JSPUIPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the jsp plugin.
- *
- * @return the template context type registry for the jsp plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsJSP.ALL);
- registry.addContextType(TemplateContextTypeIdsJSP.NEW);
- registry.addContextType(TemplateContextTypeIdsJSP.TAG);
- registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE);
- registry.addContextType(TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
-
- fContextTypeRegistry= registry;
- }
-
- return fContextTypeRegistry;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
deleted file mode 100644
index 85cfe32715..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ /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
-###############################################################################
-## The following line is a sample JSP document. Please translate only the following parts:
-## Use below tags ONLY for JSP 1.1
-## Welcome!
-## Use below tags ONLY for JSP 1.2
-## Welcome!
-Sample_JSP_doc=<%@ page \n\tlanguage=\"java\" \n\tcontentType=\"text/html; charset=ISO-8859-1\"\n%>\n<jsp:include flush=\"true\" page=\"titleBar.jsp\"/>\n\n<%-- Use below tags ONLY for JSP 1.1 --%>\n<%\n\tSystem.out.println(\"Welcome!\");\n%>\n<%-- Use below tags ONLY for JSP 1.2 --%>\n<jsp:scriptlet>\n\tSystem.out.println(\"Welcome!\");\n</jsp:scriptlet>
-JSP_Delimiters_UI_=JSP Delimiters
-Refactor_label=Refactor
-RenameElement_label=Rename
-MoveElement_label=Move
-MoveElementWizard=Move the selected elements
-#
-OK=OK
-JSP_changes=JSP changes
-ActionContributorJSP_0=Refa&ctor
-JSPRenameElementAction_0=Editor selection does not resolve to a renamable Java element
-JSPMoveElementAction_0=Editor selection does not resolve to movable Java elements
-BasicRefactorSearchRequestor_0=JSP Rename
-BasicRefactorSearchRequestor_1=in file: {0} line: {1}
-BasicRefactorSearchRequestor_2=Move Type ''{0}'' to package ''{1}''
-BasicRefactorSearchRequestor_3=Rename Method ''{0}'' to ''{1}''
-BasicRefactorSearchRequestor_4=Rename Type ''{0}'' to ''{1}''
-BasicRefactorSearchRequestor_5=Rename Package ''{0}'' to ''{1}''
-BasicRefactorSearchRequestor_6=JSP Rename Change
-#
-_UI_WIZARD_NEW_TITLE = New JavaServer Page
-_UI_WIZARD_NEW_HEADING = JavaServer Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new JavaServer Page.
-_ERROR_FILENAME_MUST_END_JSP = The file name must end in one of the following extensions {0}.
-_WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT = JavaServer Pages created in projects that do not support Java might not work as expected.
-_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application.
-ResourceGroup_nameExists = The same name already exists.
-NewJSPTemplatesWizardPage_0=Select JSP Template
-NewJSPTemplatesWizardPage_1=Select a template as initial content in the JSP page.
-NewJSPTemplatesWizardPage_2=Name
-NewJSPTemplatesWizardPage_3=Description
-NewJSPTemplatesWizardPage_4=Use JSP Template
-NewJSPTemplatesWizardPage_5=Preview
-NewJSPTemplatesWizardPage_6=Templates are 'New JSP' templates found in the <a>JSP Templates</a> preference page.
-# Copied from sse.ui
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-ToggleComment_label=Toggle Comment
-ToggleComment_tooltip=Toggle Comment
-ToggleComment_description=Toggle Comment
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_description=Add Block Comment
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_description=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-OccurrencesSearchQuery_0={0} - {1} Occurrences in {2}
-OccurrencesSearchQuery_2=file
-Content_Assist_not_availab_UI_=Content Assist not available at the current location
-Java_Content_Assist_is_not_UI_=Java Content Assist is not available for the current cursor location
-#
-Override_method_in=Override method in '
-Creating_files_encoding=Creating files encoding preference
-#
-JSPSourcePreferencePage_0=JSP Source preferences are based on the content within the JSP.
-JSPSourcePreferencePage_1=See <a>''{0}''</a> for JSP with HTML content.
-JSPSourcePreferencePage_2=See <a>''{0}''</a> for JSP with XML content.
-JSPColorPage_jsp_content=JSP Content
-JSPFilesPreferencePage_0=Validating files
-JSPFilesPreferencePage_1=Validate JSP fragments
-# JSP Fragments
-JSPFContentSettingsPropertyPage_0=none
-JSPFContentSettingsPropertyPage_1=The properties used instead of the page directive that cannot be specified in JSP fragment files. The project setting is used if you specify "none."
-JSPFContentSettingsPropertyPage_2=Language:
-JSPFContentSettingsPropertyPage_3=Content Type:
-JSPFContentSettingsPropertyPage_4=Enable specific setting:
-ProjectJSPFContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular JSP fragment file.
-# CSS JSP
-Title_InvalidValue=Invalid Value
-Message_InvalidValue=Invalid property value.
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java
deleted file mode 100644
index 7ae423c6b2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/Logger.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if desired,
- * the console. This class should only be used by classes in this plugin. Other
- * plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.jst.jsp.ui"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- * @param level severity level of the message (OK, INFO, WARNING, ERROR, OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message text to add to the log
- * @param exception exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- * @param message text to print
- * @param category category of the message, to be compared with /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java
deleted file mode 100644
index 8379c9e181..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.jst.jsp.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-
-/**
- * AutoEditStrategy to handle characters inserted when Tab key is pressed
- */
-public class AutoEditStrategyForTabs implements IAutoEditStrategy {
- private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
-
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- // if not in smart insert mode just ignore
- if (!isSmartInsertMode())
- return;
-
- // spaces for tab character
- if (command.length == 0 && command.text != null && command.text.length() > 0 && command.text.indexOf(TAB_CHARACTER) != -1)
- smartInsertForTab(command, document);
- }
-
- /**
- * Insert spaces for tabs
- *
- * @param command
- */
- private void smartInsertForTab(DocumentCommand command, IDocument document) {
- // tab key was pressed. now check preferences to see if need to insert
- // spaces instead of tab
- int indentationWidth = getIndentationWidth();
- if (indentationWidth > -1) {
- String originalText = command.text;
- StringBuffer newText = new StringBuffer(originalText);
-
- // determine where in line this command begins
- int lineOffset = -1;
- try {
- IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
- lineOffset = command.offset - lineInfo.getOffset();
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- ILineTracker lineTracker = getLineTracker(document, originalText);
-
- int startIndex = 0;
- int index = newText.indexOf(TAB_CHARACTER);
- while (index != -1) {
- String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
-
- // replace \t character with spaces
- newText.replace(index, index + 1, indent);
- if (lineTracker != null) {
- try {
- lineTracker.replace(index, 1, indent);
- } catch (BadLocationException e) {
- // if something goes wrong with replacing text, just
- // reset to current string
- lineTracker.set(newText.toString());
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- startIndex = index + indent.length();
- index = newText.indexOf(TAB_CHARACTER, startIndex);
- }
- command.text = newText.toString();
- }
- }
-
- /**
- * Calculate number of spaces for next tab stop
- */
- private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
- int indentSize = indentationWidth;
- int offsetInLine = -1;
- if (lineTracker != null) {
- try {
- IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
- if (lineInfo.getOffset() == 0 && lineOffset > -1)
- offsetInLine = lineOffset + index;
- else
- offsetInLine = index - lineInfo.getOffset();
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- } else {
- if (lineOffset > -1) {
- offsetInLine = lineOffset + index;
- }
- }
- if (offsetInLine > -1 && indentationWidth > 0) {
- int remainder = offsetInLine % indentationWidth;
- indentSize = indentationWidth - remainder;
- }
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentSize; i++)
- indent.append(' ');
- return indent.toString();
- }
-
- /**
- * Set up a line tracker for text within command if text is multi-line
- */
- private ILineTracker getLineTracker(IDocument document, String originalText) {
- ConfigurableLineTracker lineTracker = null;
- int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
- if (delims[0] != -1 || delims[1] != -1) {
- lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
- lineTracker.set(originalText);
- }
- return lineTracker;
- }
-
- /**
- * Return true if active editor is in smart insert mode, false otherwise
- *
- * @return
- */
- private boolean isSmartInsertMode() {
- boolean isSmartInsertMode = false;
-
- ITextEditor textEditor = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor) editor;
- else
- textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- }
- }
- }
-
- // check if smart insert mode
- if (textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT)
- isSmartInsertMode = true;
- return isSmartInsertMode;
- }
-
- /**
- * Returns indentation width if using spaces for indentation, -1 otherwise
- *
- * @return
- */
- private int getIndentationWidth() {
- int width = -1;
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
- width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- return width;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
deleted file mode 100644
index 26688c6728..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.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.jst.jsp.ui.internal.autoedit;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-public class StructuredAutoEditStrategyJSP implements IAutoEditStrategy {
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- Object textEditor = getActiveTextEditor();
- if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
- return;
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-
- if (model != null) {
- if (command.text != null) {
- if (command.text.equals("%")) { //$NON-NLS-1$
- // scriptlet - add end %>
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- if (prefixedWith(document, command.offset, "<") && !node.getSource().endsWith("%>")) { //$NON-NLS-1$ //$NON-NLS-2$
- command.text += " %>"; //$NON-NLS-1$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 1;
- command.doit = false;
- }
- }
- if (command.text.equals("{")) { //$NON-NLS-1$
- IDOMNode node = (IDOMNode) model.getIndexedRegion(command.offset);
- if ((prefixedWith(document, command.offset, "$") || prefixedWith(document, command.offset, "#")) && //$NON-NLS-1$ //$NON-NLS-2$
- !node.getSource().endsWith("}")) { //$NON-NLS-1$ //$NON-NLS-2$
- command.text += " }"; //$NON-NLS-1$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 1;
- command.doit = false;
- }
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- /**
- * Return the active text editor if possible, otherwise the active editor
- * part.
- *
- * @return
- */
- private Object getActiveTextEditor() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor)
- return editor;
- ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- if (textEditor != null)
- return textEditor;
- return editor;
- }
- }
- }
- return null;
- }
-
- private boolean prefixedWith(IDocument document, int offset, String string) {
-
- try {
- return document.getLength() >= string.length() && document.get(offset - string.length(), string.length()).equals(string);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- return false;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java
deleted file mode 100644
index f0747707ad..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/AbstractBreakpointProvider.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Abstract breakpoint provider class which implements breakpoint provider
- * interface.
- *
- * This is a temporary class for JavaBreakpointProvider and
- * JavaScriptBreakpointProvider, and should be refactored to separate Java and
- * JavaScript parts.
- */
-public abstract class AbstractBreakpointProvider implements IBreakpointProvider {
-
- protected static final int END_OF_LINE = -1;
- protected static final int JAVA = 1;
- protected static final int JAVASCRIPT = 2;
- private static final String[] JAVASCRIPT_LANGUAGE_KEYS = new String[]{"javascript", "javascript1.0", "javascript1.1_3", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "javascript1.2", "javascript1.3", "javascript1.4", "javascript1.5", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "javascript1.6", "jscript", "sashscript"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private static final String JSP_DIRECTIVE_PAGE = "jsp:directive.page"; //$NON-NLS-1$
-
- protected static final int NO_VALID_CONTENT = -2;
- protected static final int UNSUPPORTED = 0;
-
- protected static boolean contains(String[] haystack, String needle) {
- for (int i = 0; i < haystack.length; i++) {
- if (haystack[i].equals(needle)) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * Return the page language
- */
- protected static int getPageLanguage(Document doc) {
- if (doc == null)
- return UNSUPPORTED;
-
- NodeList pageDirectives = doc.getElementsByTagName(JSP_DIRECTIVE_PAGE);
- // Search for first language directive
- for (int i = 0; i < pageDirectives.getLength(); i++) {
- Node child = pageDirectives.item(i);
- Node languageAttr = child.getAttributes().getNamedItem("language"); //$NON-NLS-1$
- if (languageAttr != null) {
- String pageLanguage = languageAttr.getNodeValue();
- if (pageLanguage == null || pageLanguage.length() == 0)
- return UNSUPPORTED;
- pageLanguage = pageLanguage.toLowerCase();
- if (contains(JAVASCRIPT_LANGUAGE_KEYS, pageLanguage))
- return JAVASCRIPT;
- else if (pageLanguage.equals("java"))//$NON-NLS-1$
- return JAVA;
- else
- return UNSUPPORTED;
- }
- }
- return JAVA; // Java is default if no language directive
- }
-
- /*
- * Search the RegionContainer's regions looking for JSP content. If valid
- * content is found, return the position >= 0 If no valid content is
- * found, return NO_VALID_CONTENT. If a region starts after the line's
- * endOffset, return END_OF_LINE.
- */
- private static int getValidRegionPosition(IStructuredModel model, ITextRegionCollection regionContainer, int startOffset, int endOffset) {
-
- ITextRegionList regions = regionContainer.getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region instanceof ITextRegionCollection) {
- int validPosition = getValidRegionPosition(model, (ITextRegionCollection) region, startOffset, endOffset);
- if (validPosition == END_OF_LINE || validPosition >= 0)
- return validPosition;
- }
- else {
- // region must be at least partially on selected line
- if (regionContainer.getEndOffset(region) > startOffset) {
-
- int regionStartOffset = regionContainer.getStartOffset(region);
- // if region starts after line's endOffset, we're done
- // searching
- if (regionStartOffset > endOffset)
- return END_OF_LINE;
-
- // If region is JSP content, make sure the language is
- // Java not Javascript by
- // checking the content assist adapter's type.
- if (region.getType().equals(DOMJSPRegionContexts.JSP_CONTENT)) {
- // DWM: this logic is not incorrect ... given changes
- // to adapters, etc.
- // but probably don't need anything here, since both
- // Java and JavaScript
- // are supported in V5.
-
- // nsd_TODO: verify this!!!
-
- // INodeNotifier notifier =
- // (INodeNotifier)model.getNode(region.getStartOffset());
- // IAdapterFactory factory =
- // model.getFactoryRegistry().getFactoryFor(ContentAssistAdapter.class);
- // if(factory instanceof
- // HTMLContentAssistAdapterFactory) {
- // INodeAdapter adapter =
- // ((HTMLContentAssistAdapterFactory)factory).createAdapter(notifier,
- // region);
- // if(adapter != null && adapter instanceof
- // JSPJavaContentAssistAdapter)
-
- if (regionStartOffset > startOffset)
- return regionStartOffset;
- else
- return startOffset;
- // }
- }
- // a custom tag, jsp:useBean, getproperty or setproperty
- // statement is also a valid breakpoint location
- else if (region.getType().equals(DOMRegionContext.XML_TAG_NAME) && (isCustomTagRegion(model.getIndexedRegion(regionStartOffset)) || regionContainer.getText(region).equals(JSP12Namespace.ElementName.USEBEAN) || regionContainer.getText(region).equals(JSP12Namespace.ElementName.GETPROPERTY) || regionContainer.getText(region).equals(JSP12Namespace.ElementName.SETPROPERTY))) {
-
- if (regionStartOffset > startOffset)
- return regionStartOffset;
- else
- return startOffset;
- }
- else {
- // Defect #241090, the Text Nodes inside of JSP
- // scriptlets, expressions, and declarations are valid
- // breakpoint-able locations
- boolean isCodeNode = false;
- IndexedRegion node = model.getIndexedRegion(regionStartOffset);
- if (node != null && node instanceof Node) {
- Node domNode = (Node) node;
- Node root = domNode.getOwnerDocument().getDocumentElement();
- if (root != null && root.getNodeName().equals(JSP12Namespace.ElementName.ROOT) && domNode.getNodeType() == Node.TEXT_NODE && domNode.getParentNode() != null) {
- String parentName = domNode.getParentNode().getNodeName();
- isCodeNode = parentName.equals(JSP12Namespace.ElementName.SCRIPTLET) || parentName.equals(JSP12Namespace.ElementName.EXPRESSION) || parentName.equals(JSP12Namespace.ElementName.DECLARATION);
- }
- }
- if (isCodeNode) {
- if (regionStartOffset > startOffset)
- return regionStartOffset;
- else
- return startOffset;
- }
- }
- }
- }
- }
- return NO_VALID_CONTENT;
- }
-
- private static boolean isCustomTagRegion(IndexedRegion node) {
-
- if (node instanceof Element) {
- Element xmlElement = (Element) node;
- ModelQuery mq = ModelQueryUtil.getModelQuery(xmlElement.getOwnerDocument());
- CMElementDeclaration decl = mq.getCMElementDeclaration(xmlElement);
- if (decl instanceof CMNodeWrapper) {
- CMNode cmNode = ((CMNodeWrapper) decl).getOriginNode();
- return cmNode instanceof TLDElementDeclaration;
- }
- }
- return false;
- }
-
- private ISourceEditingTextTools fSourceEditingTextTools;
-
-
- protected IResource getEditorInputResource(IEditorInput input) {
- IResource resource = (IResource) input.getAdapter(IFile.class);
- if (resource == null) {
- resource = (IResource) input.getAdapter(IResource.class);
- }
- return resource;
- }
-
- public ISourceEditingTextTools getSourceEditingTextTools() {
- return fSourceEditingTextTools;
- }
-
- protected int getValidPosition(IDocument idoc, int lineNumber) {
- if (!(getSourceEditingTextTools() instanceof IDOMSourceEditingTextTools)) {
- return NO_VALID_CONTENT;
- }
- if (idoc == null)
- return NO_VALID_CONTENT;
-
- int startOffset, endOffset;
- try {
- startOffset = idoc.getLineOffset(lineNumber - 1);
- endOffset = idoc.getLineOffset(lineNumber) - 1;
-
- if (idoc == null)
- return NO_VALID_CONTENT;
- String lineText = idoc.get(startOffset, endOffset - startOffset).trim();
-
- // blank lines or lines with only an open or close brace or
- // scriptlet tag cannot have a breakpoint
- if (lineText.equals("") || lineText.equals("{") || //$NON-NLS-2$//$NON-NLS-1$
- lineText.equals("}") || lineText.equals("<%"))//$NON-NLS-2$//$NON-NLS-1$
- return NO_VALID_CONTENT;
- }
- catch (BadLocationException e) {
- return NO_VALID_CONTENT;
- }
-
- IStructuredDocumentRegion flatNode = ((IStructuredDocument) idoc).getRegionAtCharacterOffset(startOffset);
- // go through the node's regions looking for JSP content
- // until reaching the end of the line
- while (flatNode != null) {
- int validPosition = getValidRegionPosition(((IDOMDocument) ((IDOMSourceEditingTextTools) getSourceEditingTextTools()).getDOMDocument()).getModel(), flatNode, startOffset, endOffset);
-
- if (validPosition == END_OF_LINE)
- return NO_VALID_CONTENT;
-
- if (validPosition >= 0)
- return validPosition;
-
- flatNode = flatNode.getNext();
- }
- return NO_VALID_CONTENT;
- }
-
- public void setSourceEditingTextTools(ISourceEditingTextTools sourceEditingTextTools) {
- fSourceEditingTextTools = sourceEditingTextTools;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.java
deleted file mode 100644
index f43607054a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaBreakpointProvider.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.ui.internal.breakpointproviders;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.debug.core.JDIDebugModel;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.wst.xml.ui.internal.provisional.IDOMSourceEditingTextTools;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * A BreakpointProvider supporting server-side Java as a JSP language
- *
- * @deprecated
- */
-public class JavaBreakpointProvider extends AbstractBreakpointProvider {
-
- /*
- * @param res @return String
- */
- private static final String getTypeName(IResource res) {
- IPath path = res.getFullPath();
- // Assume under Web Content folder if more than 2 segments
- if (path.segmentCount() > 2) {
- path = path.removeFirstSegments(2);
- }
- else {
- path = path.removeFirstSegments(1);
- }
- String typeName = path.toString().replace(IPath.SEPARATOR, '.');
- if (res.getFileExtension() != null) {
- typeName = typeName.substring(0, typeName.lastIndexOf('.'));
- }
- return typeName;
- }
-
-
-
- public IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException {
- int pos = getValidPosition(document, lineNumber);
- if (pos != NO_VALID_CONTENT) {
- IResource res = getEditorInputResource(input);
- if (res != null) {
- String typeName = getTypeName(res);
- try {
- JDIDebugModel.createLineBreakpoint(res, typeName, lineNumber, pos, pos, 0, true, null);
- }
- catch (CoreException e) {
- return e.getStatus();
- }
- }
- }
- return new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null); //$NON-NLS-1$
- }
-
- public boolean canAddBreakpoint(IDocument document, IEditorInput input, Node node, int lineNumber, int offset) {
- IResource res = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
- Document doc = null;
- if (getSourceEditingTextTools() instanceof IDOMSourceEditingTextTools) {
- doc = ((IDOMSourceEditingTextTools) getSourceEditingTextTools()).getDOMDocument();
- }
-
- return res != null && !isBreakpointExist(res, lineNumber) && isValidPosition(document, lineNumber) && (getPageLanguage(doc) == JAVA);
- }
-
- public IResource getResource(IEditorInput input) {
- return getEditorInputResource(input);
- }
-
- /*
- * @param res @param lineNumber @return boolean
- */
- private boolean isBreakpointExist(IResource res, int lineNumber) {
- try {
- return JDIDebugModel.lineBreakpointExists(getTypeName(res), lineNumber) != null;
- }
- catch (CoreException e) {
- return false;
- }
- }
-
- /*
- * @param doc @param idoc @param lineNumber @return boolean
- */
- private boolean isValidPosition(IDocument idoc, int lineNumber) {
- return getValidPosition(idoc, lineNumber) != NO_VALID_CONTENT;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java
deleted file mode 100644
index d32295c30e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaScriptBreakpointProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.w3c.dom.Document;
-
-/**
- * A IBreakpointProvider supporting server-side JavaScript as a JSP language
- *
- */
-public class JavaScriptBreakpointProvider extends AbstractBreakpointProvider {
- public boolean canAddBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) {
- IResource res = getEditorInputResource(input);
- Document doc = null;
- return res != null && !isBreakpointExist(res, lineNumber) && isValidPosition(document, lineNumber) && (getPageLanguage(doc) != JAVA);
- }
-
-
- public IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) {
- int pos = getValidPosition(document, lineNumber);
- if (pos != NO_VALID_CONTENT && canAddBreakpoint(document, input, lineNumber, offset)) {
- IResource res = getEditorInputResource(input);
- if (res != null) {
- new JavascriptLineBreakpoint(res, lineNumber, pos, pos);
- }
- }
- return new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null); //$NON-NLS-1$
- }
-
- /*
- * @param res @param lineNumber @return boolean
- */
- private boolean isBreakpointExist(IResource res, int lineNumber) {
- IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
- IBreakpoint[] breakpoints = manager.getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
- if (!(breakpoints[i] instanceof JavascriptLineBreakpoint))
- continue;
- JavascriptLineBreakpoint breakpoint = (JavascriptLineBreakpoint) breakpoints[i];
- try {
- if (breakpoint.getResource().equals(res) && breakpoint.getLineNumber() == lineNumber) {
- return true;
- }
- }
- catch (CoreException e) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * @param doc @param idoc @param lineNumber @return boolean
- */
- private boolean isValidPosition(IDocument idoc, int lineNumber) {
- return getValidPosition(idoc, lineNumber) != NO_VALID_CONTENT;
- }
-
- public IResource getResource(IEditorInput input) {
- return getEditorInputResource(input);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
deleted file mode 100644
index 789a2d7d9a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.breakpointproviders;
-
-import java.util.HashMap;
-import java.util.Map;
-
-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.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jdt.debug.core.JDIDebugModel;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModel;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint.IBreakpointProvider;
-
-/**
- * A IBreakpointProvider supporting JSP breakpoints for a Non-Java Language
- * Source JSP page
- */
-public class JavaStratumBreakpointProvider implements IBreakpointProvider, IExecutableExtension {
- private static final String DEFAULT_CLASS_PATTERN = "*jsp,jsp_servlet._*";
- private Object fData = null;
-
- public IStatus addBreakpoint(IDocument document, IEditorInput input, int editorLineNumber, int offset) throws CoreException {
- // check if there is a valid position to set breakpoint
- int pos = getValidPosition(document, editorLineNumber);
- IStatus status = null;
- if (pos >= 0) {
- IResource res = getResourceFromInput(input);
- if (res != null) {
- String path = null;
- IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", res.getName(), path, getClassPattern(res), editorLineNumber, pos, pos, 0, true, null); //$NON-NLS-1$
- if (point == null) {
- status = new Status(IStatus.ERROR, JSPUIPlugin.ID, IStatus.ERROR, "unsupported input type", null); //$NON-NLS-1$
- }
- }
- else if (input instanceof IStorageEditorInput) {
- // For non-resources, use the workspace root and a coordinated
- // attribute that is used to
- // prevent unwanted (breakpoint) markers from being loaded
- // into the editors.
- res = ResourcesPlugin.getWorkspace().getRoot();
- String id = input.getName();
- if (input instanceof IStorageEditorInput && ((IStorageEditorInput) input).getStorage() != null && ((IStorageEditorInput) input).getStorage().getFullPath() != null) {
- id = ((IStorageEditorInput) input).getStorage().getFullPath().toString();
- }
- Map attributes = new HashMap();
- attributes.put(StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY, id);
- String path = null;
- IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", input.getName(), path, getClassPattern(res), editorLineNumber, pos, pos, 0, true, attributes); //$NON-NLS-1$
- if (point == null) {
- status = new Status(IStatus.ERROR, JSPUIPlugin.ID, IStatus.ERROR, "unsupported input type", null); //$NON-NLS-1$
- }
- }
- }
- else {
- status = new Status(IStatus.INFO, JSPUIPlugin.ID, IStatus.INFO, "", null); //$NON-NLS-1$
- }
- if (status == null) {
- status = new Status(IStatus.OK, JSPUIPlugin.ID, IStatus.OK, JSPUIMessages.OK, null);
- }
- return status;
- }
-
- private String getClassPattern(IResource resource) {
- if (resource != null) {
- String shortName = resource.getName();
- String extension = resource.getFileExtension();
- if (extension != null && extension.length() < shortName.length()) {
- shortName = shortName.substring(0, shortName.length() - extension.length() - 1);
- }
- if (fData instanceof String && fData.toString().length() > 0) {
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=154475
- */
- return fData + ",_" + shortName;
- }
- else if (fData instanceof Map && resource.isAccessible() && resource.getType() == IResource.FILE) {
- IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
- if (types.length == 0) {
- // if failed to find quickly, be more aggressive
- IContentDescription d = null;
- try {
- // optimized description lookup, might not succeed
- d = ((IFile) resource).getContentDescription();
- if (d != null) {
- types = new IContentType[]{d.getContentType()};
- }
- }
- catch (CoreException e) {
- /*
- * should not be possible given the accessible and
- * file type check above
- */
- }
- }
- // wasn't found earlier
- if (types == null) {
- types = Platform.getContentTypeManager().findContentTypesFor(resource.getName());
- }
- StringBuffer patternBuffer = new StringBuffer("_" + shortName);
- for (int i = 0; i < types.length; i++) {
- Object pattern = ((Map) fData).get(types[i].getId());
- if (pattern != null) {
- patternBuffer.append(","); //$NON-NLS-1$
- patternBuffer.append(pattern);
- }
- }
- return patternBuffer.toString();
- }
- }
- return DEFAULT_CLASS_PATTERN;
- }
-
- public IResource getResource(IEditorInput input) {
- return getResourceFromInput(input);
- }
-
- private IResource getResourceFromInput(IEditorInput input) {
- IResource resource = (IResource) input.getAdapter(IFile.class);
- if (resource == null) {
- resource = (IResource) input.getAdapter(IResource.class);
- }
- return resource;
- }
-
- /**
- * Finds a valid position somewhere on lineNumber in document, idoc, where
- * a breakpoint can be set and returns that position. -1 is returned if a
- * position could not be found.
- *
- * @param idoc
- * @param editorLineNumber
- * @return position to set breakpoint or -1 if no position could be found
- */
- private int getValidPosition(IDocument idoc, int editorLineNumber) {
- int result = -1;
- if (idoc != null) {
-
- int startOffset = 0;
- int endOffset = 0;
- try {
- IRegion line = idoc.getLineInformation(editorLineNumber - 1);
- startOffset = line.getOffset();
- endOffset = Math.max(line.getOffset(), line.getOffset() + line.getLength());
-
- String lineText = idoc.get(startOffset, endOffset - startOffset).trim();
-
- // blank lines or lines with only an open or close brace or
- // scriptlet tag cannot have a breakpoint
- if (lineText.equals("") || lineText.equals("{") || //$NON-NLS-1$ //$NON-NLS-2$
- lineText.equals("}") || lineText.equals("<%")) //$NON-NLS-1$ //$NON-NLS-2$
- {
- result = -1;
- }
- else {
- // get all partitions for current line
- ITypedRegion[] partitions = null;
-
- partitions = idoc.computePartitioning(startOffset, endOffset - startOffset);
-
-
- for (int i = 0; i < partitions.length; ++i) {
- String type = partitions[i].getType();
- // if found jsp java content, jsp directive tags,
- // custom
- // tags,
- // return that position
- if (type == IJSPPartitions.JSP_CONTENT_JAVA || type == IJSPPartitions.JSP_DIRECTIVE) {
- result = partitions[i].getOffset();
- }
- }
- }
- }
- catch (BadLocationException e) {
- result = -1;
- }
- }
-
- return result;
- }
-
- /**
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
- * java.lang.String, java.lang.Object)
- */
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- fData = data;
- }
-
- public void setSourceEditingTextTools(ISourceEditingTextTools tools) {
- // not used
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.java
deleted file mode 100644
index 68580d9c6c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavascriptLineBreakpoint.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 Jul 20, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class JavascriptLineBreakpoint {
-
- /**
- * @param res
- * @param lineNumber
- * @param pos
- * @param pos1
- */
- public JavascriptLineBreakpoint(IResource res, int lineNumber, int pos, int pos1) {
-
- // TODO Should be deleted? Along with calling class?
- }
-
- /**
- *
- */
- public JavascriptLineBreakpoint() {
- super();
- }
-
- /**
- *
- */
- public IResource getResource() throws CoreException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @return
- */
- public int getLineNumber() {
- // TODO Auto-generated method stub
- return 0;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
deleted file mode 100644
index a4d8c143d5..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AutoImportProposal extends JSPCompletionProposal {
-
- // the import string, no quotes or colons
- String fImportDeclaration;
-
- public AutoImportProposal(String importDeclaration, String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
- super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
- setImportDeclaration(importDeclaration);
- }
-
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- super.apply(viewer, trigger, stateMask, offset);
- addImportDeclaration(viewer);
- }
- /**
- * adds the import declaration to the document in the viewer in the appropriate position
- * @param viewer
- */
- private void addImportDeclaration(ITextViewer viewer) {
-
- IDocument doc = viewer.getDocument();
-
- // calculate once and pass along
- boolean isXml = isXmlFormat(doc);
-
- int insertPosition = getInsertPosition(doc, isXml);
- String insertText = createImportDeclaration(doc, isXml);
- InsertEdit insert = new InsertEdit(insertPosition, insertText);
- try {
- insert.apply(doc);
- }
- catch (MalformedTreeException e) {
- Logger.logException(e);
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
-
- // make sure the cursor position after is correct
- setCursorPosition(getCursorPosition() + insertText.length());
- }
- /**
- *
- * @param doc
- * @param isXml
- * @return position after <jsp:root> if xml, otherwise right before the document element
- */
- private int getInsertPosition(IDocument doc, boolean isXml) {
- int pos = 0;
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
- try {
- if(sModel != null) {
- if(sModel instanceof IDOMModel) {
- IDOMDocument documentNode = ((IDOMModel)sModel).getDocument();
- Node docElement = documentNode.getDocumentElement();
- if(docElement != null && docElement instanceof IDOMElement) {
- IStructuredDocumentRegion sdRegion = ((IDOMElement)docElement).getFirstStructuredDocumentRegion();
- if(isXml) {
- // insert right after document element
- pos = sdRegion.getEndOffset();
- }
- else {
- // insert before document element
- pos = sdRegion.getStartOffset();
- }
- }
- }
- }
- }
- finally {
- if(sModel != null)
- sModel.releaseFromRead();
- }
- return pos;
- }
- /**
- *
- * @param doc
- * @return true if this document is xml-jsp syntax, otherwise false
- */
- private boolean isXmlFormat(IDocument doc) {
- boolean isXml = false;
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
- try {
- if(sModel != null) {
- if(!isXml) {
- if(sModel instanceof IDOMModel) {
- IDOMDocument documentNode = ((IDOMModel)sModel).getDocument();
- Element docElement = documentNode.getDocumentElement();
- isXml = docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
- }
- }
- }
- }
- finally {
- if(sModel != null)
- sModel.releaseFromRead();
- }
- return isXml;
- }
- /**
- *
- * @param doc
- * @param isXml
- * @return appropriate import declaration string depending if document is xml or not
- */
- private String createImportDeclaration(IDocument doc, boolean isXml) {
- String delim = (doc instanceof IStructuredDocument) ? ((IStructuredDocument)doc).getLineDelimiter() : TextUtilities.getDefaultLineDelimiter(doc);
- if(isXml)
- return delim + "<jsp:directive.page import=\""+getImportDeclaration()+"\"/>"; //$NON-NLS-1$ //$NON-NLS-2$
- return "<%@page import=\"" + getImportDeclaration() + "\"%>" + delim; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public String getImportDeclaration() {
- return fImportDeclaration;
- }
- public void setImportDeclaration(String importDeclaration) {
- fImportDeclaration = importDeclaration;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java
deleted file mode 100644
index 63ded692f6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/BeanInfoProvider.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-import java.beans.Introspector;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-
-/**
- * Navigates the IJavaProject classpath (incl. source) on a given resource and infers bean properties
- * given a fully qualified beanname. Bean properties can be retrieved using:
- * <code>getRuntimeProperties(IResource baseResource, String typeName)</code>
- *
- * @plannedfor 1.0
- */
-public class BeanInfoProvider implements IBeanInfoProvider {
-
- public class JavaPropertyDescriptor implements IJavaPropertyDescriptor {
- String fType = null;
- String fName = null;
- boolean fReadable = true;
- boolean fWritable = true;
-
- public JavaPropertyDescriptor(String name, String type, boolean readable, boolean writable) {
- fName = name;
- fType = type;
- fReadable = readable;
- fWritable = writable;
- }
-
- public String getDeclaredType() {
- return fType;
- }
-
- public String getDisplayName() {
- return fName;
- }
-
- public String getName() {
- return fName;
- }
-
- public boolean getReadable() {
- return fReadable;
- }
-
- public boolean getWriteable() {
- return fWritable;
- }
- }
-
- // looks up encoded type (see Class.getName), and gives you a displayable string
- private HashMap fEncodedTypeMap = null;
- // to avoid repeat properties from showing up
- private HashSet fRepeatMethods = null;
-
- public BeanInfoProvider() {
- fRepeatMethods = new HashSet();
- }
-
- /**
- * Returns the inferred properties of a bean based on the project from the baseResource,
- * and the fully qualified name of the bean.
- *
- * @param baseResource the base resource where the bean is being used
- * @param typeName the <i>fully qualified</i> type name (eg. javax.swing.JButton) of the bean
- */
- public IJavaPropertyDescriptor[] getRuntimeProperties(IResource baseResource, String typeName) {
- IJavaProject javaProject = JavaCore.create(baseResource.getProject());
- QualifiedName typeQualifiedName = getTypeQualifiedName(typeName);
- List getMethodResults = new ArrayList();
- List isMethodResults = new ArrayList();
- List setMethodResults = new ArrayList();
- List descriptorResults = new ArrayList();
- try {
- IType type = javaProject.findType(typeQualifiedName.getQualifier() + "." + typeQualifiedName.getLocalName()); //$NON-NLS-1$
- // type must exist
- if(type != null) {
- ITypeHierarchy hierarchy = type.newTypeHierarchy(null);
- IType[] supers = hierarchy.getAllSuperclasses(type);
-
- IMethod[] methods = type.getMethods();
- // iterate the bean's methods
- for (int i = 0; i < methods.length; i++)
- acceptMethod(getMethodResults, isMethodResults, setMethodResults, methods[i]);
- // the bean hierarchy's methods
- for (int i = 0; i < supers.length; i++) {
- methods = supers[i].getMethods();
- for (int j = 0; j < methods.length; j++)
- acceptMethod(getMethodResults, isMethodResults, setMethodResults, methods[j]);
- }
- adaptMethodsToPropertyDescriptors(getMethodResults, isMethodResults, setMethodResults, descriptorResults);
- }
- }
- catch (JavaModelException jmex) {
- Logger.logException("Problem navigating JavaProject in BeanInfoProvider", jmex); //$NON-NLS-1$
- }
-
- IJavaPropertyDescriptor[] finalResults = new IJavaPropertyDescriptor[descriptorResults.size()];
- System.arraycopy(descriptorResults.toArray(), 0, finalResults, 0, descriptorResults.size());
- return finalResults;
- }
-
- /**
- * Retrieves the necessary information from method declaration lists, creates and fills a list of JavaPropertyDescriptors.
- * @param getMethods
- * @param isMethods
- * @param setMethods
- * @param descriptorResults
- */
- private void adaptMethodsToPropertyDescriptors(List getMethods, List isMethods, List setMethods, List descriptors) throws JavaModelException {
- List readable = new ArrayList();
- HashMap types = new HashMap();
-
- // iterate through get* and is* methods, updating 'readable' list and 'types' map
- filterGetMethods(getMethods, readable, types);
- filterIsMethods(isMethods, readable, types);
-
- // iterate set* methods, checking overlap w/ readable
- Iterator it = setMethods.iterator();
- IMethod temp = null;
- String name = ""; //$NON-NLS-1$
- String type = ""; //$NON-NLS-1$
- String[] encodedParams = null;
- String returnType = ""; //$NON-NLS-1$
- String param0 = ""; //$NON-NLS-1$
-
- while (it.hasNext()) {
- temp = (IMethod) it.next();
- name = createPropertyNameFromMethod(temp);
- // invalid naming convention
- if (name == null)
- continue;
-
- returnType = getDecodedTypeName(temp.getReturnType());
- // setter should have no return type
- if (!returnType.equals("void")) //$NON-NLS-1$
- continue;
-
- // need to get type from parameter
- encodedParams = temp.getParameterTypes();
- if (encodedParams != null && encodedParams.length > 0) {
- if (encodedParams.length > 1) {
- // multiple params
- param0 = getDecodedTypeName(encodedParams[0]);
- if (!param0.equals("int")) //$NON-NLS-1$
- // not a valid indexed property
- continue;
-
- type = getDecodedTypeName(encodedParams[1]);
- }
- else {
- // one param, regular setter
- if (isArray(encodedParams[0]))
- type = getDecodedTypeName(encodedParams[0]);
- }
- }
-
- if (readable.contains(name)) {
- // writable and readable
- if (!fRepeatMethods.contains(name)) {
- descriptors.add(new JavaPropertyDescriptor(name, (String) types.get(name), true, true));
- readable.remove(name);
- fRepeatMethods.add(name);
- }
- }
- else {
- // wasn't readable, just writable
- String[] params = temp.getParameterTypes();
- // can't be setProperty if no parameters
- if (!(params.length > 0))
- continue;
- if (!fRepeatMethods.contains(name)) {
- type = getDecodedTypeName(params[0]);
- descriptors.add(new JavaPropertyDescriptor(name, type, false, true));
- fRepeatMethods.add(name);
- }
- }
- }
- // add leftover from readable, get* and is* methods (readable = true, writable = false)
- it = readable.iterator();
- while (it.hasNext()) {
- name = (String) it.next();
- if (!fRepeatMethods.contains(name)) {
- descriptors.add(new JavaPropertyDescriptor(name, (String) types.get(name), true, false));
- fRepeatMethods.add(name);
- }
- }
- }
-
- private void filterGetMethods(List getMethods, List readable, HashMap types) throws JavaModelException {
- IMethod temp;
- String name;
- String encodedReturnType;
- String returnType;
- Iterator it = getMethods.iterator();
- String[] encodedParams;
- String paramType;
- // iterate get* methods
- while (it.hasNext()) {
- temp = (IMethod) it.next();
- name = createPropertyNameFromMethod(temp);
- // invalid bean naming convention
- if (name == null)
- continue;
-
- encodedReturnType = temp.getReturnType();
- returnType = getDecodedTypeName(encodedReturnType);
-
- // can't get be a getProperty if returns void
- if (returnType.equals("void")) //$NON-NLS-1$
- continue;
-
- // check params in case it's indexed propety
- encodedParams = temp.getParameterTypes();
- if (encodedParams != null && encodedParams.length == 1) {
- paramType = getDecodedTypeName(encodedParams[0]);
- // syntax is > Type getter(int);
- if (!paramType.equals("int")) { //$NON-NLS-1$
- //it's not an indexed property
- continue;
- }
- // it is indexed, prop type is an ARRAY
- returnType += "[]"; //$NON-NLS-1$
- }
-
- readable.add(name);
- types.put(name, returnType);
- }
-
- }
-
- private void filterIsMethods(List isMethodResults, List readable, HashMap types) throws JavaModelException {
- IMethod temp;
- String name;
- String encodedReturnType;
- String returnType;
- String[] encodedParams;
- String paramType;
- // iterate is* methods
- Iterator it = isMethodResults.iterator();
- while (it.hasNext()) {
- temp = (IMethod) it.next();
- name = createPropertyNameFromMethod(temp);
- // invalid bean naming convention
- if (name == null)
- continue;
- encodedReturnType = temp.getReturnType();
- returnType = getDecodedTypeName(encodedReturnType);
-
- // isProperty only valid for boolean
- if (!returnType.equals("boolean")) //$NON-NLS-1$
- continue;
-
- // check params in case it's indexed propety
- encodedParams = temp.getParameterTypes();
- if (encodedParams != null && encodedParams.length == 1) {
- paramType = getDecodedTypeName(encodedParams[0]);
- // syntax is > Type getter(int);
- if (!paramType.equals("int")) { //$NON-NLS-1$
- //it's not a valid indexed property
- continue;
- }
- }
-
- readable.add(name);
- types.put(name, returnType);
- }
- }
-
- /**
- * Pass in a get*|set*|is* method and it will return an inferred property name using <code>Introspector.decapitalize(String)</code>
- * @param temp
- * @return an inferred property name based on the IMethod name, null if the name is not valid according to bean spec
- */
- private String createPropertyNameFromMethod(IMethod temp) {
- String name = temp.getElementName();
- if (name.startsWith("is")) //$NON-NLS-1$
- name = Introspector.decapitalize(name.substring(2));
- else
- // must be get or set
- name = Introspector.decapitalize(name.substring(3));
- return name;
- }
-
- /**
- * Initial filtering of methods. Checks prefix if it's valid length. If the prefix is "get" the method name
- * is placed in the getMethodResults List. If the prefix is "is", the name is added to the isMethodResults list. If the
- * prefix is "set", it's added to the setMethodResultsList.
- *
- * @param getMethodResults
- * @param isMethodResults
- * @param setMethodResults
- * @param method
- */
- private void acceptMethod(List getMethodResults, List isMethodResults, List setMethodResults, IMethod method) throws JavaModelException {
- if (!fRepeatMethods.contains(method.getElementName())) {
- fRepeatMethods.add(method.getElementName());
- int flags = method.getFlags();
- String methodName = method.getElementName();
- if (Flags.isPublic(flags)) {
- if (methodName.length() > 3 && methodName.startsWith("get")) //$NON-NLS-1$
- getMethodResults.add(method);
- else if (methodName.length() > 2 && methodName.startsWith("is")) //$NON-NLS-1$
- isMethodResults.add(method);
- else if (methodName.length() > 3 && methodName.startsWith("set")) //$NON-NLS-1$
- setMethodResults.add(method);
- }
- }
- }
-
- /**
- * @param typeName
- * @return a Qualified name with the package as the qualifier, and class name as LocalName
- */
- private QualifiedName getTypeQualifiedName(String typeName) {
- StringTokenizer st = new StringTokenizer(typeName, ".", false); //$NON-NLS-1$
- int length = st.countTokens();
- int count = 0;
- StringBuffer root = new StringBuffer();
- while (count++ < length - 1) {
- root.append(st.nextToken());
- if (count < length - 1)
- root.append('.');
- }
- return new QualifiedName(root.toString(), st.nextToken());
- }
-
- /**
- * Checks if encodedTypeName is an array
- * @param encodedTypeName
- * @return true if encodedTypeName is an array, false otherwise.
- */
- private boolean isArray(String encodedTypeName) {
- if (encodedTypeName != null && encodedTypeName.length() > 0) {
- if (encodedTypeName.charAt(0) == '[')
- return true;
- }
- return false;
- }
-
- /**
- * Returns the decoded (displayable) name fo the type.
- * Either a primitive type (int, long, float...) Object (String)
- * @param type
- * @return decoded name for the encoded string
- */
- private String getDecodedTypeName(String encoded) {
- HashMap map = getEncodedTypeMap();
-
- StringBuffer decoded = new StringBuffer();
- char BRACKET = '[';
- String BRACKETS = "[]"; //$NON-NLS-1$
- char identifier = ' ';
- int last = 0;
- // count brackets
- while (encoded.indexOf(BRACKET, last) != -1) {
- last++;
- }
- identifier = encoded.charAt(last);
- Object primitiveType = map.get(String.valueOf(identifier));
- // L > binary type name, Q > source type name
- if (identifier == 'L' || identifier == 'Q') {
- // handle object
- String classname = encoded.substring(last + 1, encoded.length() - 1);
- decoded.append(classname);
- }
- else if (primitiveType != null) {
- // handle primitive type (from IField.getSignature())
- decoded.append((String) primitiveType);
- }
- else {
- // handle primitive type (from Class.getName())
- decoded.append(encoded);
- }
- // handle arrays
- if (last > 0) {
- for (int i = 0; i < last; i++) {
- decoded.append(BRACKETS);
- }
- }
- return decoded.toString();
- }
-
- /**
- * from Class.getName() javadoc
- * also see Signature in jdt.core api
- *<pre>
- * B byte
- * C char
- * D double
- * F float
- * I int
- * J long
- * Lclassname; class or interface
- * Qsourcename; source
- * S short
- * Z boolean
- * V void
- *</pre>
- *
- * @return the "encoding letter" to "type" map.
- */
- private HashMap getEncodedTypeMap() {
- if (fEncodedTypeMap == null) {
- fEncodedTypeMap = new HashMap();
- fEncodedTypeMap.put("B", "byte"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("C", "char"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("D", "double"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("F", "float"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("I", "int"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("J", "long"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("S", "short"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("Z", "boolean"); //$NON-NLS-1$ //$NON-NLS-2$
- fEncodedTypeMap.put("V", "void"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return fEncodedTypeMap;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
deleted file mode 100644
index c580bd4180..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-/**
- * Purpose of this class is to make the additional proposal info into content
- * fit for an HTML viewer (by escaping characters)
- *
- * @plannedfor 1.0
- */
-class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
- // copies of this class exist in:
- // org.eclipse.jst.jsp.ui.internal.contentassist
- // org.eclipse.wst.html.ui.internal.contentassist
- // org.eclipse.wst.xml.ui.internal.contentassist
-
- public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
- super(template, context, region, image, relevance);
- }
-
- public String getAdditionalProposalInfo() {
- String additionalInfo = super.getAdditionalProposalInfo();
- return StringUtils.convertToHTMLContent(additionalInfo);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.java
deleted file mode 100644
index 7487e3cccb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IBeanInfoProvider.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.ui.internal.contentassist;
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * @plannedfor 1.0
- */
-public interface IBeanInfoProvider {
- IJavaPropertyDescriptor[] getRuntimeProperties(IResource baseResource, String typeName);
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.java
deleted file mode 100644
index 1606a2e4f4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/IJavaPropertyDescriptor.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.ui.internal.contentassist;
-
-/**
- * @plannedfor 1.0
- */
-public interface IJavaPropertyDescriptor {
-
- String getDeclaredType();
-
- String getDisplayName();
-
- String getName();
-
- boolean getReadable();
-
- boolean getWriteable();
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
deleted file mode 100644
index 73d1e50725..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
+++ /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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.osgi.framework.Bundle;
-
-
-/**
- * @plannedfor 1.0
- */
-public class JSPCompletionProcessor implements IContentAssistProcessor, IReleasable {
- // 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 static final String JDT_CORE_PLUGIN_ID = "org.eclipse.jdt.core"; //$NON-NLS-1$
-
- protected int fJspSourcePosition, fJavaPosition;
- protected String fErrorMessage = null;
- protected StructuredTextViewer fViewer = null;
- private JSPTranslationAdapter fTranslationAdapter = null;
-
- /**
- * Returns a list of completion proposals 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 proposals
- * @param documentPosition
- * an offset within the document for which completions should
- * be computed
- * @return an array of completion proposals or <code>null</code> if no
- * proposals are possible
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int pos) {
- initialize(pos);
-
- JSPProposalCollector collector = null;
-
- IDOMModel xmlModel = null;
- try {
- if (viewer instanceof StructuredTextViewer)
- fViewer = (StructuredTextViewer) viewer;
-
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(fViewer.getDocument());
-
- IDOMDocument xmlDoc = xmlModel.getDocument();
- if (fTranslationAdapter == null)
- fTranslationAdapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (fTranslationAdapter != null) {
-
- JSPTranslation translation = fTranslationAdapter.getJSPTranslation();
- fJavaPosition = translation.getJavaOffset(getDocumentPosition());
-
- if (DEBUG)
- System.out.println(debug(translation));
-
- try {
-
- ICompilationUnit cu = translation.getCompilationUnit();
-
- // can't get java proposals w/out a compilation unit
- // or without a valid position
- if (cu == null || -1 == fJavaPosition)
- return new ICompletionProposal[0];
-
- collector = getProposalCollector(cu, translation);
- synchronized (cu) {
- cu.codeComplete(fJavaPosition, collector, null);
- }
- }
- catch (CoreException coreEx) {
- // a possible Java Model Exception due to not being a Web
- // (Java) Project
- coreEx.printStackTrace();
- }
- }
- }
- catch (Exception exc) {
- exc.printStackTrace();
- // throw out exceptions on code assist.
- }
- finally {
- if (xmlModel != null) {
- xmlModel.releaseFromRead();
- }
- }
- ICompletionProposal[] results = new ICompletionProposal[0];
- if(collector != null) {
- results = collector.getJSPCompletionProposals();
- if (results == null || results.length < 1)
- fErrorMessage = JSPUIMessages.Java_Content_Assist_is_not_UI_;
- }
- return results;
- }
-
- protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- return new JSPProposalCollector(cu, translation);
- }
-
- /**
- * For debugging translation mapping only.
- *
- * @param translation
- */
- private String debug(JSPTranslation translation) {
- StringBuffer debugString = new StringBuffer();
- HashMap jsp2java = translation.getJsp2JavaMap();
- String javaText = translation.getJavaText();
- String jspText = fViewer.getDocument().get();
- debugString.append("[jsp2JavaMap in JSPCompletionProcessor]\r\n"); //$NON-NLS-1$
- debugString.append("jsp cursor position >> " + fViewer.getTextWidget().getCaretOffset() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- Iterator it = jsp2java.keySet().iterator();
- while (it.hasNext()) {
- try {
- Position jspPos = (Position) it.next();
- Position javaPos = (Position) jsp2java.get(jspPos);
- debugString.append("jsp > " + jspPos.offset + ":" + jspPos.length + ":" + jspText.substring(jspPos.offset, jspPos.offset + jspPos.length) + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- debugString.append("java > " + javaPos.offset + ":" + javaPos.length + ":" + javaText.substring(javaPos.offset, javaPos.offset + javaPos.length) + ":\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- debugString.append("-------------------------------------------------\n"); //$NON-NLS-1$
- }
- catch (Exception e) {
- // eat exceptions, it's only for debug
- }
- }
- return debugString.toString();
- }
-
- /**
- * 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 a string of characters which when pressed should automatically
- * display content-assist proposals.
- *
- * @return string of characters
- */
- public java.lang.String getAutoProposalInvocationCharacters() {
- return null;
- }
-
- /**
- * Returns a string of characters which when pressed should automatically
- * display a content-assist tip.
- *
- * @return string of characters
- */
- public java.lang.String getAutoTipInvocationCharacters() {
- 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;
- }
-
- protected int getDocumentPosition() {
- return fJspSourcePosition;
- }
-
- public String getErrorMessage() {
- // TODO: get appropriate error message
- // if (fCollector.getErrorMessage() != null &&
- // fCollector.getErrorMessage().length() > 0)
- // return fCollector.getErrorMessage();
- return fErrorMessage;
- }
-
- /**
- * Initialize the code assist processor.
- */
- protected void initialize(int pos) {
- initializeJavaPlugins();
-
- fJspSourcePosition = pos;
- fErrorMessage = null;
- }
-
- /**
- * Initialize the Java Plugins that the JSP processor requires.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=143765
- * We should not call "start", because that will cause that
- * state to be remembered, and re-started automatically during
- * the next boot up sequence.
- *
- * ISSUE: we may be able to get rid of this all together, in future,
- * since 99% we probably have already used some JDT class by the time
- * we need JDT to be active ... but ... this is the safest fix for
- * this point in 1.5 stream. Next release, let's just remove this,
- * re-discover what ever bug this was fixing (if any) and if there is
- * one, then we'll either put back in, as is, or come up with a
- * more appropriate fix.
- *
- */
- protected void initializeJavaPlugins() {
- try {
- Bundle bundle = Platform.getBundle(JDT_CORE_PLUGIN_ID);
- bundle.loadClass("dummyClassNameThatShouldNeverExist");
- }
- catch (ClassNotFoundException e) {
- // this is the expected result, we just want to
- // nudge the bundle to be sure its activated.
- }
- }
-
- public void release() {
- fTranslationAdapter = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
deleted file mode 100644
index 0229d51877..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-
-/**
- * Implements IJavaCompletionProposal for use with JSPProposalCollector.
- *
- * @plannedfor 1.0
- */
-public class JSPCompletionProposal extends CustomCompletionProposal implements IJavaCompletionProposal {
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
- *
- * This is a wrapped proposal so we don't need to
- * make "slow" calls to the java proposal up front, only when needed
- * for example, getAdditionalInfo() reads external javadoc, and it makes
- * no sense
- */
- ICompletionProposal fJavaCompletionProposal = null;
-
- public JSPCompletionProposal(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int relevance, boolean updateReplacementLengthOnValidate) {
- super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, relevance, updateReplacementLengthOnValidate);
- }
-
- /**
- * Sets cursor position after applying.
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- super.apply(viewer, trigger, stateMask, offset);
- }
-
- final public ICompletionProposal getJavaCompletionProposal() {
- return fJavaCompletionProposal;
- }
-
- final public void setJavaCompletionProposal(ICompletionProposal javaCompletionProposal) {
- fJavaCompletionProposal = javaCompletionProposal;
- }
-
- public String getAdditionalProposalInfo() {
-
- String additionalInfo = super.getAdditionalProposalInfo();
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- if(javaProposal != null)
- additionalInfo = javaProposal.getAdditionalProposalInfo();
-
- return additionalInfo;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
deleted file mode 100644
index ff39bb5cad..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
+++ /dev/null
@@ -1,1273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.JSPCMDocument;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryAction;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocumentTracker;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.NonValidatingModelQueryAction;
-import org.eclipse.wst.xml.ui.internal.contentassist.ProposalComparator;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistUtilities;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Adds proposals not normally covered by the generic behavior with the
- * content model
- *
- * @plannedfor 1.0
- */
-public class JSPContentAssistProcessor extends AbstractContentAssistProcessor {
-
- protected int depthCount = 0;
- protected ITextViewer fViewer = null;
- protected boolean useEmbeddedResults = true;
- protected boolean isInternalAdapter = false;
- protected HashMap fNameToProcessorMap = null;
- protected HashMap fPartitionToProcessorMap = null;
- private final ICompletionProposal[] EMPTY_PROPOSAL_SET = new ICompletionProposal[0];
- private JSPTemplateCompletionProcessor fTemplateProcessor = null;
- private List fTemplateContexts = new ArrayList();
-
- public JSPContentAssistProcessor() {
- super();
- initNameToProcessorMap();
- initPartitionToProcessorMap();
- }
-
- /**
- * init map for extra content assist processors (useBean,
- * get/setProperty). points [tagname > processor]
- */
- protected void initNameToProcessorMap() {
- fNameToProcessorMap = new HashMap();
- JSPPropertyContentAssistProcessor jspPropertyCAP = new JSPPropertyContentAssistProcessor();
- fNameToProcessorMap.put(JSP11Namespace.ElementName.SETPROPERTY, jspPropertyCAP);
- fNameToProcessorMap.put(JSP11Namespace.ElementName.GETPROPERTY, jspPropertyCAP);
- fNameToProcessorMap.put(JSP11Namespace.ElementName.USEBEAN, new JSPUseBeanContentAssistProcessor());
- }
-
- /**
- * int map that points [partition > processor]. This takes place of
- * embedded adapters for now.
- */
- protected void initPartitionToProcessorMap() {
- fPartitionToProcessorMap = new HashMap();
- HTMLContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
- JSPJavaContentAssistProcessor jspJavaProcessor = new JSPJavaContentAssistProcessor();
- XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor();
- JavaScriptContentAssistProcessor javascriptProcessor = new JavaScriptContentAssistProcessor();
-
- fPartitionToProcessorMap.put(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
- fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, xmlProcessor);
- fPartitionToProcessorMap.put(IStructuredPartitions.DEFAULT_PARTITION, htmlProcessor);
- fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT, jspJavaProcessor);
- fPartitionToProcessorMap.put(IJSPPartitions.JSP_DIRECTIVE, xmlProcessor);
- fPartitionToProcessorMap.put(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
- fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, javascriptProcessor);
- fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT_EL, jspJavaProcessor);
- fPartitionToProcessorMap.put(IHTMLPartitions.SCRIPT, javascriptProcessor); // default
- // to
- // javascript
- // for
- // all
- // script
- }
-
- protected void addCommentProposal(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addDocTypeProposal(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW);
-
- super.addEmptyDocumentProposals(contentAssistRequest);
- addTagInsertionProposals(contentAssistRequest, 0);
- }
-
- protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addEndTagProposals(ContentAssistRequest contentAssistRequest) {
- // do nothing
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE);
- }
-
- /**
- * add proposals for tags in attribute values
- */
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.ATTRIBUTE_VALUE);
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- // add JSP extra proposals from JSPBeanInfoContentAssistProcessor
- // JSPPropertyContentAssistProcessor
-
- // 2.1
- // get results from JSPUseBean and JSPProperty here
- // (look up processor in a map based on node name)
- JSPDummyContentAssistProcessor extraProcessor = (JSPDummyContentAssistProcessor) fNameToProcessorMap.get(node.getNodeName());
- if (extraProcessor != null && contentAssistRequest != null) {
- extraProcessor.addAttributeValueProposals(contentAssistRequest);
- }
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (mq != null) {
- CMDocument doc = mq.getCorrespondingCMDocument(node);
- // this shouldn't have to have the prefix coded in
- if (doc instanceof JSPCMDocument || doc instanceof CMNodeWrapper || node.getNodeName().startsWith("jsp:")) //$NON-NLS-1$
- return;
- }
-
- // Find the attribute name for which this position should have a value
- IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
- ITextRegionList openRegions = open.getRegions();
- int i = openRegions.indexOf(contentAssistRequest.getRegion());
- if (i < 0)
- return;
- ITextRegion nameRegion = null;
- while (i >= 0) {
- nameRegion = openRegions.get(i--);
- if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
- break;
- }
-
- String attributeName = null;
- if (nameRegion != null)
- attributeName = open.getText(nameRegion);
- String currentValue = null;
- if (attributeName != null)
- currentValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
-
- // on an empty value, add all the JSP and taglib tags
- if ((contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS && contentAssistRequest.getReplacementLength() == 0) || (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && (currentValue == null || currentValue.length() == 0))) {
- List rejectElements = new ArrayList();
- rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
- rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
- rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
- rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
- rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
- rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
- rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
- rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
- rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
- rejectElements.add(JSP12Namespace.ElementName.FORWARD);
- rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
- rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
- rejectElements.add(JSP12Namespace.ElementName.PARAMS);
-
- List additionalElements = getAdditionalChildren(new ArrayList(), node, -1);
- for (i = 0; i < additionalElements.size(); i++) {
- CMElementDeclaration ed = (CMElementDeclaration) additionalElements.get(i);
- if (rejectElements.contains(ed.getNodeName()))
- continue;
- String tagname = getContentGenerator().getRequiredName(node, ed);
- StringBuffer contents = new StringBuffer("\""); //$NON-NLS-1$
- getContentGenerator().generateTag(node, ed, contents);
- contents.append('"');
- CustomCompletionProposal proposal = new CustomCompletionProposal(contents.toString(), contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), contents.length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), tagname, null, null, XMLRelevanceConstants.R_JSP_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
-
- else if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- try {
- // Create a new model for Content Assist to operate on. This
- // will simulate
- // a full Document and then adjust the offset numbers in the
- // list of results.
- IStructuredModel internalModel = null;
- IModelManager mmanager = StructuredModelManager.getModelManager();
- internalModel = mmanager.createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSP);
- IDOMNode xmlNode = null;
- IDOMModel xmlOuterModel = null;
- if (contentAssistRequest.getNode() instanceof IDOMNode) {
- xmlNode = (IDOMNode) contentAssistRequest.getNode();
- xmlOuterModel = xmlNode.getModel();
- internalModel.setResolver(xmlOuterModel.getResolver());
- internalModel.setBaseLocation(xmlOuterModel.getBaseLocation());
- }
- String contents = StringUtils.strip(contentAssistRequest.getText());
- if (xmlNode != null && contents != null) {
- int additionalShifts = 0;
- // Be sure that custom tags from taglibs also show up
- // by
- // adding taglib declarations to the internal model.
- TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(xmlOuterModel.getStructuredDocument());
- if (mgr != null) {
- List trackers = mgr.getCMDocumentTrackers(contentAssistRequest.getReplacementBeginPosition());
- if (trackers != null) {
- for (i = 0; i < trackers.size(); i++) {
- CMDocumentTracker tracker = (CMDocumentTracker) trackers.get(i);
- String declaration = tracker.getStructuredDocumentRegion().getText();
- if (declaration != null) {
- contents = declaration + contents;
- additionalShifts += declaration.length();
- }
- }
- }
- }
- // Also copy any jsp:useBean tags so that
- // jsp:[gs]etProperty will function
- Document doc = null;
- if (contentAssistRequest.getNode().getNodeType() == Node.DOCUMENT_NODE)
- doc = (Document) node;
- else
- doc = node.getOwnerDocument();
- NodeList useBeans = doc.getElementsByTagName(JSP12Namespace.ElementName.USEBEAN);
- for (int k = 0; k < useBeans.getLength(); k++) {
- IDOMNode useBean = (IDOMNode) useBeans.item(k);
- if (useBean.getStartOffset() < contentAssistRequest.getReplacementBeginPosition()) {
- StringBuffer useBeanText = new StringBuffer("<jsp:useBean"); //$NON-NLS-1$
- for (int j = 0; j < useBean.getAttributes().getLength(); j++) {
- Attr attr = (Attr) useBean.getAttributes().item(j);
- useBeanText.append(' ');
- useBeanText.append(attr.getName());
- useBeanText.append("=\""); //$NON-NLS-1$
- useBeanText.append(attr.getValue());
- useBeanText.append('"');
- }
- useBeanText.append("/>"); //$NON-NLS-1$
- additionalShifts += useBeanText.length();
- contents = useBeanText.toString() + contents;
- }
- }
- internalModel.getStructuredDocument().set(contents);
- int internalOffset = 0;
- boolean quoted = false;
- // if quoted, use position inside and shift by one
- if (contentAssistRequest.getMatchString().length() > 0 && (contentAssistRequest.getMatchString().charAt(0) == '\'' || contentAssistRequest.getMatchString().charAt(0) == '"')) {
- internalOffset = contentAssistRequest.getMatchString().length() - 1 + additionalShifts;
- quoted = true;
- }
- // if unquoted, use position inside
- else if (contentAssistRequest.getMatchString().length() > 0 && contentAssistRequest.getMatchString().charAt(0) == '<')
- internalOffset = contentAssistRequest.getMatchString().length() + additionalShifts;
- else
- internalOffset = contentAssistRequest.getReplacementBeginPosition() - contentAssistRequest.getStartOffset() + additionalShifts;
- depthCount++;
- IndexedRegion internalNode = null;
- int tmpOffset = internalOffset;
- while (internalNode == null && tmpOffset >= 0)
- internalNode = internalModel.getIndexedRegion(tmpOffset--);
-
- if (internalModel.getFactoryRegistry() != null) {
- // set up the internal model
- if (internalModel.getFactoryRegistry().getFactoryFor(PageDirectiveAdapter.class) == null) {
- internalModel.getFactoryRegistry().addFactory(new PageDirectiveAdapterFactory());
- }
- PageDirectiveAdapter outerEmbeddedTypeAdapter = (PageDirectiveAdapter) xmlOuterModel.getDocument().getAdapterFor(PageDirectiveAdapter.class);
- PageDirectiveAdapter internalEmbeddedTypeAdapter = (PageDirectiveAdapter) ((INodeNotifier) ((Node) internalNode).getOwnerDocument()).getAdapterFor(PageDirectiveAdapter.class);
- internalEmbeddedTypeAdapter.setEmbeddedType(outerEmbeddedTypeAdapter.getEmbeddedType());
- }
-
- AdapterFactoryRegistry adapterRegistry = JSPUIPlugin.getDefault().getAdapterFactoryRegistry();
- Iterator adapterList = adapterRegistry.getAdapterFactories();
- // And all those appropriate for this particular type
- // of content
- while (adapterList.hasNext()) {
- try {
- AdapterFactoryProvider provider = (AdapterFactoryProvider) adapterList.next();
- if (provider.isFor(internalModel.getModelHandler())) {
- provider.addAdapterFactories(internalModel);
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- }
-
- /**
- * the internal adapter does all the real work of using
- * the JSP content model to form proposals
- */
- ICompletionProposal[] results = null;
- depthCount--;
- if (results != null) {
- for (i = 0; i < results.length; i++) {
- contentAssistRequest.addProposal(new CustomCompletionProposal(((CustomCompletionProposal) results[i]).getReplacementString(), ((CustomCompletionProposal) results[i]).getReplacementOffset() - additionalShifts + contentAssistRequest.getStartOffset() + (quoted ? 1 : 0), ((CustomCompletionProposal) results[i]).getReplacementLength(), ((CustomCompletionProposal) results[i]).getCursorPosition(), results[i].getImage(), results[i].getDisplayString(), ((CustomCompletionProposal) results[i]).getContextInformation(), ((CustomCompletionProposal) results[i]).getAdditionalProposalInfo(), (results[i] instanceof IRelevanceCompletionProposal) ? ((IRelevanceCompletionProposal) results[i]).getRelevance() : IRelevanceConstants.R_NONE));
- }
- }
- }
- }
- catch (Exception e) {
- Logger.logException("Error in embedded JSP Content Assist", e); //$NON-NLS-1$
- }
- }
-
-
- }
-
- private List getAdditionalChildren(List elementDecls, Node node, int childIndex) {
- if (node instanceof IDOMNode) {
- /*
- * find the location of the intended insertion as it will give us
- * the correct offset for checking position dependent CMDocuments
- */
- int textInsertionOffset = 0;
- NodeList children = node.getChildNodes();
- if (children.getLength() >= childIndex && childIndex >= 0) {
- Node nodeAlreadyAtIndex = children.item(childIndex);
- if (nodeAlreadyAtIndex instanceof IDOMNode)
- textInsertionOffset = ((IDOMNode) nodeAlreadyAtIndex).getEndOffset();
- }
- else {
- textInsertionOffset = ((IDOMNode) node).getStartOffset();
- }
- TLDCMDocumentManager mgr = TaglibController.getTLDCMDocumentManager(((IDOMNode) node).getStructuredDocument());
- if (mgr != null) {
- List moreCMDocuments = mgr.getCMDocumentTrackers(textInsertionOffset);
- if (moreCMDocuments != null) {
- for (int i = 0; i < moreCMDocuments.size(); i++) {
- CMDocument doc = (CMDocument) moreCMDocuments.get(i);
- CMNamedNodeMap elements = doc.getElements();
- if (elements != null) {
- for (int j = 0; j < elements.getLength(); j++) {
- CMElementDeclaration ed = (CMElementDeclaration) elements.item(j);
- elementDecls.add(ed);
- }
- }
- }
- }
- }
-
- // get position dependent CMDocuments and insert their tags as
- // proposals
-
- ModelQueryAdapter mqAdapter = null;
- if (node.getNodeType() == Node.DOCUMENT_NODE)
- mqAdapter = (ModelQueryAdapter) ((IDOMNode) node).getAdapterFor(ModelQueryAdapter.class);
- else
- mqAdapter = (ModelQueryAdapter) ((IDOMNode) node.getOwnerDocument()).getAdapterFor(ModelQueryAdapter.class);
-
- if (mqAdapter != null) {
- CMDocument doc = mqAdapter.getModelQuery().getCorrespondingCMDocument(node);
- if (doc != null) {
-
- CMDocument JCMDoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.JSP11_DOC_TYPE);
- CMNamedNodeMap jspelements = JCMDoc.getElements();
-
- if (jspelements != null) {
- List rejectElements = new ArrayList();
-
- // determine if the document is in XML form
- Document domDoc = null;
- if (node.getNodeType() == Node.DOCUMENT_NODE)
- domDoc = (Document) node;
- else
- domDoc = node.getOwnerDocument();
-
- // Show XML tag forms of JSP markers if jsp:root is
- // the document element OR it's HTML but
- // isn't really in the text.
- // If the document isn't strictly XML, pull out the
- // XML tag forms it is xml format
- rejectElements.add(JSP12Namespace.ElementName.SCRIPTLET);
- rejectElements.add(JSP12Namespace.ElementName.EXPRESSION);
- rejectElements.add(JSP12Namespace.ElementName.DECLARATION);
- rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_INCLUDE);
- rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
- rejectElements.add(JSP12Namespace.ElementName.TEXT);
- rejectElements.add(JSP12Namespace.ElementName.DIRECTIVE_TAGLIB);
-
- if (isXMLFormat(domDoc)) {
-
- // jsp actions
- rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
- rejectElements.add(JSP12Namespace.ElementName.USEBEAN);
- rejectElements.add(JSP12Namespace.ElementName.GETPROPERTY);
- rejectElements.add(JSP12Namespace.ElementName.SETPROPERTY);
- rejectElements.add(JSP12Namespace.ElementName.INCLUDE);
- rejectElements.add(JSP12Namespace.ElementName.FORWARD);
- rejectElements.add(JSP12Namespace.ElementName.PLUGIN);
- rejectElements.add(JSP12Namespace.ElementName.FALLBACK);
- rejectElements.add(JSP12Namespace.ElementName.PARAM);
- rejectElements.add(JSP12Namespace.ElementName.PARAMS);
- }
-
-
- // don't show jsp:root if a document element already
- // exists
- Element docElement = domDoc.getDocumentElement();
- if (docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() != null || ((IDOMNode) docElement).getEndStructuredDocumentRegion() != null)))) //$NON-NLS-1$
- rejectElements.add(JSP12Namespace.ElementName.ROOT);
-
- for (int j = 0; j < jspelements.getLength(); j++) {
- CMElementDeclaration ed = (CMElementDeclaration) jspelements.item(j);
- if (rejectElements.contains(ed.getNodeName()))
- continue;
- elementDecls.add(ed);
- }
-
- }
- }
- }
- }
- return elementDecls;
- }
-
- protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
- List list = new ArrayList();
- List additionalElements = getAdditionalChildren(new ArrayList(), parent, index);
- for (int i = 0; i < additionalElements.size(); i++) {
- ModelQueryAction insertAction = new NonValidatingModelQueryAction((CMElementDeclaration) additionalElements.get(i), ModelQueryAction.INSERT, 0, parent.getChildNodes().getLength(), null);
- list.add(insertAction);
- }
-
- // add allowed children of implicit tags that don't already exist
- NodeList children = parent.getChildNodes();
- List childNames = new ArrayList();
- if (children != null) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE)
- childNames.add(child.getNodeName().toLowerCase());
- }
- }
- List allActions = new ArrayList();
- Iterator iterator = list.iterator();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(parent.getOwnerDocument());
- while (iterator.hasNext()) {
- ModelQueryAction action = (ModelQueryAction) iterator.next();
- allActions.add(action);
- if (action.getCMNode() instanceof HTMLElementDeclaration) {
- HTMLElementDeclaration ed = (HTMLElementDeclaration) action.getCMNode();
- String ommission = (String) ed.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (!childNames.contains(ed.getNodeName().toLowerCase()) && ((ommission != null) && (ommission.equals(HTMLCMProperties.Values.OMIT_BOTH)))) {
- List implicitValidActions = new ArrayList();
- modelQuery.getInsertActions(parent, ed, 0, ModelQuery.INCLUDE_CHILD_NODES, ModelQuery.VALIDITY_NONE, implicitValidActions);
- if (implicitValidActions != null) {
- Iterator implicitValidActionsIterator = implicitValidActions.iterator();
- while (implicitValidActionsIterator.hasNext()) {
- ModelQueryAction insertAction = new NonValidatingModelQueryAction(((ModelQueryAction) implicitValidActionsIterator.next()).getCMNode(), ModelQueryAction.INSERT, 0, parent.getChildNodes().getLength(), null);
- allActions.add(insertAction);
- }
- }
- }
- }
- }
- return allActions;
- }
-
- protected List getAvailableRootChildren(Document document, int childIndex) {
- List list = new ArrayList();
- if (!isXMLFormat(document))
- getAdditionalChildren(list, document, childIndex);
- return list;
- }
-
- protected void init() {
- super.init();
- }
-
- public void setErrorMessage(String errorMessage) {
- if (depthCount == 0)
- fErrorMessage = errorMessage;
- }
-
- /**
- * This method is acting as a "catch all" for pulling together content
- * assist proposals from different Processors when document partitioning
- * alone couldn't determine definitively what content assist should show
- * up at that particular position in the document
- *
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
- fTemplateContexts.clear();
-
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) viewer, documentPosition);
- fViewer = viewer;
- ICompletionProposal[] jspResults = EMPTY_PROPOSAL_SET;
- ICompletionProposal[] embeddedResults = EMPTY_PROPOSAL_SET;
-
- // check the actual partition type
- String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
- IStructuredDocument structuredDocument = (IStructuredDocument) viewer.getDocument();
-
- IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
-
- // ////////////////////////////////////////////////////////////////////////////
- // ANOTHER WORKAROUND UNTIL PARTITIONING TAKES CARE OF THIS
- // check for xml-jsp tags...
- if (partitionType == IJSPPartitions.JSP_DIRECTIVE && fn != null) {
- IStructuredDocumentRegion possibleXMLJSP = ((fn.getType() == DOMRegionContext.XML_CONTENT) && fn.getPrevious() != null) ? fn.getPrevious() : fn;
- ITextRegionList regions = possibleXMLJSP.getRegions();
- if (regions.size() > 1) {
- // check bounds cases
- ITextRegion xmlOpenOrClose = regions.get(0);
- if (xmlOpenOrClose.getType() == DOMRegionContext.XML_TAG_OPEN && documentPosition == possibleXMLJSP.getStartOffset()) {
- // do regular jsp content assist
- }
- else if (xmlOpenOrClose.getType() == DOMRegionContext.XML_END_TAG_OPEN && documentPosition > possibleXMLJSP.getStartOffset()) {
- // do regular jsp content assist
- }
- else {
- // possible xml-jsp
- ITextRegion nameRegion = regions.get(1);
- String name = possibleXMLJSP.getText(nameRegion);
- if (name.equals("jsp:scriptlet") || name.equals("jsp:expression") || name.equals("jsp:declaration")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- }
- }
-
- // ////////////////////////////////////////////////////////////////////////////
- // ** THIS IS A TEMP FIX UNTIL PARTITIONING TAKES CARE OF THIS...
- // check for XML-JSP in a <script> region
- if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
- // fn should be block text
- IStructuredDocumentRegion decodedSDRegion = decodeScriptBlock(fn.getFullText());
- // System.out.println("decoded > " +
- // blockOfText.substring(decodedSDRegion.getStartOffset(),
- // decodedSDRegion.getEndOffset()));
- if (decodedSDRegion != null) {
- IStructuredDocumentRegion sdr = decodedSDRegion;
- while (sdr != null) {
- // System.out.println("sdr " + sdr.getType());
- // System.out.println("sdr > " +
- // blockOfText.substring(sdr.getStartOffset(),
- // sdr.getEndOffset()));
- if (sdr.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
- if (documentPosition >= fn.getStartOffset() + sdr.getStartOffset() && documentPosition <= fn.getStartOffset() + sdr.getEndOffset()) {
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- else if (sdr.getType() == DOMRegionContext.XML_TAG_NAME) {
- if (documentPosition > fn.getStartOffset() + sdr.getStartOffset() && documentPosition < fn.getStartOffset() + sdr.getEndOffset()) {
- return EMPTY_PROPOSAL_SET;
- }
- else if (documentPosition == fn.getStartOffset() + sdr.getEndOffset() && sdr.getNext() != null && sdr.getNext().getType() == DOMJSPRegionContexts.JSP_CONTENT) {
- // the end of an open tag <script>
- // <jsp:scriptlet>| blah </jsp:scriptlet>
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- else if (documentPosition == fn.getStartOffset() + sdr.getStartOffset() && sdr.getPrevious() != null && sdr.getPrevious().getType() == DOMRegionContext.XML_TAG_NAME) {
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- sdr = sdr.getNext();
- }
- }
- }
- // /////////////////////////////////////////////////////////////////////////
- // check special JSP delimiter cases
- if (fn != null && partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) {
- IStructuredDocumentRegion fnDelim = fn;
-
- // if it's a nested JSP region, need to get the correct
- // StructuredDocumentRegion
- // not sure why this check was there...
- // if (fnDelim.getType() == XMLRegionContext.BLOCK_TEXT) {
- Iterator blockRegions = fnDelim.getRegions().iterator();
- ITextRegion temp = null;
- ITextRegionContainer trc;
- while (blockRegions.hasNext()) {
- temp = (ITextRegion) blockRegions.next();
- // we hit a nested
- if (temp instanceof ITextRegionContainer) {
- trc = (ITextRegionContainer) temp;
- // it's in this region
- if (documentPosition >= trc.getStartOffset() && documentPosition < trc.getEndOffset()) {
- Iterator nestedJSPRegions = trc.getRegions().iterator();
- while (nestedJSPRegions.hasNext()) {
- temp = (ITextRegion) nestedJSPRegions.next();
- if (XMLContentAssistUtilities.isJSPOpenDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
- // HTML content assist
- // we actually want content assist for the
- // previous type of region,
- // well get those proposals from the embedded
- // adapter
- if (documentPosition > 0) {
- partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
- break;
- }
- }
- else if (XMLContentAssistUtilities.isJSPCloseDelimiter(temp.getType()) && documentPosition == trc.getStartOffset(temp)) {
- // JSP content assist
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- }
- }
- // }
- }
-
- // take care of XML-JSP delimter cases
- if (XMLContentAssistUtilities.isXMLJSPDelimiter(fnDelim)) {
- // since it's a delimiter, we know it's a ITextRegionContainer
- ITextRegion firstRegion = fnDelim.getRegions().get(0);
- if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN)) {
- // |<jsp:scriptlet> </jsp:scriptlet>
- // (pa) commented out so that we get regular behavior JSP
- // macros etc...
- // return getHTMLCompletionProposals(viewer,
- // documentPosition);
- }
- else if (fnDelim.getStartOffset() == documentPosition && (firstRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN)) {
- // <jsp:scriptlet> |</jsp:scriptlet>
- // check previous partition type to see if it's JAVASCRIPT
- // if it is, we're just gonna let the embedded JAVASCRIPT
- // adapter get the proposals
- if (documentPosition > 0) {
- String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
- if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this
- // check
- // is
- // failing
- // for
- // XML-JSP
- // (region
- // is
- // not
- // javascript...)
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
- }
- }
- else if ((firstRegion.getType() == DOMRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) {
- // anything else inbetween
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- else if (XMLContentAssistUtilities.isJSPDelimiter(fnDelim)) {
- // the delimiter <%, <%=, <%!, ...
- if (XMLContentAssistUtilities.isJSPCloseDelimiter(fnDelim)) {
- if (documentPosition == fnDelim.getStartOffset()) {
- // check previous partition type to see if it's
- // JAVASCRIPT
- // if it is, we're just gonna let the embedded
- // JAVASCRIPT adapter get the proposals
- if (documentPosition > 0) {
- String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1);
- if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) {
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
- }
- }
- }
- else if (XMLContentAssistUtilities.isJSPOpenDelimiter(fnDelim)) {
- // if it's the first position of open delimiter
- // use embedded HTML results
- if (documentPosition == fnDelim.getStartOffset()) {
- embeddedResults = getHTMLCompletionProposals(viewer, documentPosition);
- }
- else if (documentPosition == fnDelim.getEndOffset()) {
- // it's at the EOF <%|
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- }
- }
-
- // need to check if it's JSP region inside of CDATA w/ no region
- // <![CDATA[ <%|%> ]]>
- // or a comment region
- // <!-- <% |%> -->
- if (fn != null && (fn.getType() == DOMRegionContext.XML_CDATA_TEXT || fn.getType() == DOMRegionContext.XML_COMMENT_TEXT)) {
- if (fn instanceof ITextRegionContainer) {
- Object[] cdataRegions = fn.getRegions().toArray();
- ITextRegion r = null;
- ITextRegion jspRegion = null;
- for (int i = 0; i < cdataRegions.length; i++) {
- r = (ITextRegion) cdataRegions[i];
- if (r instanceof ITextRegionContainer) {
- // CDATA embedded container, or comment container
- Object[] jspRegions = ((ITextRegionContainer) r).getRegions().toArray();
- for (int j = 0; j < jspRegions.length; j++) {
- jspRegion = (ITextRegion) jspRegions[j];
- if (jspRegion.getType() == DOMJSPRegionContexts.JSP_CLOSE) {
- if (sdRegion.getStartOffset(jspRegion) == documentPosition)
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- }
- }
- }
- }
-
- }
- }
-
- // check if it's in an attribute value, if so, don't add CDATA
- // proposal
- ITextRegion attrContainer = (fn != null) ? fn.getRegionAtCharacterOffset(documentPosition) : null;
- if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
- if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- // test location of the cursor
- // return null if it's in the middle of an open/close
- // delimeter
- Iterator attrRegions = ((ITextRegionContainer) attrContainer).getRegions().iterator();
- ITextRegion testRegion = null;
- while (attrRegions.hasNext()) {
- testRegion = (ITextRegion) attrRegions.next();
- // need to check for other valid attribute regions
- if (XMLContentAssistUtilities.isJSPOpenDelimiter(testRegion.getType())) {
- if (!(((ITextRegionContainer) attrContainer).getEndOffset(testRegion) <= documentPosition))
- return EMPTY_PROPOSAL_SET;
- }
- else if (XMLContentAssistUtilities.isJSPCloseDelimiter(testRegion.getType())) {
- if (!(((ITextRegionContainer) attrContainer).getStartOffset(testRegion) >= documentPosition))
- return EMPTY_PROPOSAL_SET;
- }
- }
- // TODO: handle non-Java code such as nested tags
- if (testRegion.getType().equals(DOMJSPRegionContexts.JSP_CONTENT))
- return getJSPJavaCompletionProposals(viewer, documentPosition);
- return EMPTY_PROPOSAL_SET;
- }
- }
-
- IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
- if (p != null) {
- embeddedResults = p.computeCompletionProposals(viewer, documentPosition);
- // get bean methods, objects, and constants if there are any...
- if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) {
- ICompletionProposal[] beanResults = getJSPJavaBeanProposals(viewer, documentPosition);
- if (beanResults != null && beanResults.length > 0) {
- ICompletionProposal[] added = new ICompletionProposal[beanResults.length + embeddedResults.length];
- System.arraycopy(beanResults, 0, added, 0, beanResults.length);
- System.arraycopy(embeddedResults, 0, added, beanResults.length, embeddedResults.length);
- embeddedResults = added;
- }
- }
- }
- else {
- // the partition type is probably not mapped
- }
-
- // fix for:
- // HTML content assist give JSP tags in between empty script tags
- if (!(p instanceof JavaScriptContentAssistProcessor || p instanceof CSSContentAssistProcessor)) {
- fTemplateContexts.clear();
- jspResults = super.computeCompletionProposals(viewer, documentPosition);
- }
- if (useEmbeddedResults) {
- if (embeddedResults != null && embeddedResults.length > 0) {
- List results = new ArrayList();
- for (int i = 0; i < embeddedResults.length; i++)
- results.add(embeddedResults[i]);
- if (jspResults != null) {
- for (int i = 0; i < jspResults.length; i++)
- results.add(jspResults[i]);
- }
- jspResults = new ICompletionProposal[results.size()];
- Collections.sort(results, new ProposalComparator());
- for (int i = 0; i < results.size(); i++)
- jspResults[i] = (ICompletionProposal) results.get(i);
-
- }
- }
- if (jspResults == null)
- jspResults = EMPTY_PROPOSAL_SET;
- setErrorMessage(jspResults.length == 0 ? UNKNOWN_CONTEXT : null);
-
- // fix for:
- // check for |<%-- --%> first position of jsp comment
- if (partitionType == IJSPPartitions.JSP_COMMENT) {
- if (sdRegion.getStartOffset() == documentPosition) {
- ICompletionProposal[] htmlResults = getHTMLCompletionProposals(viewer, documentPosition);
- jspResults = merge(jspResults, htmlResults);
- }
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=86656
- if (partitionType == IJSPPartitions.JSP_DIRECTIVE) {
- ICompletionProposal[] importProposals = getImportProposals(viewer, documentPosition);
- if (importProposals.length > 0)
- jspResults = merge(jspResults, importProposals);
- }
- return jspResults;
- }
-
- private ICompletionProposal[] getImportProposals(ITextViewer viewer, int documentPosition) {
- List importProposals = new ArrayList();
- ICompletionProposal[] proposals = getJSPJavaCompletionProposals(viewer, documentPosition);
- for (int i = 0; i < proposals.length; i++) {
- if (proposals[i] instanceof JSPCompletionProposal) {
-
- ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals[i]);
- importProposals.add(importProposal);
- }
- }
- return (ICompletionProposal[]) importProposals.toArray(new ICompletionProposal[importProposals.size()]);
- }
-
-
- private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
-
- // just need to remove the ";"
- // and adjust offsets for the change
- String newReplace = importProposal.getReplacementString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
- importProposal.setReplacementString(newReplace);
-
- String newDisplay = importProposal.getDisplayString().replaceAll(";", ""); //$NON-NLS-1$ //$NON-NLS-2$
- importProposal.setDisplayString(newDisplay);
-
- int newReplacementLength = importProposal.getReplacementLength() - 1;
- importProposal.setReplacementLength(newReplacementLength);
-
- int newCursorPosition = importProposal.getCursorPosition() - 1;
- importProposal.setCursorPosition(newCursorPosition);
-
- return importProposal;
- }
-
- /**
- * Adds 2 arrays of ICompletionProposals and sorts them with a
- * ProposalComparator.
- *
- * @param jspResults
- * @param htmlResults
- * @return
- */
- private ICompletionProposal[] merge(ICompletionProposal[] jspResults, ICompletionProposal[] htmlResults) {
- List results = new ArrayList();
- List jsps = Arrays.asList(jspResults);
- List htmls = Arrays.asList(htmlResults);
-
- results.addAll(jsps);
- results.addAll(htmls);
-
- Collections.sort(results, new ProposalComparator());
- return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]);
- }
-
- /*
- * This method will return JSPJava Proposals that are relevant to any java
- * beans that in scope at the documentPosition
- *
- * TODO (pa) are taglib vars getting filtered?
- *
- * @param viewer @param documentPosition @return ICompletionProposal[]
- */
- private ICompletionProposal[] getJSPJavaBeanProposals(ITextViewer viewer, int documentPosition) {
- ICompletionProposal[] regularJSPResults = getJSPJavaCompletionProposals(viewer, documentPosition);
- Vector filteredProposals = new Vector();
- ICompletionProposal[] finalResults = EMPTY_PROPOSAL_SET;
- for (int i = 0; i < regularJSPResults.length; i++) {
- ICompletionProposal test = regularJSPResults[i];
-
- System.out.println("proposal > " + test.getDisplayString()); //$NON-NLS-1$
- System.out.println("relevance > " + ((CustomCompletionProposal) test).getRelevance()); //$NON-NLS-1$
-
- if (isRelevanceAllowed(((CustomCompletionProposal) test).getRelevance())) {
- filteredProposals.add(test);
- }
- }
- if (filteredProposals.size() > 0) {
- finalResults = new ICompletionProposal[filteredProposals.size()];
- Iterator it = filteredProposals.iterator();
- int j = 0;
- while (it.hasNext()) {
- finalResults[j++] = (ICompletionProposal) it.next();
- }
- }
- return finalResults;
- }
-
- // These are the only things I'm allowing for use bean if the language is
- // JAVASCRIPT
- // I'm filtering based on JavaContentAssistProposal relevance
- //
- // 485 > method that belongs to the bean
- // 486 > bean object
- // 386 > bean CONSTANT
- private boolean isRelevanceAllowed(int relevance) {
- return (relevance == 485 || relevance == 486 || relevance == 326);
- }
-
-
- /**
- *
- * @param viewer
- * @param documentPosition
- * @return ICompletionProposal[]
- */
- private ICompletionProposal[] getHTMLCompletionProposals(ITextViewer viewer, int documentPosition) {
-
- IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT);
- return p.computeCompletionProposals(viewer, documentPosition);
- }
-
- /**
- *
- * @param viewer
- * @param documentPosition
- * @return ICompletionProposal[]
- */
- protected ICompletionProposal[] getJSPJavaCompletionProposals(ITextViewer viewer, int documentPosition) {
- JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitions.JSP_DEFAULT);
- return p.computeCompletionProposals(viewer, documentPosition);
- }
-
- /**
- * @param viewer
- * @param documentPosition
- * @return String
- */
- protected String getPartitionType(StructuredTextViewer viewer, int documentPosition) {
- String partitionType = null;
- try {
- partitionType = TextUtilities.getContentType(viewer.getDocument(), IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, viewer.modelOffset2WidgetOffset(documentPosition), false);
- }
- catch (BadLocationException e) {
- partitionType = IDocument.DEFAULT_CONTENT_TYPE;
- }
- return partitionType;
- }
-
- /*
- * ** TEMP WORKAROUND FOR CMVC 241882 Takes a String and blocks out
- * jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
- * @return
- */
- private IStructuredDocumentRegion decodeScriptBlock(String blockText) {
- XMLSourceParser parser = new XMLSourceParser();
- // use JSP_CONTENT for region type
- parser.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
- parser.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
- parser.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false, false)); //$NON-NLS-1$
- parser.reset(blockText);
- return parser.getDocumentRegions();
- }
-
- /*
- * @see ContentAssistAdapter#computeContextInformation(ITextViewer, int,
- * IndexedRegion)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset, IndexedRegion indexedNode) {
- return super.computeContextInformation(viewer, documentOffset);
- }
-
- /*
- * @see ContentAssistAdapter#getContextInformationAutoActivationCharacters()
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return super.getContextInformationAutoActivationCharacters();
- }
-
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- IPreferenceStore store = JSPUIPlugin.getDefault().getPreferenceStore();
- String key = JSPUIPreferenceNames.AUTO_PROPOSE_CODE;
-
- String chars = store.getString(key);
- return (chars != null) ? chars.toCharArray() : new char[0];
- }
-
- /*
- * @see ContentAssistAdapter#getContextInformationValidator()
- */
- public IContextInformationValidator getContextInformationValidator() {
- return super.getContextInformationValidator();
- }
-
- protected boolean isXMLFormat(Document doc) {
- if (doc == null)
- return false;
- Element docElement = doc.getDocumentElement();
- return docElement != null && ((docElement.getNodeName().equals("jsp:root")) || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$
- }
-
- /*
- * @see ContentAssistAdapter#release()
- */
- public void release() {
- super.release();
- // release *ContentAssistProcessors in maps
- // CMVC 254023
- releasePartitionToProcessorMap();
- releaseNameToProcessorMap();
- }
-
- protected void releasePartitionToProcessorMap() {
- releaseMap(fPartitionToProcessorMap);
- }
-
- protected void releaseNameToProcessorMap() {
- releaseMap(fNameToProcessorMap);
- }
-
- protected void releaseMap(HashMap map) {
- if (map != null) {
- if (!map.isEmpty()) {
- Iterator it = map.keySet().iterator();
- Object key = null;
- while (it.hasNext()) {
- key = it.next();
- if (map.get(key) instanceof IReleasable) {
- ((IReleasable) map.get(key)).release();
- }
- }
- }
- map.clear();
- map = null;
- }
- }
-
- /**
- * @see AbstractContentAssistProcessor#computeCompletionProposals(int,
- * String, ITextRegion, IDOMNode, IDOMNode)
- */
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
-
- ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) fTextViewer, documentPosition);
-
- Document doc = null;
- if (xmlnode != null) {
- if (xmlnode.getNodeType() == Node.DOCUMENT_NODE)
- doc = (Document) xmlnode;
- else
- doc = xmlnode.getOwnerDocument();
- }
- String[] directiveNames = {"page", "include", "taglib"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- // suggest JSP Expression inside of XML comments
- if (completionRegion.getType() == DOMRegionContext.XML_COMMENT_TEXT && !isXMLFormat(doc)) {
- if (request == null)
- request = newContentAssistRequest(treeNode, xmlnode, sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- request.addProposal(new CustomCompletionProposal("<%= %>", documentPosition, 0, 4, JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), "jsp:expression", null, "&lt;%= %&gt;", XMLRelevanceConstants.R_JSP)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- // handle proposals in and around JSP_DIRECTIVE_OPEN and
- // JSP_DIRECTIVE_NAME
- else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN && documentPosition >= sdRegion.getTextEndOffset(completionRegion)) || (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME && documentPosition <= sdRegion.getTextEndOffset(completionRegion))) {
- if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) {
- if (request == null)
- request = newContentAssistRequest(xmlnode, xmlnode, sdRegion, completionRegion, documentPosition, 0, matchString);
- Iterator regions = sdRegion.getRegions().iterator();
- String nameString = null;
- int begin = request.getReplacementBeginPosition();
- int length = request.getReplacementLength();
- while (regions.hasNext()) {
- ITextRegion region = (ITextRegion) regions.next();
- if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- nameString = sdRegion.getText(region);
- begin = sdRegion.getStartOffset(region);
- length = region.getTextLength();
- break;
- }
- }
- if (nameString == null)
- nameString = ""; //$NON-NLS-1$
- for (int i = 0; i < directiveNames.length; i++) {
- if (directiveNames[i].startsWith(nameString) || documentPosition <= begin)
- request.addProposal(new CustomCompletionProposal(directiveNames[i], begin, length, directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
- }
- }
- else { // by default, JSP_DIRECTIVE_NAME
- if (request == null)
- request = newContentAssistRequest(xmlnode, xmlnode, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- for (int i = 0; i < directiveNames.length; i++) {
- if (directiveNames[i].startsWith(matchString))
- request.addProposal(new CustomCompletionProposal(directiveNames[i], request.getReplacementBeginPosition(), request.getReplacementLength(), directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
- }
- }
- }
- else if ((completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME && documentPosition > sdRegion.getTextEndOffset(completionRegion)) || (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE && documentPosition <= sdRegion.getStartOffset(completionRegion))) {
- if (request == null)
- request = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- super.addTagCloseProposals(request);
- // CMVC 274033, this is being added for all <jsp:* tags
- // in addAttributeNameProposals(contentAssistRequest)
- // super.addAttributeNameProposals(request);
- }
- // no name?: <%@ %>
- else if (completionRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE && documentPosition <= sdRegion.getStartOffset(completionRegion)) {
- if (request != null)
- request = computeAttributeProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- Iterator regions = sdRegion.getRegions().iterator();
- String nameString = null;
- while (regions.hasNext()) {
- ITextRegion region = (ITextRegion) regions.next();
- if (region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- nameString = sdRegion.getText(region);
- break;
- }
- }
- if (nameString == null) {
- for (int i = 0; i < directiveNames.length; i++) {
- request.addProposal(new CustomCompletionProposal(directiveNames[i], request.getReplacementBeginPosition(), request.getReplacementLength(), directiveNames[i].length(), JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_GENERIC), directiveNames[i], null, null, XMLRelevanceConstants.R_JSP));
- }
- }
- }
-
- // bug115927 use original document position for all/any region templates
- addTemplates(request, TemplateContextTypeIdsJSP.ALL, documentPosition);
- return request;
- }
-
- private JSPTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new JSPTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
- addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
- if (contentAssistRequest == null)
- return;
-
- // if already adding template proposals for a certain context type, do
- // not add again
- if (!fTemplateContexts.contains(context)) {
- fTemplateContexts.add(context);
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
-
- if (getTemplateCompletionProcessor() != null) {
- getTemplateCompletionProcessor().setContextType(context);
- ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
- for (int i = 0; i < proposals.length; ++i) {
- if (useProposalList)
- contentAssistRequest.addProposal(proposals[i]);
- else
- contentAssistRequest.addMacro(proposals[i]);
- }
- }
- }
- }
-
- protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
- // ignore
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.TAG);
-
- super.addTagInsertionProposals(contentAssistRequest, childPosition);
- if (isInternalAdapter)
- useEmbeddedResults = false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
deleted file mode 100644
index 19f2aa5619..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-import java.util.List;
-import java.util.Properties;
-import java.util.Vector;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This class is a "null" version of AbstractContentAssistProcessor
- *
- * @plannedfor 1.0
- */
-public class JSPDummyContentAssistProcessor extends AbstractContentAssistProcessor {
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- super.addAttributeNameProposals(contentAssistRequest);
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- super.addAttributeValueProposals(contentAssistRequest);
- }
-
-
- protected void addCommentProposal(ContentAssistRequest contentAssistRequest) {
- super.addCommentProposal(contentAssistRequest);
- }
-
-
- protected void addContent(List contentList, CMContent content) {
- super.addContent(contentList, content);
- }
-
-
- protected void addDocTypeProposal(ContentAssistRequest contentAssistRequest) {
- super.addDocTypeProposal(contentAssistRequest);
- }
-
-
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- super.addEmptyDocumentProposals(contentAssistRequest);
- }
-
-
- protected void addEndTagNameProposals(ContentAssistRequest contentAssistRequest) {
- super.addEndTagNameProposals(contentAssistRequest);
- }
-
-
- protected void addEndTagProposals(ContentAssistRequest contentAssistRequest) {
- super.addEndTagProposals(contentAssistRequest);
- }
-
-
- protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
- super.addEntityProposals(contentAssistRequest, documentPosition, completionRegion, treeNode);
- }
-
-
- protected void addEntityProposals(Vector proposals, Properties map, String key, int nodeOffset, IStructuredDocumentRegion parent, ITextRegion completionRegion) {
- super.addEntityProposals(proposals, map, key, nodeOffset, parent, completionRegion);
- }
-
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- super.addPCDATAProposal(nodeName, contentAssistRequest);
- }
-
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- super.addStartDocumentProposals(contentAssistRequest);
- }
-
-
- protected void addTagCloseProposals(ContentAssistRequest contentAssistRequest) {
- super.addTagCloseProposals(contentAssistRequest);
- }
-
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- super.addTagInsertionProposals(contentAssistRequest, childPosition);
- }
-
-
- protected void addTagNameProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- super.addTagNameProposals(contentAssistRequest, childPosition);
- }
-
- protected boolean attributeInList(IDOMNode node, Node parent, CMNode cmnode) {
- return super.attributeInList(node, parent, cmnode);
- }
-
-
- protected boolean beginsWith(String aString, String prefix) {
- return super.beginsWith(aString, prefix);
- }
-
-
- protected ContentAssistRequest computeAttributeProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeAttributeProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
-
- protected ContentAssistRequest computeAttributeValueProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeAttributeValueProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
-
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
- return super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- }
-
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- return super.computeCompletionProposals(viewer, documentOffset);
- }
-
-
- protected ContentAssistRequest computeContentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeContentProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- return super.computeContextInformation(viewer, documentOffset);
- }
-
- protected ContentAssistRequest computeEndTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeEndTagOpenProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
-
- protected ICompletionProposal[] computeEntityReferenceProposals(int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
- return super.computeEntityReferenceProposals(documentPosition, completionRegion, treeNode);
- }
-
- protected ContentAssistRequest computeEqualsProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeEqualsProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
- protected ContentAssistRequest computeStartDocumentProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeStartDocumentProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
- protected ContentAssistRequest computeTagCloseProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeTagCloseProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
- protected ContentAssistRequest computeTagNameProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeTagNameProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
- protected ContentAssistRequest computeTagOpenProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode nodeAtOffset, IDOMNode node) {
- return super.computeTagOpenProposals(documentPosition, matchString, completionRegion, nodeAtOffset, node);
- }
-
- protected String getAdditionalInfo(CMNode parentOrOwner, CMNode cmnode) {
- return super.getAdditionalInfo(parentOrOwner, cmnode);
- }
-
- protected List getAvailableChildrenAtIndex(Element parent, int index, int validityChecking) {
- return super.getAvailableChildrenAtIndex(parent, index, validityChecking);
- }
-
- protected List getAvailableRootChildren(Document document, int childIndex) {
- return super.getAvailableRootChildren(document, childIndex);
- }
-
- protected CMElementDeclaration getCMElementDeclaration(Node node) {
- return super.getCMElementDeclaration(node);
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- return super.getCompletionProposalAutoActivationCharacters();
- }
-
- protected ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion flatNode) {
- return super.getCompletionRegion(offset, flatNode);
- }
-
- protected ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
- return super.getCompletionRegion(documentPosition, domnode);
- }
-
- public XMLContentModelGenerator getContentGenerator() {
- return super.getContentGenerator();
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- return super.getContextInformationAutoActivationCharacters();
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- return super.getContextInformationValidator();
- }
-
- protected int getElementPosition(Node child) {
- return super.getElementPosition(child);
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
- */
- public String getErrorMessage() {
- return super.getErrorMessage();
- }
-
- protected String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
- return super.getMatchString(parent, aRegion, offset);
- }
-
- protected ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
- return super.getNameRegion(flatNode);
- }
-
-
- protected List getPossibleDataTypeValues(Node node, CMAttributeDeclaration ad) {
- return super.getPossibleDataTypeValues(node, ad);
- }
-
-
- protected String getRequiredName(Node parentOrOwner, CMNode cmnode) {
- return super.getRequiredName(parentOrOwner, cmnode);
- }
-
- protected String getRequiredText(Node parentOrOwner, CMAttributeDeclaration attrDecl) {
- return super.getRequiredText(parentOrOwner, attrDecl);
- }
-
- protected String getRequiredText(Node parentOrOwner, CMElementDeclaration elementDecl) {
- return super.getRequiredText(parentOrOwner, elementDecl);
- }
-
- protected List getValidChildElementDeclarations(Element parent, int childPosition, int kindOfAction) {
- return super.getValidChildElementDeclarations(parent, childPosition, kindOfAction);
- }
-
- protected void init() {
- super.init();
- }
-
- protected boolean isCloseRegion(ITextRegion region) {
- return super.isCloseRegion(region);
- }
-
- protected boolean isNameRegion(ITextRegion region) {
- return super.isNameRegion(region);
- }
-
- protected boolean isQuote(String string) {
- return super.isQuote(string);
- }
-
- protected Properties mapToProperties(CMNamedNodeMap map) {
- return super.mapToProperties(map);
- }
-
- public void setErrorMessage(String errorMessage) {
- super.setErrorMessage(errorMessage);
- }
-
- protected void setErrorMessage(String errorMessage, String append) {
- super.setErrorMessage(errorMessage, append);
- }
-
- protected void setErrorMessage(String errorMessage, String prepend, String append) {
- super.setErrorMessage(errorMessage, prepend, append);
- }
-
- protected boolean stringsEqual(String a, String b) {
- return super.stringsEqual(a, b);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
deleted file mode 100644
index 0ef4b79b2b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELCompletionProcessor.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-
-public class JSPELCompletionProcessor extends JSPCompletionProcessor {
- protected JSPProposalCollector getProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- return new JSPELProposalCollector(cu, translation);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
deleted file mode 100644
index 0d717f2506..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentImpl;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDFunction;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTFunctionInvocation;
-import org.eclipse.jst.jsp.core.internal.java.jspel.FindFunctionInvocationVisitor;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserConstants;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParserTokenManager;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
-import org.eclipse.jst.jsp.core.internal.java.jspel.SimpleCharStream;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class JSPELContentAssistProcessor extends JSPJavaContentAssistProcessor {
- protected char elCompletionProposalAutoActivationCharacters[] = new char[]{'.', ':'};
-
- protected JSPCompletionProcessor getJspCompletionProcessor() {
- if (fJspCompletionProcessor == null) {
- fJspCompletionProcessor = new JSPELCompletionProcessor();
- }
- return fJspCompletionProcessor;
- }
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {
-
-
- // get results from JSP completion processor
- fJspCompletionProcessor = getJspCompletionProcessor();
- ICompletionProposal[] results = fJspCompletionProcessor.computeCompletionProposals(viewer, documentPosition);
- fErrorMessage = fJspCompletionProcessor.getErrorMessage();
- if (results.length == 0 && (fErrorMessage == null || fErrorMessage.length() == 0)) {
- fErrorMessage = UNKNOWN_CONTEXT;
- }
-
- IStructuredDocumentRegion flat = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) viewer, documentPosition);
-
- if (flat != null) {
- ITextRegion cursorRegion = flat.getRegionAtCharacterOffset(documentPosition);
- if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE == cursorRegion.getType()) {
- ITextRegionContainer container = (ITextRegionContainer) cursorRegion;
- cursorRegion = container.getRegionAtCharacterOffset(documentPosition);
- if (cursorRegion.getType() == DOMJSPRegionContexts.JSP_EL_CONTENT) {
- String elText = container.getText(cursorRegion).trim();
- String prefix = getPrefix(documentPosition - container.getStartOffset(cursorRegion) - 1, elText);
- if (null != prefix) {
- List proposals = getFunctionProposals(prefix, (StructuredTextViewer) viewer, documentPosition);
- results = new ICompletionProposal[proposals.size()];
- proposals.toArray(results);
- }
- }
- }
- }
-
-
- return results;
- }
-
- protected String getPrefix(int relativePosition, String elText) {
- java.io.StringReader reader = new java.io.StringReader(elText);
- JSPELParserTokenManager scanner = new JSPELParserTokenManager(new SimpleCharStream(reader, 1, 1));
- Token curToken = null, lastIdentifier = null;
- while (JSPELParserConstants.EOF != (curToken = scanner.getNextToken()).kind) {
- if (JSPELParserConstants.COLON == curToken.kind && curToken.endColumn == relativePosition && null != lastIdentifier) {
- return (lastIdentifier.image);
- }
-
- if (JSPELParserConstants.IDENTIFIER == curToken.kind) {
- lastIdentifier = curToken;
- }
- else {
- lastIdentifier = null;
- }
- }
- return null;
- }
-
- protected ASTFunctionInvocation getInvocation(int relativePosition, String elText) {
- FindFunctionInvocationVisitor visitor = new FindFunctionInvocationVisitor(relativePosition);
- JSPELParser parser = JSPELParser.createParser(elText);
- try {
- ASTExpression expression = parser.Expression();
- return (ASTFunctionInvocation) expression.jjtAccept(visitor, null);
- }
- catch (ParseException e) { /* parse exception = no completion */
- }
- return (null);
- }
-
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- return elCompletionProposalAutoActivationCharacters;
- }
-
- protected List getFunctionProposals(String prefix, StructuredTextViewer viewer, int offset) {
- TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(viewer.getDocument());
- ArrayList completionList = new ArrayList();
- if (docMgr == null)
- return null;
-
- Iterator taglibs = docMgr.getCMDocumentTrackers(offset).iterator();
- while (taglibs.hasNext()) {
- TaglibTracker tracker = (TaglibTracker) taglibs.next();
- if (tracker.getPrefix().equals(prefix)) {
- CMDocumentImpl doc = (CMDocumentImpl) tracker.getDocument();
-
- List functions = doc.getFunctions();
- for (Iterator it = functions.iterator(); it.hasNext();) {
- TLDFunction function = (TLDFunction) it.next();
- CustomCompletionProposal proposal = new CustomCompletionProposal(function.getName() + "()", //$NON-NLS-1$
- offset, 0, function.getName().length() + 1, null, function.getName() + " - " + function.getSignature(), null, null, 1); //$NON-NLS-1$
-
- completionList.add(proposal);
- }
- }
- }
- return completionList;
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
deleted file mode 100644
index 2efe5eca6a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jdt.core.CompletionProposal;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.swt.graphics.Image;
-
-public class JSPELProposalCollector extends JSPProposalCollector {
-
- public JSPELProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- super(cu, translation);
- }
-
- protected IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal) {
- JSPCompletionProposal jspProposal = null;
-
- if(null == proposal || null == proposal.getName())
- return(null);
-
- String rawName = new String(proposal.getName());
- String completion = null;
-
- if(proposal.getKind() == CompletionProposal.METHOD_REF && proposal.findParameterNames(null).length == 0) {
- if(rawName.length() > 3 && rawName.startsWith("get")) { //$NON-NLS-1$
- completion = rawName.substring(3,4).toLowerCase() + rawName.substring(4, rawName.length());
- } else {
- return null;
- }
-
- // java offset
- int offset = proposal.getReplaceStart() + 1;
-
- // replacement length
- int length = proposal.getReplaceEnd() - offset + 1;
-
- // translate offset from Java > JSP
- offset = getTranslation().getJspOffset(offset);
-
- // cursor position after must be calculated
- int positionAfter = offset + completion.length();
-
- // from java proposal
- IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
- Image image = null;
- String longDisplayString = javaProposal.getDisplayString();
- int fistSpaceIndex = longDisplayString.indexOf(' ');
- String shortDisplayString = longDisplayString;
-
- if(fistSpaceIndex != -1) {
- shortDisplayString = longDisplayString.substring(fistSpaceIndex);
- }
-
- String displayString = completion + " " + shortDisplayString; //$NON-NLS-1$
- IContextInformation contextInformation = javaProposal.getContextInformation();
- String additionalInfo = javaProposal.getAdditionalProposalInfo();
- int relevance = javaProposal.getRelevance();
-
- boolean updateLengthOnValidate = true;
-
- jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, additionalInfo, relevance, updateLengthOnValidate);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
- // set wrapped java proposal so additional info can be calculated on demand
- jspProposal.setJavaCompletionProposal(javaProposal);
-
- return jspProposal;
- } else {
- return null;
- }
- }
-
-// protected void acceptMethod(char[] declaringTypePackageName, char[] declaringTypeName, char[] name, char[][] parameterPackageNames, char[][] parameterTypeNames, char[][] parameterNames, char[] returnTypePackageName, char[] returnTypeName, char[] completionName, int modifiers, int start, int end, int relevance) {
-// String rawName = String.valueOf(name);
-// if(parameterNames.length == 0 && rawName.length() > 3 && rawName.startsWith("get"))
-// {
-// String mangledName = rawName.substring(3,4).toLowerCase() + rawName.substring(4, rawName.length());
-// super.acceptField(declaringTypePackageName, declaringTypeName, mangledName.toCharArray(), returnTypePackageName, returnTypeName, mangledName.toCharArray(), modifiers, start, end, relevance);
-// }
-// }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
deleted file mode 100644
index 69f2f51d59..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.IReleasable;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-
-/**
- * @plannedfor 1.0
- */
-public class JSPJavaContentAssistProcessor implements IContentAssistProcessor, IReleasable {
- protected char completionProposalAutoActivationCharacters[] = new char[]{'.'};
- protected char contextInformationAutoActivationCharacters[] = null;
- protected static final String UNKNOWN_CONTEXT = JSPUIMessages.Content_Assist_not_availab_UI_;
- protected String fErrorMessage = null;
- protected JSPCompletionProcessor fJspCompletionProcessor = null;
-
- public JSPJavaContentAssistProcessor() {
- super();
- }
-
- /**
- * 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 treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition);
-
- // get results from JSP completion processor
- fJspCompletionProcessor = getJspCompletionProcessor();
- ICompletionProposal[] results = fJspCompletionProcessor.computeCompletionProposals(viewer, documentPosition);
- fErrorMessage = fJspCompletionProcessor.getErrorMessage();
- if (results.length == 0 && (fErrorMessage == null || fErrorMessage.length() == 0)) {
- fErrorMessage = UNKNOWN_CONTEXT;
- }
-
- IDOMNode xNode = null;
- IStructuredDocumentRegion flat = null;
- if (treeNode instanceof IDOMNode) {
- xNode = (IDOMNode) treeNode;
- flat = xNode.getFirstStructuredDocumentRegion();
- if (flat != null && flat.getType() == DOMJSPRegionContexts.JSP_CONTENT) {
- flat = flat.getPrevious();
- }
- }
-
- // this is in case it's a <%@, it will be a region container...
- ITextRegion openRegion = null;
- if (flat != null && flat instanceof ITextRegionContainer) {
- ITextRegionList v = ((ITextRegionContainer) flat).getRegions();
- if (v.size() > 0)
- openRegion = v.get(0);
- }
-
- // ADD CDATA PROPOSAL IF IT'S AN XML-JSP TAG
- if (flat != null && flat.getType() != DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN && flat.getType() != DOMJSPRegionContexts.JSP_DECLARATION_OPEN && flat.getType() != DOMJSPRegionContexts.JSP_EXPRESSION_OPEN && flat.getType() != DOMRegionContext.BLOCK_TEXT && (openRegion != null && openRegion.getType() != DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) && !inAttributeRegion(flat, documentPosition)) {
-
- // determine if cursor is before or after selected range
- int adjustedDocPosition = documentPosition;
- int realCaretPosition = viewer.getTextWidget().getCaretOffset();
- int selectionLength = viewer.getSelectedRange().y;
- if (documentPosition > realCaretPosition) {
- adjustedDocPosition -= selectionLength;
- }
-
- CustomCompletionProposal cdataProposal = createCDATAProposal(adjustedDocPosition, selectionLength);
- ICompletionProposal[] newResults = new ICompletionProposal[results.length + 1];
- System.arraycopy(results, 0, newResults, 0, results.length);
- newResults[results.length] = cdataProposal;
- results = newResults;
- }
-
- // (pa) ** this is code in progress...
- // add ending %> proposal for non closed JSP tags
- // String tagText = flat.getText();
- // // TODO need a much better compare (using constants?)
- // if(tagText.equals("<%") || tagText.equals("<%=") || tagText.equals("<%!"));
- // {
- // ICompletionProposal testah = ContentAssistUtils.computeJSPEndTagProposal(viewer,documentPosition, treeNode, "<%" , SharedXMLEditorPluginImageHelper.IMG_OBJ_TAG_GENERIC);
- // if(testah != null)
- // {
- // ICompletionProposal[] newResults = new ICompletionProposal[results.length + 1];
- // System.arraycopy( results, 0, newResults, 0, results.length);
- // newResults[results.length] = testah;
- // results = newResults;
- // }
- // }
-
- return results;
- }
-
- private CustomCompletionProposal createCDATAProposal(int adjustedDocPosition, int selectionLength) {
- return new CustomCompletionProposal("<![CDATA[]]>", //$NON-NLS-1$
- adjustedDocPosition, selectionLength, // should be the selection length
- 9, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_CDATASECTION),
- "CDATA Section", //$NON-NLS-1$
- null, null, XMLRelevanceConstants.R_CDATA);
- }
-
- private boolean inAttributeRegion(IStructuredDocumentRegion flat, int documentPosition) {
- ITextRegion attrContainer = flat.getRegionAtCharacterOffset(documentPosition);
- if (attrContainer != null && attrContainer instanceof ITextRegionContainer) {
- if (attrContainer.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * 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 completionProposalAutoActivationCharacters;
- }
-
- /**
- * 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 contextInformationAutoActivationCharacters;
- }
-
- /**
- * 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 fErrorMessage;
- }
-
- /**
- * @see ContentAssistAdapter#release()
- */
- public void release() {
- if (fJspCompletionProcessor != null) {
- fJspCompletionProcessor.release();
- fJspCompletionProcessor = null;
- }
- }
-
- /**
- *
- */
- protected JSPCompletionProcessor getJspCompletionProcessor() {
- if (fJspCompletionProcessor == null) {
- fJspCompletionProcessor = new JSPCompletionProcessor();
- }
- return fJspCompletionProcessor;
- }
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- List results = new ArrayList();
- // need to compute context info here, if it's JSP, call java computer
- IDocument doc = viewer.getDocument();
- IDocumentPartitioner dp = null;
- if(doc instanceof IDocumentExtension3) {
- dp = ((IDocumentExtension3)doc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
- }
- if(dp != null) {
- //IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner();
- String type = dp.getPartition(documentOffset).getType();
- if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) {
- // get context info from completion results...
- ICompletionProposal[] proposals = computeCompletionProposals(viewer, documentOffset);
- for (int i = 0; i < proposals.length; i++) {
- IContextInformation ci = proposals[i].getContextInformation();
- if (ci != null)
- results.add(ci);
- }
- }
- }
- return (IContextInformation[]) results.toArray(new IContextInformation[results.size()]);
- }
-
- /**
- * 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 IContextInformationValidator getContextInformationValidator() {
- return new JavaParameterListValidator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.java
deleted file mode 100644
index 4e8719cb17..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPPropertyContentAssistProcessor.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.ui.internal.contentassist;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This class computes attribute value completion proposals for &lt;jsp:[gs]etProperty&gt; tags.
- * @plannedfor 1.0
- */
-public class JSPPropertyContentAssistProcessor extends JSPDummyContentAssistProcessor {
- public JSPPropertyContentAssistProcessor() {
- super();
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- // Find the attribute name for which this position should have a value
- IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
- ITextRegionList openRegions = open.getRegions();
- int i = openRegions.indexOf(contentAssistRequest.getRegion());
- if (i < 0)
- return;
-
- // get the attribute in question (first attr name to the left of the cursor)
- ITextRegion attrNameRegion = null;
- String attributeName = null;
- while (i >= 0) {
- attrNameRegion = openRegions.get(i--);
- if (attrNameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
- break;
- }
- if (attrNameRegion != null)
- attributeName = open.getText(attrNameRegion);
-
- // determine get or set
- ITextRegion tagNameRegion = null;
- boolean isGetProperty = true;
- for (int j = 0; j < openRegions.size(); j++) {
- tagNameRegion = openRegions.get(j);
- if (tagNameRegion.getType() == DOMRegionContext.XML_TAG_NAME && open.getText(tagNameRegion).trim().equals("jsp:setProperty")) { //$NON-NLS-1$
- isGetProperty = false;
- break;
- }
- }
-
- String currentValue = null;
- if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- currentValue = contentAssistRequest.getText();
- else
- currentValue = ""; //$NON-NLS-1$
- String matchString = null;
- // fixups since the matchString computations don't care if there are quotes around the value
- if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) && contentAssistRequest.getMatchString().length() > 0) //$NON-NLS-1$ //$NON-NLS-2$
- matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
- else
- matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
-
- // for now we ignore complicated values such as jsp embedded in an attribute
- boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
- if (existingComplicatedValue) {
- contentAssistRequest.getProposals().clear();
- contentAssistRequest.getMacros().clear();
- }
- else {
- if (attributeName.equals(JSP11Namespace.ATTR_NAME_NAME)) {
- addBeanNameProposals(contentAssistRequest, node, matchString);
- }
- else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PROPERTY)) {
- addBeanPropertyProposals(contentAssistRequest, node, isGetProperty, matchString);
- }
- }
- }
-
- private void addBeanPropertyProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, boolean isGetProperty, String matchString) {
- // assumes that the node is the [gs]etProperty tag
- String useBeanName = ((Element) node).getAttribute(JSP11Namespace.ATTR_NAME_NAME);
- // properties can only be provided if a class/type/beanName has been declared
- if (useBeanName != null && useBeanName.length() > 0) {
- NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
- if (useBeans != null) {
- String typeName = null;
- for (int j = 0; j < useBeans.getLength(); j++) {
- if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE)
- continue;
- Element useBean = (Element) useBeans.item(j);
- if (useBean instanceof IndexedRegion && ((IndexedRegion) useBean).getStartOffset() < node.getStartOffset()) {
- if (useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID).equals(useBeanName)) {
- typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
- if (typeName == null || typeName.length() < 1) {
- typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
- }
- if (typeName == null || typeName.length() < 1) {
- typeName = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
- }
- }
- }
- }
- if (typeName != null && typeName.length() > 0) {
- // find the class/type/beanName definition and obtain the list of properties
- IBeanInfoProvider provider = new BeanInfoProvider();
- IResource resource = getResource(contentAssistRequest);
- IJavaPropertyDescriptor[] descriptors = provider.getRuntimeProperties(resource, typeName);
- CustomCompletionProposal proposal = null;
- String displayString = ""; //$NON-NLS-1$
- for (int j = 0; j < descriptors.length; j++) {
- IJavaPropertyDescriptor pd = descriptors[j];
- // check whether it's get or set kinda property
- if (pd.getReadable() && isGetProperty || pd.getWriteable() && !isGetProperty) {
- // filter attr value name
- if (matchString.length() == 0 || pd.getName().toLowerCase().startsWith(matchString.toLowerCase())) {
- displayString = pd.getDisplayName();
- if (pd.getDeclaredType() != null && pd.getDeclaredType().length() > 0)
- displayString += " - " + pd.getDeclaredType(); //$NON-NLS-1$
- proposal = new CustomCompletionProposal("\"" + pd.getName() + "\"", //$NON-NLS-1$ //$NON-NLS-2$
- contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), pd.getName().length() + 2, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
- displayString, null, pd.getDeclaredType(), XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- }
- }
-
- private void addBeanNameProposals(ContentAssistRequest contentAssistRequest, IDOMNode node, String matchString) {
- // will not catch useBeans specified using other than actual DOM Nodes
- NodeList useBeans = node.getOwnerDocument().getElementsByTagName(JSP11Namespace.ElementName.USEBEAN);
- if (useBeans != null) {
- String id = ""; //$NON-NLS-1$
- String displayString = null;
- String classOrType = null;
- String imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
- for (int j = 0; j < useBeans.getLength(); j++) {
- if (useBeans.item(j).getNodeType() != Node.ELEMENT_NODE)
- continue;
- Element useBean = (Element) useBeans.item(j);
- if (useBean instanceof IndexedRegion && ((IndexedRegion) useBean).getStartOffset() < node.getStartOffset()) {
- id = StringUtils.strip(useBean.getAttribute(JSP11Namespace.ATTR_NAME_ID));
- displayString = null;
- classOrType = null;
- imageName = JSPEditorPluginImages.IMG_OBJ_CLASS_OBJ;
- // set the Image based on whether the class, type, or beanName attribute is present
- classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_CLASS);
- if (classOrType == null || classOrType.length() < 1) {
- classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_TYPE);
- imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
- }
- if (classOrType == null || classOrType.length() < 1) {
- classOrType = useBean.getAttribute(JSP11Namespace.ATTR_NAME_BEAN_NAME);
- imageName = JSPEditorPluginImages.IMG_OBJ_PUBLIC;
- }
- if (classOrType != null && classOrType.length() > 0)
- displayString = id + " - " + classOrType; //$NON-NLS-1$
- else
- displayString = id;
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=2341
- if(id != null) {
- // filter
- if (matchString.length() == 0 || id.startsWith(matchString)) {
- CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + id + "\"", //$NON-NLS-1$ //$NON-NLS-2$
- contentAssistRequest.getReplacementBeginPosition(),
- contentAssistRequest.getReplacementLength(),
- id.length() + 2,
- JSPEditorPluginImageHelper.getInstance().getImage(imageName),
- displayString,
- null,
- null,
- XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- }
-
- /**
- * Returns project request is in
- *
- * @param request
- * @return
- */
- private IResource getResource(ContentAssistRequest request) {
- IResource resource = null;
- String baselocation = null;
-
- if (request != null) {
- IStructuredDocumentRegion region = request.getDocumentRegion();
- if (region != null) {
- IDocument document = region.getParentDocument();
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- baselocation = model.getBaseLocation();
- }
- } finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- }
-
- if (baselocation != null) {
- // copied from JSPTranslationAdapter#getJavaProject
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath filePath = new Path(baselocation);
- IFile file = null;
-
- if (filePath.segmentCount() > 1) {
- file = root.getFile(filePath);
- }
- if (file != null) {
- resource = file.getProject();
- }
- }
- return resource;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
deleted file mode 100644
index fe6a3dfe21..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jdt.core.CompletionProposal;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
-import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Passed into ICodeComplete#codeComplete(int offset, CompletionRequestor requestor).
- * Adapts IJavaCompletionProposals to JSPCompletion proposals.
- * This includes:
- * - translating offsets
- * - "fixing" up display strings
- * - filtering some unwanted proposals
- *
- * @plannedfor 1.0
- */
-public class JSPProposalCollector extends CompletionProposalCollector {
-
- private JSPTranslation fTranslation;
- private Comparator fComparator;
-
- public JSPProposalCollector(ICompilationUnit cu, JSPTranslation translation) {
- super(cu);
-
- if(translation == null)
- throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$
-
- fTranslation = translation;
- }
-
- /**
- * Ensures that we only return JSPCompletionProposals.
- * @return an array of JSPCompletionProposals
- */
- public JSPCompletionProposal[] getJSPCompletionProposals() {
- List results = new ArrayList();
- IJavaCompletionProposal[] javaProposals = getJavaCompletionProposals();
- // need to filter out non JSPCompletionProposals
- // because their offsets haven't been translated
- for (int i = 0; i < javaProposals.length; i++) {
- if(javaProposals[i] instanceof JSPCompletionProposal)
- results.add(javaProposals[i]);
- }
- Collections.sort(results, getComparator());
- return (JSPCompletionProposal[])results.toArray(new JSPCompletionProposal[results.size()]);
- }
-
- private Comparator getComparator() {
- if(fComparator == null)
- fComparator = new CompletionProposalComparator();
- return fComparator;
- }
-
- /**
- * Overridden to:
- * - translate Java -> JSP offsets
- * - fix cursor-position-after
- * - fix mangled servlet name in display string
- * - remove unwanted proposals (servlet constructor)
- */
- protected IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal) {
-
- JSPCompletionProposal jspProposal = null;
-
- // ignore constructor proposals (they're not relevant for our JSP proposal list)
- if(!proposal.isConstructor()) {
-
- if(proposal.getKind() == CompletionProposal.TYPE_REF) {
- String signature = String.valueOf(proposal.getDeclarationSignature());
- String completion = String.valueOf(proposal.getCompletion());
- if(completion.indexOf(signature) != -1) {
- jspProposal = createAutoImportProposal(proposal);
- }
- }
-
- // default behavior
- if(jspProposal == null)
- jspProposal = createJspProposal(proposal);
- }
- return jspProposal;
- }
-
-
-
- private JSPCompletionProposal createAutoImportProposal(CompletionProposal proposal) {
-
- JSPCompletionProposal jspProposal = null;
-
- String signature = new String(proposal.getDeclarationSignature());
- String completion = new String(proposal.getCompletion());
-
- // it's fully qualified so we should
- // add an import statement
- // create an autoimport proposal
- String newCompletion = completion.replaceAll(signature + ".", ""); //$NON-NLS-1$ //$NON-NLS-2$
-
- // java offset
- int offset = proposal.getReplaceStart();
- // replacement length
- int length = proposal.getReplaceEnd() - offset;
- // translate offset from Java > JSP
- offset = fTranslation.getJspOffset(offset);
- // cursor position after must be calculated
- int positionAfter = calculatePositionAfter(proposal, newCompletion, offset);
-
- // from java proposal
- IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
- proposal.getDeclarationSignature();
- Image image = javaProposal.getImage();
- String displayString = javaProposal.getDisplayString();
- displayString = getTranslation().fixupMangledName(displayString);
- IContextInformation contextInformation = javaProposal.getContextInformation();
- // don't do this, it's slow
- // String additionalInfo = javaProposal.getAdditionalProposalInfo();
- int relevance = javaProposal.getRelevance();
-
- boolean updateLengthOnValidate = true;
-
- jspProposal = new AutoImportProposal(completion, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
- // set wrapped java proposal so additional info can be calculated on demand
- jspProposal.setJavaCompletionProposal(javaProposal);
-
- return jspProposal;
- }
-
- private JSPCompletionProposal createJspProposal(CompletionProposal proposal) {
-
- JSPCompletionProposal jspProposal;
- String completion = String.valueOf(proposal.getCompletion());
- // java offset
- int offset = proposal.getReplaceStart();
- // replacement length
- int length = proposal.getReplaceEnd() - offset;
- // translate offset from Java > JSP
- offset = fTranslation.getJspOffset(offset);
- // cursor position after must be calculated
- int positionAfter = calculatePositionAfter(proposal, completion, offset);
-
- // from java proposal
- IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
- proposal.getDeclarationSignature();
- Image image = javaProposal.getImage();
- String displayString = javaProposal.getDisplayString();
- displayString = getTranslation().fixupMangledName(displayString);
- IContextInformation contextInformation = javaProposal.getContextInformation();
- // String additionalInfo = javaProposal.getAdditionalProposalInfo();
- int relevance = javaProposal.getRelevance();
-
- boolean updateLengthOnValidate = true;
-
- jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124483
- // set wrapped java proposal so additional info can be calculated on demand
- jspProposal.setJavaCompletionProposal(javaProposal);
-
- return jspProposal;
- }
-
- /**
- * Cacluates the where the cursor should be after applying this proposal.
- * eg. method(|) if the method proposal chosen had params.
- *
- * @param proposal
- * @param completion
- * @param currentCursorOffset
- * @return
- */
- private int calculatePositionAfter(CompletionProposal proposal, String completion, int currentCursorOffset) {
- // calculate cursor position after
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=118398
- //int positionAfter = currentCursorOffset+completion.length();
- int positionAfter = completion.length();
-
- int kind = proposal.getKind();
-
- // may need better logic here...
- // put cursor inside parenthesis if there's params
- // only checking for any kind of declaration
- if(kind == CompletionProposal.ANONYMOUS_CLASS_DECLARATION || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.POTENTIAL_METHOD_DECLARATION || kind == CompletionProposal.METHOD_REF) {
- String[] params = Signature.getParameterTypes(String.valueOf(proposal.getSignature()));
- if(completion.length() > 0 && params.length > 0)
- positionAfter--;
- }
- return positionAfter;
- }
-
- static char[] getTypeTriggers() {
- return TYPE_TRIGGERS;
- }
-
- public JSPTranslation getTranslation() {
- return fTranslation;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
deleted file mode 100644
index 753a206574..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Completion processor for JSP Templates. Most of the work is already done by
- * the JSP Content Assist processor, so by the time the
- * JSPTemplateCompletionProcessor is asked for content assist proposals, the
- * jsp content assist processor has already set the context type for
- * templates.
- */
-class JSPTemplateCompletionProcessor extends TemplateCompletionProcessor {
- private static final class ProposalComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
- }
- }
-
- private static final Comparator fgProposalComparator = new ProposalComparator();
- private String fContextTypeId = null;
-
- /*
- * Copied from super class except instead of calling createContext(viewer,
- * region) call createContext(viewer, region, offset) instead
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
-
- ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
-
- // adjust offset to end of normalized selection
- if (selection.getOffset() == offset)
- offset = selection.getOffset() + selection.getLength();
-
- String prefix = extractPrefix(viewer, offset);
- Region region = new Region(offset - prefix.length(), prefix.length());
- TemplateContext context = createContext(viewer, region, offset);
- if (context == null)
- return new ICompletionProposal[0];
-
- // name of the selection variables {line, word}_selection
- context.setVariable("selection", selection.getText()); // //$NON-NLS-1$
-
- Template[] templates = getTemplates(context.getContextType().getId());
-
- List matches = new ArrayList();
- for (int i = 0; i < templates.length; i++) {
- Template template = templates[i];
- try {
- context.getContextType().validate(template.getPattern());
- }
- catch (TemplateException e) {
- continue;
- }
- if (template.matches(prefix, context.getContextType().getId()))
- matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
- }
-
- Collections.sort(matches, fgProposalComparator);
-
- return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
- }
-
- /**
- * Creates a concrete template context for the given region in the
- * document. This involves finding out which context type is valid at the
- * given location, and then creating a context of this type. The default
- * implementation returns a <code>SmartReplaceTemplateContext</code> for
- * the context type at the given location. This takes the offset at which
- * content assist was invoked into consideration.
- *
- * @param viewer
- * the viewer for which the context is created
- * @param region
- * the region into <code>document</code> for which the
- * context is created
- * @param offset
- * the original offset where content assist was invoked
- * @return a template context that can handle template insertion at the
- * given location, or <code>null</code>
- */
- private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
- // pretty much same code as super.createContext except create
- // SmartReplaceTemplateContext
- TemplateContextType contextType = getContextType(viewer, region);
- if (contextType != null) {
- IDocument document = viewer.getDocument();
- return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
- }
- return null;
- }
-
- protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
- return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
- }
-
- protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
- TemplateContextType type = null;
-
- ContextTypeRegistry registry = getTemplateContextRegistry();
- if (registry != null)
- type = registry.getContextType(fContextTypeId);
-
- return type;
- }
-
- protected Image getImage(Template template) {
- // just return the same image for now
- return JSPEditorPluginImageHelper.getInstance().getImage(JSPEditorPluginImages.IMG_OBJ_TAG_JSP);
- }
-
- private ContextTypeRegistry getTemplateContextRegistry() {
- return JSPUIPlugin.getDefault().getTemplateContextRegistry();
- }
-
- protected Template[] getTemplates(String contextTypeId) {
- Template templates[] = null;
-
- TemplateStore store = getTemplateStore();
- if (store != null)
- templates = store.getTemplates(contextTypeId);
-
- return templates;
- }
-
- private TemplateStore getTemplateStore() {
- return JSPUIPlugin.getDefault().getTemplateStore();
- }
-
- void setContextType(String contextTypeId) {
- fContextTypeId = contextTypeId;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
deleted file mode 100644
index 15db25dba1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPUseBeanContentAssistProcessor.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-
-/**
- * @plannedfor 1.0
- */
-public class JSPUseBeanContentAssistProcessor extends JSPDummyContentAssistProcessor {
-
- public JSPUseBeanContentAssistProcessor() {
- super();
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
-
- IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
-
- // Find the attribute name for which this position should have a value
- IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
- ITextRegionList openRegions = open.getRegions();
- int i = openRegions.indexOf(contentAssistRequest.getRegion());
- if (i < 0)
- return;
- ITextRegion nameRegion = null;
- while (i >= 0) {
- nameRegion = openRegions.get(i--);
- if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
- break;
- }
-
- String attributeName = null;
- if (nameRegion != null)
- attributeName = open.getText(nameRegion);
-
- String currentValue = null;
- if (contentAssistRequest.getRegion().getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)
- currentValue = contentAssistRequest.getText();
- else
- currentValue = ""; //$NON-NLS-1$
- String matchString = null;
- // fixups
- int start = contentAssistRequest.getReplacementBeginPosition();
- int length = contentAssistRequest.getReplacementLength();
- if (currentValue.length() > StringUtils.strip(currentValue).length() && (currentValue.startsWith("\"") || currentValue.startsWith("'")) //$NON-NLS-1$ //$NON-NLS-2$
- && contentAssistRequest.getMatchString().length() > 0) {
- matchString = currentValue.substring(1, contentAssistRequest.getMatchString().length());
- start++;
- length = matchString.length();
- } else
- matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
- boolean existingComplicatedValue = contentAssistRequest.getRegion() != null && contentAssistRequest.getRegion() instanceof ITextRegionContainer;
- if (existingComplicatedValue) {
- contentAssistRequest.getProposals().clear();
- contentAssistRequest.getMacros().clear();
- } else {
- if (attributeName.equals(JSP11Namespace.ATTR_NAME_CLASS)) {
- // class is the concrete implementation class
- IResource resource = getResource(contentAssistRequest);
- ICompletionProposal[] classProposals = JavaTypeFinder.getClassProposals(resource, start, length);
- if (classProposals != null) {
- for (int j = 0; j < classProposals.length; j++) {
- JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) classProposals[j];
- if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
- contentAssistRequest.addProposal(proposal);
- }
- }
- } else if (attributeName.equals(JSP11Namespace.ATTR_NAME_TYPE)) {
- // type is the more general type for the bean
- // which means it may be an interface
- IResource resource = getResource(contentAssistRequest);
- ICompletionProposal[] typeProposals = JavaTypeFinder.getTypeProposals(resource, start, length);
- if (typeProposals != null) {
- for (int j = 0; j < typeProposals.length; j++) {
- JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) typeProposals[j];
- if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
- contentAssistRequest.addProposal(proposal);
- }
- }
- } else if (attributeName.equals(JSP11Namespace.ATTR_NAME_BEAN_NAME)) {
- IResource resource = getResource(contentAssistRequest);
- ICompletionProposal[] beanNameProposals = JavaTypeFinder.getBeanProposals(resource, start, length);
- if (beanNameProposals != null) {
- for (int j = 0; j < beanNameProposals.length; j++) {
- if (beanNameProposals[j] instanceof CustomCompletionProposal) {
- JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
- if (matchString.length() == 0 || proposal.getDisplayString().toLowerCase().startsWith(matchString.toLowerCase()))
- contentAssistRequest.addProposal(proposal);
- } else if (beanNameProposals[j] instanceof JavaTypeCompletionProposal) {
- JavaTypeCompletionProposal proposal = (JavaTypeCompletionProposal) beanNameProposals[j];
- if (matchString.length() == 0 || proposal.getQualifiedName().toLowerCase().startsWith(matchString.toLowerCase()) || proposal.getShortName().toLowerCase().startsWith(matchString.toLowerCase()))
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- }
-
- /**
- * Returns project request is in
- *
- * @param request
- * @return
- */
- private IResource getResource(ContentAssistRequest request) {
- IResource resource = null;
- String baselocation = null;
-
- if (request != null) {
- IStructuredDocumentRegion region = request.getDocumentRegion();
- if (region != null) {
- IDocument document = region.getParentDocument();
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- baselocation = model.getBaseLocation();
- }
- } finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- }
-
- if (baselocation != null) {
- // copied from JSPTranslationAdapter#getJavaProject
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IPath filePath = new Path(baselocation);
- IFile file = null;
-
- if (filePath.segmentCount() > 1) {
- file = root.getFile(filePath);
- }
- if (file != null) {
- resource = file.getProject();
- }
- }
- return resource;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java
deleted file mode 100644
index 3eb1f5681e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.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.ui.internal.contentassist;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-
-
-/**
- * @plannedfor 1.0
- */
-public class JavaParameterListValidator implements IContextInformationValidator, IContextInformationPresenter {
-
- private int fPosition;
- private ITextViewer fViewer;
- private IContextInformation fInformation;
-
- private int fCurrentParameter;
-
- /**
- * @see IContextInformationValidator#install(IContextInformation, ITextViewer, int)
- * @see IContextInformationPresenter#install(IContextInformation, ITextViewer, int)
- */
- public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
- fPosition= documentPosition;
- fViewer= viewer;
- fInformation= info;
-
- fCurrentParameter= -1;
- }
-
- private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
- while (pos < end) {
- char curr= d.getChar(pos);
- pos++;
- if (curr == '*') {
- if (pos < end && d.getChar(pos) == '/') {
- return pos + 1;
- }
- }
- }
- return end;
- }
-
- private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
- while (pos < end) {
- char curr= d.getChar(pos);
- pos++;
- if (curr == '\\') {
- // ignore escaped characters
- pos++;
- } else if (curr == ch) {
- return pos;
- }
- }
- return end;
- }
-
- private int getCharCount(IDocument document, int start, int end, char increment, char decrement, boolean considerNesting) throws BadLocationException {
-
- Assert.isTrue((increment != 0 || decrement != 0) && increment != decrement);
-
- int nestingLevel= 0;
- int charCount= 0;
- while (start < end) {
- char curr= document.getChar(start++);
- switch (curr) {
- case '/':
- if (start < end) {
- char next= document.getChar(start);
- if (next == '*') {
- // a comment starts, advance to the comment end
- start= getCommentEnd(document, start + 1, end);
- } else if (next == '/') {
- // '//'-comment: nothing to do anymore on this line
- start= end;
- }
- }
- break;
- case '*':
- if (start < end) {
- char next= document.getChar(start);
- if (next == '/') {
- // we have been in a comment: forget what we read before
- charCount= 0;
- ++ start;
- }
- }
- break;
- case '"':
- case '\'':
- start= getStringEnd(document, start, end, curr);
- break;
- default:
-
- if (considerNesting) {
-
- if ('(' == curr)
- ++ nestingLevel;
- else if (')' == curr)
- -- nestingLevel;
-
- if (nestingLevel != 0)
- break;
- }
-
- if (increment != 0) {
- if (curr == increment)
- ++ charCount;
- }
-
- if (decrement != 0) {
- if (curr == decrement)
- -- charCount;
- }
- }
- }
-
- return charCount;
- }
-
- /**
- * @see IContextInformationValidator#isContextInformationValid(int)
- */
- public boolean isContextInformationValid(int position) {
-
- try {
- if (position < fPosition)
- return false;
-
- IDocument document= fViewer.getDocument();
- IRegion line= document.getLineInformationOfOffset(fPosition);
-
- if (position < line.getOffset() || position >= document.getLength())
- return false;
-
- return (getCharCount(document, fPosition, position, '(', ')', false) >= 0);
-
- } catch (BadLocationException x) {
- return false;
- }
- }
-
- /**
- * @see IContextInformationPresenter#updatePresentation(int, TextPresentation)
- */
- public boolean updatePresentation(int position, TextPresentation presentation) {
-
- int currentParameter= -1;
-
- try {
- currentParameter= getCharCount(fViewer.getDocument(), fPosition, position, ',', (char) 0, true);
- } catch (BadLocationException x) {
- return false;
- }
-
- if (fCurrentParameter != -1) {
- if (currentParameter == fCurrentParameter)
- return false;
- }
-
- presentation.clear();
- fCurrentParameter= currentParameter;
-
- String s= fInformation.getInformationDisplayString();
- int start= 0;
- int occurrences= 0;
- while (occurrences < fCurrentParameter) {
- int found= s.indexOf(',', start);
- if (found == -1)
- break;
- start= found + 1;
- ++ occurrences;
- }
-
- if (occurrences < fCurrentParameter) {
- presentation.addStyleRange(new StyleRange(0, s.length(), null, null, SWT.NORMAL));
- return true;
- }
-
- if (start == -1)
- start= 0;
-
- int end= s.indexOf(',', start);
- if (end == -1)
- end= s.length();
-
- if (start > 0)
- presentation.addStyleRange(new StyleRange(0, start, null, null, SWT.NORMAL));
-
- if (end > start)
- presentation.addStyleRange(new StyleRange(start, end - start, null, null, SWT.BOLD));
-
- if (end < s.length())
- presentation.addStyleRange(new StyleRange(end, s.length() - end, null, null, SWT.NORMAL));
-
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
deleted file mode 100644
index d8b4de75a6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * An implementation of ICompletionProposal whose values can be
- * read after creation.
- *
- * @plannedfor 1.0
- */
-public class JavaTypeCompletionProposal extends CustomCompletionProposal implements IRelevanceCompletionProposal {
-
- private int fCursorPosition = 0;
- private String fLocalDisplayString;
- private String fShortName;
- private String fQualifiedName;
- private String fContainerName;
-
- public JavaTypeCompletionProposal(String replacementString, int replacementOffset, int replacementLength, String qualifiedName, Image image, String typeName, String containerName, int relevence, boolean updateReplacementLengthOnValidate) {
- super(replacementString, replacementOffset, replacementLength, qualifiedName.length() + 2, image,
- (containerName != null && containerName.length() > 0) ? typeName + " - " + containerName : typeName, null, null, relevence, true); //$NON-NLS-1$
- // CMVC 243817, superclass was comparing incorrect display string in validate method...
- //super(replacementString, replacementOffset, replacementLength, image, (containerName != null && containerName.length() > 0)? typeName + " - " + containerName:typeName/*qualifiedName*/, relevence);
- fShortName = typeName;
- fQualifiedName = qualifiedName;
- fContainerName = containerName;
- fCursorPosition = fQualifiedName.length() + 2;
- //fProposalInfo = proposalInfo;
- if (containerName != null && containerName.length() > 0)
- fLocalDisplayString = typeName + " - " + containerName; //$NON-NLS-1$
- else
- fLocalDisplayString = typeName;
- }
-
- public String getDisplayString() {
- return fLocalDisplayString;
- }
-
- public int getCursorPosition() {
- return fCursorPosition;
- }
-
- public void setCursorPosition(int cursorPosition) {
- super.setCursorPosition(cursorPosition);
- fCursorPosition = cursorPosition;
- }
-
- public String getQualifiedName() {
- return fQualifiedName;
- }
-
- public String getAdditionalProposalInfo() {
- // String info = super.getAdditionalProposalInfo();
- // if (info == null || info.length() == 0 && fProposalInfo != null)
- // return fProposalInfo.getInfo();
- // return info;
- return null; // unexplained NPE
- }
-
- public String getShortName() {
- return fShortName;
- }
-
- protected String getImport(IStructuredDocumentRegion flatNode) {
- ITextRegionList regions = flatNode.getRegions();
- String importSpec = null;
- boolean isImport = false;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (flatNode.getText(region).equals(JSP11Namespace.ATTR_NAME_IMPORT)) {
- isImport = true;
- }
- else {
- isImport = false;
- }
- }
- else if (isImport && region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- importSpec = flatNode.getText(region);
- }
- }
- return importSpec;
- }
-
- /**
- * Add an import page directive for the current type name
- */
- protected int applyImport(IStructuredDocument model) {
- // if the type is in the default package or java.lang, skip it
- if (fContainerName == null || fContainerName.length() == 0 || fContainerName.equals("java.lang")) //$NON-NLS-1$
- return 0;
- // collect page directives and store their import values
- List imports = new ArrayList();
- IStructuredDocumentRegion node = model.getFirstStructuredDocumentRegion();
-
- // use the last position of a page directive as a hint as to where to add
- // a new one
- int hint = 0;
- // watch for jsp:root so that we use the right XML/JSP format for the directive
- boolean useXML = false;
-
- while (node != null) {
- // Can't just look for all StructuredDocumentRegions starting with JSP_DIRECTIVE_OPEN
- // since the XML form is required, too
- ITextRegionList regions = node.getRegions();
- if (regions.size() > 1) {
- ITextRegion name = regions.get(1);
- // verify that this is a JSP directive
- if (name.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- // verify that this is a *page* directive
- if (node.getText(name).equals(JSP11Namespace.ATTR_NAME_PAGE) || node.getText(name).equals(JSP12Namespace.ElementName.DIRECTIVE_PAGE)) {
- if (node.getEndOffset() < getReplacementOffset())
- hint = node.getEndOffset();
- String importSpec = getImport(node);
- if (importSpec != null) {
- imports.add(importSpec);
- }
- }
- }
- else {
- // if this is a jsp:root tag, use the XML form
- useXML = useXML || name.getType() == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME;
- }
- }
- node = node.getNext();
- }
-
- // evaluate requirements for a "new" import directive
- boolean needsImport = !importHandles(fQualifiedName, imports);
- int adjustmentLength = 0;
- // insert "new" import directive
- if (needsImport) {
- String directive = null;
-
- // vary the XML behavior
- if (useXML) {
- directive = "<jsp:directive.page import=\"" + fQualifiedName + "\"/>"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- else {
- directive = "<%@ page import=\"" + fQualifiedName + "\" %>"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- try {
- IRegion line = model.getLineInformationOfOffset(hint);
- boolean prependNewLine = line.getOffset() + line.getLength() == hint;
- boolean appendNewLine = hint == 0;
- if (prependNewLine)
- directive = model.getLineDelimiter() + directive;
- if (appendNewLine)
- directive = directive + model.getLineDelimiter();
- adjustmentLength = directive.length();
- }
- catch (BadLocationException e) {
- // ignore
- }
-
- try {
- model.replace(hint, 0, directive);
-
- }
- catch (BadLocationException e) {
- // Not that we should ever get a BLE, but if so, our
- // replacement offset from the Content Assist call should
- // work
- try {
- model.replace(getReplacementOffset(), 0, directive);
- adjustmentLength = directive.length();
- }
- catch (BadLocationException e2) {
- // now what?
- }
- }
- }
- return adjustmentLength;
- }
-
- /**
- * See if the import specification is a wildcard import, and if so, that
- * it applies to the given type.
- */
- protected boolean isWildcardMatch(String importSpec, String type) {
- int specLength = importSpec.length();
- if (importSpec.endsWith("*") && specLength > 2 && type.length() >= specLength) { //$NON-NLS-1$
- // pull out the package name including the final '.'
- String container = importSpec.substring(0, specLength - 1);
- // verify that the type is in the container's hierarchy and that
- // there are no other package separators afterwards
- if (type.startsWith(container) && type.indexOf('.', specLength - 1) < 0) {
- // container matches
- return true;
- }
- }
- return false;
- }
-
- protected boolean importHandles(String type, List listOfImports) {
- Iterator imports = listOfImports.iterator();
- while (imports.hasNext()) {
- String importSpec = StringUtils.strip(imports.next().toString());
- if (importSpec.equals(type) || isWildcardMatch(importSpec, type))
- return true;
- }
- return false;
- }
-
- public void apply(IDocument document, char trigger, int offset) {
- // If we have a parsed IStructuredDocument, insert the short name instead of the
- // fully qualified name and a import page directive if
- // needed. Do the import first so the cursor goes to the right location
- // and we don't surprise the user.
-
- boolean addShortForm = false; //document instanceof IStructuredDocument && fContainerName != null && fContainerName.length() > 0;
- if (addShortForm) {
- setReplacementString('"' + fShortName + '"');
- int importLength = applyImport((IStructuredDocument) document);
- setReplacementOffset(getReplacementOffset() + importLength);
- }
-
- setCursorPosition(getReplacementString().length());
- super.apply(document, trigger, offset);
-
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension1#apply(org.eclipse.jface.text.ITextViewer, char, int, int)
- */
- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
- // CMVC 243815
- // (pa) this is overridden to get around replacement length modification
- // which is done in the super (since eclipse 2.1)
- apply(viewer.getDocument(), trigger, offset);
- }
-
- // code is borrowed from JavaCompletionProposal
- protected boolean startsWith(IDocument document, int offset, String word) {
- int wordLength = word == null ? 0 : word.length();
- if (offset > getReplacementOffset() + wordLength)
- return false;
-
- try {
- int length = offset - getReplacementOffset();
- // CMVC 243817
- // slightly modified to be a little more flexible for attribute value string matching..
- String start = StringUtils.stripQuotes(document.get(getReplacementOffset(), length));
- return word.toLowerCase().startsWith(start.toLowerCase()) || fQualifiedName.toLowerCase().startsWith(start.toLowerCase());
- //return word.substring(0, length).equalsIgnoreCase(start);
- }
- catch (BadLocationException x) {
- // ignore
- }
-
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal#validate(org.eclipse.jface.text.IDocument, int, org.eclipse.jface.text.DocumentEvent)
- // */
- // public boolean validate(IDocument document, int offset, org.eclipse.jface.text.DocumentEvent event) {
- // return super.validate(document, offset, event);
- // }
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal#selected(org.eclipse.jface.text.ITextViewer, boolean)
- */
- public void selected(ITextViewer viewer, boolean smartToggle) {
- // (pa) we currently don't use smart toggle...
- super.selected(viewer, false);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java
deleted file mode 100644
index b3120d6422..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeFinder.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants;
-
-/**
- * @plannedfor 1.0
- */
-public class JavaTypeFinder {
-
- public static ICompletionProposal[] getBeanProposals(IResource resource, int replacementStart, int replacementLength) {
- ICompletionProposal[] typeProposals = getTypeProposals(resource, replacementStart, replacementLength);
- ICompletionProposal[] serialProposals = getSerializedProposals(resource, replacementStart, replacementLength);
- ICompletionProposal[] beanProposals = new ICompletionProposal[typeProposals.length + serialProposals.length];
-
- int i;
- for (i = 0; i < serialProposals.length; i++) {
- beanProposals[i] = serialProposals[i];
- }
- for (i = serialProposals.length; i < serialProposals.length + typeProposals.length; i++) {
- beanProposals[i] = typeProposals[i - serialProposals.length];
- }
- return beanProposals;
- }
-
- private static void getMembers(IContainer container, List membersList) {
- try {
- IResource[] members = container.members(true);
- if (members != null) {
- for (int i = 0; i < members.length; i++) {
- if (members[i].getType() == IResource.FILE)
- membersList.add(members[i]);
- else if (members[i].getType() == IResource.FOLDER)
- getMembers((IContainer) members[i], membersList);
- }
- }
- }
- catch (CoreException e) {
- // do nothing
- }
- }
-
- private static ICompletionProposal[] getSerializedProposals(IResource resource, int replacementStart, int replacementLength) {
- List names = new ArrayList();
- List resources = new ArrayList();
- getMembers(resource.getProject(), resources);
- IResource memberResource = null;
- for (int i = 0; i < resources.size(); i++) {
- memberResource = (IResource) resources.get(i);
- if (memberResource.getType() == IResource.FILE && memberResource.getName().endsWith(".ser")) { //$NON-NLS-1$
- String path = URIHelper.normalize(memberResource.getFullPath().toString(), resource.getFullPath().toString(), resource.getProject().getFullPath().toString());
- if (path != null) {
- names.add(new CustomCompletionProposal("\"" + path + "\"", //$NON-NLS-1$ //$NON-NLS-2$
- replacementStart, replacementLength, path.length() + 2, null, path, null, null, IRelevanceConstants.R_NONE));
- }
- }
- }
- return (ICompletionProposal[]) names.toArray(new ICompletionProposal[names.size()]);
- }
-
- /**
- *
- * @param resource
- * @param replacementStart
- * @param replacementLength
- * @param searchFor IJavaSearchConstants.TYPE, IJavaSearchConstants.CLASS
- * @return
- */
- private static ICompletionProposal[] findProposals(IResource resource, int replacementStart, int replacementLength, int searchFor, boolean ignoreAbstractClasses) {
-
- JavaTypeNameRequestor requestor = new JavaTypeNameRequestor();
- requestor.setJSPOffset(replacementStart);
- requestor.setReplacementLength(replacementLength);
- requestor.setIgnoreAbstractClasses(ignoreAbstractClasses);
-
- try {
- IJavaElement[] elements = new IJavaElement[]{getJavaProject(resource)};
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- new SearchEngine().searchAllTypeNames(null, null, SearchPattern.R_PATTERN_MATCH | SearchPattern.R_PREFIX_MATCH, searchFor, scope, requestor, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
-
- }
- catch (CoreException exc) {
- Logger.logException(exc);
- }
- catch (Exception exc) {
- // JavaModel
- Logger.logException(exc);
- }
- return requestor.getProposals();
- }
-
- public static ICompletionProposal[] getTypeProposals(IResource resource, int replacementStart, int replacementLength) {
- return findProposals(resource, replacementStart, replacementLength, IJavaSearchConstants.TYPE, false);
- }
-
- public static ICompletionProposal[] getClassProposals(IResource resource, int replacementStart, int replacementLength) {
- return findProposals(resource, replacementStart, replacementLength, IJavaSearchConstants.CLASS, true);
- }
-
- private static IJavaProject getJavaProject(IResource resource) {
- IProject proj = resource.getProject();
- IJavaProject javaProject = JavaCore.create(proj);
- return javaProject;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java
deleted file mode 100644
index c254d14761..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeNameRequestor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.core.CompletionProposal;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.search.TypeNameRequestor;
-import org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.IRelevanceConstants;
-
-/**
- * Use w/ JDT search engine to find all type names.
- * Creates proposals from matches reported.
- *
- * @plannedfor 1.0
- */
-public class JavaTypeNameRequestor extends TypeNameRequestor {
-
- private int fJSPOffset = -1;
- private int fReplacementLength = -1;
- private List fProposals = new ArrayList();
- private boolean fIgnoreAbstractClasses = false;
-
- private CompletionProposalLabelProvider fLabelProvider = new CompletionProposalLabelProvider();
-
- public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) {
-
- int offset = getJSPOffset();
- int length = getReplacementLength();
-
- // somehow offset or length was set incorrectly
- if(offset == -1 || length == -1)
- return;
- // ignore abstract classes?
- if(ignoreAbstractClasses() && Flags.isAbstract(modifiers))
- return;
-
- Image image = calculateImage(modifiers);
-
- String containerNameString = new String(packageName);
- String typeNameString = String.valueOf(simpleTypeName);
-
- // containername can be null
- String fullName = concatenateName(containerNameString, typeNameString);
-
- String simpleName = Signature.getSimpleName(fullName);
- StringBuffer buf = new StringBuffer(simpleName);
- String typeQualifier = Signature.getQualifier(fullName);
- if (typeQualifier.length() > 0) {
- buf.append(" - "); //$NON-NLS-1$
- buf.append(typeQualifier);
- }
-
- JavaTypeCompletionProposal proposal = new JavaTypeCompletionProposal(fullName, offset, length, fullName, image, typeNameString, typeQualifier, IRelevanceConstants.R_NONE, true);
- proposal.setTriggerCharacters(JSPProposalCollector.getTypeTriggers());
- fProposals.add(proposal);
- }
-
-
- private Image calculateImage(int modifiers) {
- CompletionProposal p = CompletionProposal.create(CompletionProposal.TYPE_REF, getJSPOffset());
- p.setFlags(modifiers);
-
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=102206
- char[] sig = new char[]{Signature.C_UNRESOLVED};
- p.setSignature(sig);
-
- ImageDescriptor descriptor = fLabelProvider.createImageDescriptor(p);
- Image image = JSPEditorPluginImageHelper.getInstance().getImage(descriptor);
- return image;
- }
-
- /**
- * Concatenates two names. Uses a dot for separation. Both strings can be
- * empty or <code>null</code>.
- */
- public String concatenateName(String name1, String name2) {
- StringBuffer buf = new StringBuffer();
- if (name1 != null && name1.length() > 0) {
- buf.append(name1);
- }
- if (name2 != null && name2.length() > 0) {
- if (buf.length() > 0) {
- buf.append('.');
- }
- buf.append(name2);
- }
- return buf.toString();
- }
-
- int getJSPOffset() {
- return fJSPOffset;
- }
-
- void setJSPOffset(int offset) {
- fJSPOffset = offset;
- }
-
- int getReplacementLength() {
- return fReplacementLength;
- }
-
- void setReplacementLength(int replacementLength) {
- fReplacementLength = replacementLength;
- }
- void setIgnoreAbstractClasses(boolean ignore) {
- fIgnoreAbstractClasses = ignore;
- }
- boolean ignoreAbstractClasses() {
- return fIgnoreAbstractClasses;
- }
-
- JavaTypeCompletionProposal[] getProposals() {
- return (JavaTypeCompletionProposal[])fProposals.toArray(new JavaTypeCompletionProposal[fProposals.size()]);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
deleted file mode 100644
index d3229386f8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.contentassist;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-/**
- * @plannedfor 1.0
- */
-public class NoRegionContentAssistProcessorForJSP extends NoRegionContentAssistProcessorForHTML {
-
- private String[] fJSPContexts = null;
-
- public NoRegionContentAssistProcessorForJSP() {
- super();
- initJSPContexts();
- }
-
- /*
- * @see org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML#initPartitionToProcessorMap()
- */
- protected void initPartitionToProcessorMap() {
- super.initPartitionToProcessorMap();
- IContentAssistProcessor jspContentAssistProcessor = new JSPContentAssistProcessor();
-
- // JSP
- addPartitionProcessor(IStructuredPartitions.DEFAULT_PARTITION, jspContentAssistProcessor);
- addPartitionProcessor(IXMLPartitions.XML_DEFAULT, jspContentAssistProcessor);
- addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, jspContentAssistProcessor);
- addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, jspContentAssistProcessor);
- addPartitionProcessor(IJSPPartitions.JSP_DEFAULT, jspContentAssistProcessor);
- addPartitionProcessor(IJSPPartitions.JSP_DIRECTIVE, jspContentAssistProcessor);
- addPartitionProcessor(IJSPPartitions.JSP_CONTENT_DELIMITER, jspContentAssistProcessor);
- addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor);
-
- IContentAssistProcessor jspJavaContentAssistProcessor = new JSPJavaContentAssistProcessor();
- addPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA, jspJavaContentAssistProcessor);
-
- }
-
- protected void initNameToProcessorMap() {
- super.initNameToProcessorMap();
- JSPPropertyContentAssistProcessor jspPropertyCAP = new JSPPropertyContentAssistProcessor();
- addNameProcessor(JSP11Namespace.ElementName.SETPROPERTY, jspPropertyCAP);
- addNameProcessor(JSP11Namespace.ElementName.GETPROPERTY, jspPropertyCAP);
- addNameProcessor(JSP11Namespace.ElementName.USEBEAN, new JSPUseBeanContentAssistProcessor());
- }
-
- private void initJSPContexts() {
- fJSPContexts = new String[]{DOMJSPRegionContexts.JSP_CLOSE, DOMJSPRegionContexts.JSP_CONTENT, DOMJSPRegionContexts.JSP_DECLARATION_OPEN, DOMJSPRegionContexts.JSP_EXPRESSION_OPEN, DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN};
- }
-
- /**
- * Quick check to see if context (String) should map to
- * JSPContentAssistProcessor.
- *
- * @param context
- * @return if it's a JSP Region (for which we need JSP Content assist)
- */
- private boolean isJSPRegion(IStructuredDocumentRegion sdRegion) {
- String context = sdRegion.getType();
- for (int i = 0; i < fJSPContexts.length; i++) {
- if (context == fJSPContexts[i])
- return true;
- }
- return false;
- }
-
- protected IContentAssistProcessor guessContentAssistProcessor(ITextViewer viewer, int documentOffset) {
- IContentAssistProcessor p = super.guessContentAssistProcessor(viewer, documentOffset);
- if (p == null) {
- IStructuredDocumentRegion sdRegion = ((IStructuredDocument) viewer.getDocument()).getRegionAtCharacterOffset(documentOffset);
- if (isJSPRegion(sdRegion))
- p = getPartitionProcessor(IJSPPartitions.JSP_CONTENT_JAVA);
- }
- return p;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
deleted file mode 100644
index 1f4e9d13bf..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateBuffer;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-
-/**
- * Just like DocumentTemplateContext except if an insert offset is passed in,
- * during evaluation, the "prefix" before the template will be checked to see
- * if it matches the template name. If so, overwrite the template name.
- * Otherwise, just insert the template at the insert offset location (by not
- * overwriting the prefix text)
- */
-public class ReplaceNameTemplateContext extends DocumentTemplateContext {
- private int fInsertOffset = -1;
-
- /**
- * Creates a document template context.
- *
- * @param type
- * the context type
- * @param document
- * the document this context applies to
- * @param offset
- * the offset of the document region
- * @param length
- * the length of the document region
- */
- public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
- this(type, document, new Position(offset, length));
- }
-
- /**
- * Creates a document template context. The supplied <code>Position</code>
- * will be queried to compute the <code>getStart</code> and
- * <code>getEnd</code> methods, which will therefore answer updated
- * position data if it is registered with the document.
- *
- * @param type
- * the context type
- * @param document
- * the document this context applies to
- * @param position
- * the position describing the area of the document which forms
- * the template context
- * @since 3.1
- */
- public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
- super(type, document, position);
- }
-
- /**
- * Creates a document template context.
- *
- * @param type
- * the context type
- * @param document
- * the document this context applies to
- * @param offset
- * the offset of the document region
- * @param length
- * the length of the document region
- * @param insertOffset
- * the offset of the document region where insert was
- * originally requested
- */
- public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
- this(type, document, new Position(offset, length));
- fInsertOffset = insertOffset;
- }
-
- /*
- * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
- */
- public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
- TemplateBuffer buffer = super.evaluate(template);
- if (buffer != null) {
- if (fInsertOffset > -1 && fInsertOffset > getStart()) {
- String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
- if (!template.getName().startsWith(prefix)) {
- // generate a new buffer that actually contains the
- // text that was going to be overwritten
- buffer = new TemplateBuffer(prefix + buffer.getString(), buffer.getVariables());
- }
- }
- }
- return buffer;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
deleted file mode 100644
index 37a418c63b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-/**
- * JSP Fragment Property Page
- */
-public class JSPFContentSettingsPropertyPage extends PropertyPage {
- private static final String SELECT_NONE = JSPUIMessages.JSPFContentSettingsPropertyPage_0;
-
- // TODO: Figure out what to do with these strings/variables
- private String[] fLanguages = {SELECT_NONE, "java", //$NON-NLS-1$
- "javascript"}; //$NON-NLS-1$
- private String[] fContentTypes = {SELECT_NONE, "application/xhtml+xml", //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml", //$NON-NLS-1$
- "text/css"}; //$NON-NLS-1$
-
- private class ButtonListener extends SelectionAdapter {
- public void widgetSelected(SelectionEvent e) {
- boolean specific = fSpecificSetting.getSelection();
- updateButtons(specific);
- }
- }
-
- private Combo fLanguageCombo;
- private Combo fContentTypeCombo;
- private Button fValidateFragments;
- Button fSpecificSetting;
- private SelectionListener fSpecificListener;
-
- public JSPFContentSettingsPropertyPage() {
- super();
- setDescription(JSPUIMessages.JSPFContentSettingsPropertyPage_1);
- }
-
- private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Composite propertyPage = createComposite(parent, 2);
-
- // fragment language control
- Text languageLabel = new Text(propertyPage, SWT.READ_ONLY);
- languageLabel.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_2);
- fLanguageCombo = new Combo(propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fLanguageCombo.setLayoutData(data);
- fLanguageCombo.setItems(fLanguages);
-
- // fragment content type control
- Text contentTypeLabel = new Text(propertyPage, SWT.READ_ONLY);
- contentTypeLabel.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_3);
- fContentTypeCombo = new Combo(propertyPage, SWT.NONE);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fContentTypeCombo.setLayoutData(data);
- fContentTypeCombo.setItems(fContentTypes);
-
- // create separator
- Label label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- // specific setting
- fSpecificSetting = new Button(propertyPage, SWT.CHECK | SWT.LEFT);
- fSpecificSetting.setText(JSPUIMessages.JSPFContentSettingsPropertyPage_4);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalSpan = 2;
- fSpecificSetting.setLayoutData(data);
-
- fSpecificListener = new ButtonListener();
- fSpecificSetting.addSelectionListener(fSpecificListener);
-
- // validate file
- fValidateFragments = new Button(propertyPage, SWT.CHECK | SWT.LEFT);
- fValidateFragments.setText(JSPUIMessages.JSPFilesPreferencePage_1);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalSpan = 2;
- data.horizontalIndent = 5;
- fValidateFragments.setLayoutData(data);
-
- initializeValues();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.JSP_FRAGMENT_HELPID);
- return propertyPage;
- }
-
- void updateButtons(boolean enabled) {
- fSpecificSetting.setSelection(enabled);
- fValidateFragments.setEnabled(enabled);
- }
-
- /**
- * Get the resource this properties page is for
- *
- * @return IResource for this properties page or null if there is no
- * IResource
- */
- private IResource getResource() {
- IResource resource = null;
- if (getElement() instanceof IResource) {
- resource = (IResource) getElement();
- }
- return resource;
- }
-
- private void initializeValues() {
- String language = JSPFContentProperties.getProperty(JSPFContentProperties.JSPLANGUAGE, getResource(), false);
- if (language == null || language.length() == 0) {
- // if null, use none
- language = SELECT_NONE;
- }
- /*
- * If item is already part of combo, select it. Otherwise, add to the
- * combobox.
- */
- int index = fLanguageCombo.indexOf(language);
- if (index > -1)
- fLanguageCombo.select(index);
- else
- fLanguageCombo.setText(language);
-
- String contentType = JSPFContentProperties.getProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), false);
- if (contentType == null || contentType.length() == 0) {
- // if null, use none
- contentType = SELECT_NONE;
- }
- /*
- * If item is already part of combo, select it. Otherwise, add to the
- * combobox.
- */
- index = fContentTypeCombo.indexOf(contentType);
- if (index > -1)
- fContentTypeCombo.select(index);
- else
- fContentTypeCombo.setText(contentType);
-
- String validate = JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), false);
- String validate2 = JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), true);
- if (validate == null || validate.length() == 0) {
- updateButtons(false);
- fValidateFragments.setSelection(Boolean.valueOf(validate2).booleanValue());
- }
- else {
- updateButtons(true);
- fValidateFragments.setSelection(Boolean.valueOf(validate).booleanValue());
- }
- }
-
- protected void performDefaults() {
- int index = fLanguageCombo.indexOf(SELECT_NONE);
- if (index > -1)
- fLanguageCombo.select(index);
-
- index = fContentTypeCombo.indexOf(SELECT_NONE);
- if (index > -1)
- fContentTypeCombo.select(index);
-
- updateButtons(false);
- fValidateFragments.setSelection(true);
-
- super.performDefaults();
- }
-
- public boolean performOk() {
- try {
- // save the fragment language
- String language = fLanguageCombo.getText();
- if (language == null || language.length() == 0 || language.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- language = null;
- }
- JSPFContentProperties.setProperty(JSPFContentProperties.JSPLANGUAGE, getResource(), language);
-
- // save fragment content type
- String contentType = fContentTypeCombo.getText();
- if (contentType == null || contentType.length() == 0 || contentType.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- contentType = null;
- }
- JSPFContentProperties.setProperty(JSPFContentProperties.JSPCONTENTTYPE, getResource(), contentType);
-
- String validate = null;
- if (fSpecificSetting.getSelection()) {
- validate = Boolean.toString(fValidateFragments.getSelection());
- }
- JSPFContentProperties.setProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, getResource(), validate);
- }
- catch (CoreException e) {
- // maybe in future, let user know there was a problem saving file
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- return super.performOk();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java
deleted file mode 100644
index 31976b6591..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/ProjectJSPFContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
-
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-
-public class ProjectJSPFContentSettingsPropertyPage extends JSPFContentSettingsPropertyPage {
- public ProjectJSPFContentSettingsPropertyPage() {
- setDescription(JSPUIMessages.ProjectJSPFContentSettingsPropertyPage_0);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java
deleted file mode 100644
index eb98e20fbc..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.jst.jsp.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/*
- * Copied from org.eclipse.jdt.internal.corext.javadoc.SingleCharReader.
- * Modification was made to fix statement unnecessarily nested within else
- * clause warning in read(..).
- */
-public abstract class SingleCharReader extends Reader {
-
- /**
- * @see Reader#read()
- */
- public abstract int read() throws IOException;
-
- /**
- * @see Reader#read(char[],int,int)
- */
- public int read(char cbuf[], int off, int len) throws IOException {
- int end = off + len;
- for (int i = off; i < end; i++) {
- int ch = read();
- if (ch == -1) {
- if (i == off) {
- return -1;
- }
- return i - off;
- }
- cbuf[i] = (char) ch;
- }
- return len;
- }
-
- /**
- * @see Reader#ready()
- */
- public boolean ready() throws IOException {
- return true;
- }
-
- /**
- * Gets the content as a String
- */
- public String getString() throws IOException {
- StringBuffer buf = new StringBuffer();
- int ch;
- while ((ch = read()) != -1) {
- buf.append((char) ch);
- }
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
deleted file mode 100644
index de4af96d57..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.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.ui.internal.editor;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jdt.ui.actions.RefactorActionGroup;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jst.jsp.ui.internal.IActionConstantsJSP;
-import org.eclipse.jst.jsp.ui.internal.IActionDefinitionIdsJSP;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML;
-import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
-
-/**
- * ActionContributorJSP
- *
- * 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 ActionContributorJSP extends ActionContributorHTML {
-
- private RetargetTextEditorAction renameElementAction = null;
- private RetargetTextEditorAction moveElementAction = null;
- private IMenuManager refactorMenu = null;
-
- private static final String[] EDITOR_IDS = {"org.eclipse.jst.jsp.core.jspsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- public ActionContributorJSP() {
- super();
-
- ResourceBundle bundle = JSPUIMessages.getResourceBundle();
- this.renameElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_RENAME_ELEMENT + StructuredTextEditorActionConstants.DOT);
- this.renameElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.RENAME_ELEMENT);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.renameElementAction, IHelpContextIds.JSP_REFACTORRENAME_HELPID);
-
- this.moveElementAction = new RetargetTextEditorAction(bundle, IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT + StructuredTextEditorActionConstants.DOT);
- this.moveElementAction.setActionDefinitionId(IActionDefinitionIdsJSP.MOVE_ELEMENT);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.moveElementAction, IHelpContextIds.JSP_REFACTORMOVE_HELPID);
-
- // the refactor menu, add the menu itself to add all refactor actions
- this.refactorMenu = new MenuManager(JSPUIMessages.ActionContributorJSP_0, RefactorActionGroup.MENU_ID); //$NON-NLS-1$
- refactorMenu.add(this.renameElementAction);
- refactorMenu.add(this.moveElementAction);
- }
-
-
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-
-
- protected void addToMenu(IMenuManager menu) {
- super.addToMenu(menu);
-
- menu.insertAfter(IWorkbenchActionConstants.M_EDIT, this.refactorMenu);
- }
-
-
- public void setActiveEditor(IEditorPart activeEditor) {
-
- super.setActiveEditor(activeEditor);
- this.renameElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJSP.ACTION_NAME_RENAME_ELEMENT));
- this.moveElementAction.setAction(getAction(getTextEditor(getActiveEditorPart()), IActionConstantsJSP.ACTION_NAME_MOVE_ELEMENT));
- }
-
-
- public void setViewerSpecificContributionsEnabled(boolean enabled) {
-
- super.setViewerSpecificContributionsEnabled(enabled);
- this.renameElementAction.setEnabled(enabled);
- this.moveElementAction.setEnabled(enabled);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 4cec591ebe..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/IHelpContextIds.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.jst.jsp.ui.internal.editor;
-
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-
-/**
- * Help context ids for the JSP Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.jst.jsp.ui.
- public static final String PREFIX = JSPUIPlugin.ID + "."; //$NON-NLS-1$
-
-
- // // figured out on the fly
- // // JSP Source page editor
- // public static final String JSP_SOURCEVIEW_HELPID =
- // ContentTypeIdForJSP.ContentTypeID_JSP +"_source_HelpId"; //$NON-NLS-1$
-
- // JSP Files Preference page
- public static final String JSP_PREFWEBX_FILES_HELPID = PREFIX + "webx0050"; //$NON-NLS-1$
- // JSP Styles Preference page
- public static final String JSP_PREFWEBX_STYLES_HELPID = PREFIX + "webx0051"; //$NON-NLS-1$
- // JSP Templates Preference page
- public static final String JSP_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0052"; //$NON-NLS-1$
-
-
- // JSP Fragment Property Page
- public static final String JSP_FRAGMENT_HELPID = PREFIX + "jspf1000"; //$NON-NLS-1$
-
- // JSP Source Editor Context Menu
- // Refactor Rename
- public static final String JSP_REFACTORRENAME_HELPID = PREFIX + "jspr0010"; //$NON-NLS-1$
-
- // Refactor Move
- public static final String JSP_REFACTORMOVE_HELPID = PREFIX + "jspr0020"; //$NON-NLS-1$
-
- // JSP New File Wizard - Template Page
- public static final String JSP_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "jspw0010"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java
deleted file mode 100644
index b659b9b301..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImageHelper.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.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.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-
-/**
- * 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 JSPEditorPluginImageHelper {
- private final String PLUGINID = JSPUIPlugin.ID;
- private static JSPEditorPluginImageHelper instance = null;
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a JSPEditorPluginImageHelper
- */
- public synchronized static JSPEditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new JSPEditorPluginImageHelper();
- 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 associated with ImageDescriptor from the image
- * descriptor registry. If the Image cannot be retrieved, it is created
- * from the ImageDescriptor
- *
- * @param resource
- * the image descriptor to retrieve
- * @return Image the associated with the ImageDescriptor or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public Image getImage(ImageDescriptor descriptor) {
- if (descriptor == null)
- descriptor= ImageDescriptor.getMissingImageDescriptor();
-
- Image result= (Image)getImageDescriptorRegistry().get(descriptor);
- if (result != null)
- return result;
-
- result= descriptor.createImage();
- if (result != null)
- getImageDescriptorRegistry().put(descriptor, result);
- return result;
- }
-
- /**
- * 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.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java
deleted file mode 100644
index d86c04bbcf..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.editor;
-
-/**
- * Bundle of most images used by the JSP Editor plug-in.
- */
-public class JSPEditorPluginImages {
- public static final String IMG_OBJ_CLASS_OBJ = "icons/full/obj16/class_obj.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.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_TEMPLATE = "icons/full/obj16/tag-template.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_PUBLIC = "icons/full/obj16/public.gif"; //$NON-NLS-1$
-
- public static final String FIELD_PROTECTED_OBJ = "icons/full/obj16/field_protected_obj.gif"; //$NON-NLS-1$
- public static final String FIELD_PUBLIC_OBJ = "icons/full/obj16/field_public_obj.gif"; //$NON-NLS-1$
- public static final String FIELD_DEFAULT_OBJ= "icons/full/obj16/field_default_obj.gif"; //$NON-NLS-1$
- public static final String FIELD_PRIVATE_OBJ = "icons/full/obj16/field_private_obj.gif"; //$NON-NLS-1$
-
- public static final String DEFAULT_CO = "icons/full/obj16/default_co.gif"; //$NON-NLS-1$
- public static final String PROTECTED_CO = "icons/full/obj16/protected_co.gif"; //$NON-NLS-1$
- public static final String PUBLIC_CO = "icons/full/obj16/public_co.gif"; //$NON-NLS-1$
- public static final String PRIVATE_CO = "icons/full/obj16/private_co.gif"; //$NON-NLS-1$
-
- public static final String INNERCLASS_DEFAULT_OBJ= "icons/full/obj16/innerclass_default_obj.gif"; //$NON-NLS-1$
- public static final String INNERCLASS_PRIVATE_OBJ = "icons/full/obj16/innerclass_private_obj.gif"; //$NON-NLS-1$
- public static final String INNERCLASS_PROTECTED_OBJ = "icons/full/obj16/innerclass_protected_obj.gif"; //$NON-NLS-1$
- public static final String INNERCLASS_PUBLIC_OBJ = "icons/full/obj16/innerclass_public_obj.gif"; //$NON-NLS-1$
-
- public static final String INNERINTERFACE_DEFAULT_OBJ = "icons/full/obj16/innerinterface_default_obj.gif"; //$NON-NLS-1$
- public static final String INNERINTERFACE_PRIVATE_OBJ = "icons/full/obj16/innerinterface_private_obj.gif"; //$NON-NLS-1$
- public static final String INNERINTERFACE_PROTECTED_OBJ = "icons/full/obj16/innerinterface_protected_obj.gif"; //$NON-NLS-1$
- public static final String INNERINTERFACE_PUBLIC_OBJ = "icons/full/obj16/innerinterface_public_obj.gif"; //$NON-NLS-1$
-
- public static final String PACKAGE_OBJ = "icons/full/obj16/package_obj.gif"; //$NON-NLS-1$
-
- public static final String LOCAL_VARIABLE_OBJ = "icons/full/obj16/localvariable_obj.gif"; //$NON-NLS-1$
-
- public static final String IMG_OBJ_WIZBAN_NEWJSPFILE = "icons/full/wizban/newjspfile_wiz.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.java
deleted file mode 100644
index d31cb31aa9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPSourceEditingTextTools.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.ui.internal.editor;
-
-
-
-import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapter;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Implements ISourceEditingTextTools interface
- */
-public class JSPSourceEditingTextTools extends XMLSourceEditingTextTools {
-
- public String getPageLanguage(Node node) {
- String language = null;
- Document doc = null;
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- doc = (Document) node;
- }
- else {
- doc = node.getOwnerDocument();
- }
- if (doc != null) {
- if (doc instanceof IDOMDocument) {
- PageDirectiveAdapter adapter = (PageDirectiveAdapter) ((IDOMDocument) doc).getAdapterFor(PageDirectiveAdapter.class);
- if (adapter != null)
- language = adapter.getLanguage();
- }
- else {
- // iterate through all of the page directives
- NodeList pageDirectives = doc.getElementsByTagName(JSP12Namespace.ElementName.DIRECTIVE_PAGE);
- for (int i = 0; i < pageDirectives.getLength(); i++) {
- Element pageDirective = (Element) pageDirectives.item(i);
- String langValue = pageDirective.getAttribute(JSP11Namespace.ATTR_NAME_LANGUAGE);
- // last one to declare a language wins
- if (langValue != null)
- language = langValue;
- }
- }
- }
- // if no language was specified anywhere, assume Java
- if (language == null)
- language = JSP11Namespace.ATTR_VALUE_JAVA;
- return language;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java
deleted file mode 100644
index 2c9b02dd3d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/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.ui.internal.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.internal.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);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 4b50266650..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * EditorInput for external files. Copied from
- * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
- */
-class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- /**
- * The workbench adapter which simply provides the label.
- *
- * @see Eclipse 3.1
- */
- private class WorkbenchAdapter implements IWorkbenchAdapter {
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return ((ExternalFileEditorInput) o).getName();
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
- }
-
- private File fFile;
- private WorkbenchAdapter fWorkbenchAdapter = new WorkbenchAdapter();
-
- public ExternalFileEditorInput(File file) {
- super();
- fFile = file;
- fWorkbenchAdapter = new WorkbenchAdapter();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return fFile.exists();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return fFile.getName();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fFile.getAbsolutePath();
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (ILocationProvider.class.equals(adapter))
- return this;
- if (IWorkbenchAdapter.class.equals(adapter))
- return fWorkbenchAdapter;
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
- */
- public IPath getPath(Object element) {
- if (element instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) element;
- return Path.fromOSString(input.fFile.getAbsolutePath());
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IPathEditorInput#getPath()
- * @since 3.1
- */
- public IPath getPath() {
- return Path.fromOSString(fFile.getAbsolutePath());
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o) {
- if (o == this)
- return true;
-
- if (o instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) o;
- return fFile.equals(input.fFile);
- }
-
- if (o instanceof IPathEditorInput) {
- IPathEditorInput input= (IPathEditorInput)o;
- return getPath().equals(input.getPath());
- }
-
- return false;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fFile.hashCode();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index f25d93789f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Hyperlink for external files.
- */
-class ExternalFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fHyperlinkRegion;
- private File fHyperlinkFile;
-
- public ExternalFileHyperlink(IRegion region, File file) {
- fHyperlinkFile = file;
- fHyperlinkRegion = region;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public String getHyperlinkText() {
- return null;
- }
-
- public void open() {
- if (fHyperlinkFile != null) {
- IEditorInput input = new ExternalFileEditorInput(fHyperlinkFile);
- IEditorDescriptor descriptor;
- try {
- descriptor = IDE.getEditorDescriptor(input.getName(), true);
- if (descriptor != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, input, descriptor.getId(), true);
- }
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
deleted file mode 100644
index 539f95951c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Hyperlink for JSP Java elements
- */
-class JSPJavaHyperlink implements IHyperlink {
- private IRegion fRegion;
- private IJavaElement fElement;
-
- public JSPJavaHyperlink(IRegion region, IJavaElement element) {
- fRegion = region;
- fElement = element;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- try {
- IEditorPart editor = JavaUI.openInEditor(fElement);
- if (editor != null) {
- JavaUI.revealInEditor(editor, fElement);
- }
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
deleted file mode 100644
index d89caf0219..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
+++ /dev/null
@@ -1,237 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.ILocalVariable;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.ISourceReference;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * Detects hyperlinks in JSP Java content
- */
-public class JSPJavaHyperlinkDetector implements IHyperlinkDetector {
-
- private IHyperlink createHyperlink(IJavaElement element, IRegion region, IDocument document) {
- IHyperlink link = null;
- if (region != null) {
- // open local variable in the JSP file...
- if (element instanceof ISourceReference) {
- IFile file = null;
- int jspOffset = 0;
- IStructuredModel sModel = null;
-
- // try to locate the file in the workspace
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- String uriString = sModel.getResolver().getFileBaseLocation();
- file = getFile(uriString);
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- // get Java range, translate coordinate to JSP
-
- try {
- ISourceRange range = null;
- IJSPTranslation jspTranslation = getJSPTranslation(document);
- if (jspTranslation != null) {
- // link to local variable definitions
- if (element instanceof ILocalVariable) {
- range = ((ILocalVariable) element).getNameRange();
- }
- // linking to fields of the same compilation unit
- else if (element.getElementType() == IJavaElement.FIELD) {
- Object cu = ((IField) element).getCompilationUnit();
- if (cu != null && cu.equals(jspTranslation.getCompilationUnit()))
- range = ((ISourceReference) element).getSourceRange();
- }
- // linking to methods of the same compilation unit
- else if (element.getElementType() == IJavaElement.METHOD) {
- Object cu = ((IMethod) element).getCompilationUnit();
- if (cu != null && cu.equals(jspTranslation.getCompilationUnit()))
- range = ((ISourceReference) element).getSourceRange();
- }
- }
-
- if (range != null && file != null) {
- jspOffset = jspTranslation.getJspOffset(range.getOffset());
- if (jspOffset >= 0) {
- link = new WorkspaceFileHyperlink(region, file, new Region(jspOffset, range.getLength()));
- }
- }
- }
- catch (JavaModelException jme) {
- Logger.log(Logger.WARNING_DEBUG, jme.getMessage(), jme);
- }
- }
- if (link == null) {
- link = new JSPJavaHyperlink(region, element);
- }
- }
- return link;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion, boolean)
- */
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- List hyperlinks = new ArrayList(0);
-
- if (region != null && textViewer != null) {
- IDocument document = textViewer.getDocument();
-
- // check and make sure this is a valid Java type
- JSPTranslation jspTranslation = getJSPTranslation(document);
- if (jspTranslation != null) {
- // check if we are in JSP Java content
- int javaOffset = jspTranslation.getJavaOffset(region.getOffset());
- if (javaOffset > -1) {
- // check that we are not in indirect Java content (like
- // included files)
- if (!jspTranslation.isIndirect(javaOffset)) {
- // get Java elements
- IJavaElement[] elements = jspTranslation.getElementsFromJspRange(region.getOffset(), region.getOffset() + region.getLength());
- if (elements != null && elements.length > 0) {
- // create a JSPJavaHyperlink for each Java element
- for (int i = 0; i < elements.length; ++i) {
- IJavaElement element = elements[i];
-
- // find hyperlink range for Java element
- IRegion hyperlinkRegion = selectWord(document, region.getOffset());
- IHyperlink link = createHyperlink(element, hyperlinkRegion, document);
- if (link != null) {
- hyperlinks.add(link);
- }
- }
- }
- }
- }
- }
- }
-
- if (hyperlinks.size() == 0)
- return null;
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Returns an IFile from the given uri if possible, null if cannot find
- * file from uri.
- *
- * @param fileString
- * file system path
- * @return returns IFile if fileString exists in the workspace
- */
- private IFile getFile(String fileString) {
- IFile file = null;
-
- if (fileString != null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
- for (int i = 0; i < files.length && file == null; i++)
- if (files[i].exists())
- file = files[i];
- }
-
- return file;
- }
- /**
- * Get JSP translation object
- *
- * @return JSPTranslation if one exists, null otherwise
- */
- private JSPTranslation getJSPTranslation(IDocument document) {
- JSPTranslation translation = null;
-
- IDOMModel xmlModel = null;
- try {
- xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (xmlModel != null) {
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (adapter != null) {
- translation = adapter.getJSPTranslation();
- }
- }
- }
- finally {
- if (xmlModel != null)
- xmlModel.releaseFromRead();
- }
- return translation;
- }
-
- /**
- * Java always selects word when defining region
- *
- * @param document
- * @param anchor
- * @return IRegion
- */
- private IRegion selectWord(IDocument document, int anchor) {
-
- try {
- int offset = anchor;
- char c;
-
- while (offset >= 0) {
- c = document.getChar(offset);
- if (!Character.isJavaIdentifierPart(c))
- break;
- --offset;
- }
-
- int start = offset;
-
- offset = anchor;
- int length = document.getLength();
-
- while (offset < length) {
- c = document.getChar(offset);
- if (!Character.isJavaIdentifierPart(c))
- break;
- ++offset;
- }
-
- int end = offset;
-
- if (start == end)
- return new Region(start, 0);
-
- return new Region(start + 1, end - start - 1);
-
- }
- catch (BadLocationException x) {
- return null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
deleted file mode 100644
index ae634a7451..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
+++ /dev/null
@@ -1,221 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks for taglibs.
- */
-public class TaglibHyperlinkDetector implements IHyperlinkDetector {
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- IHyperlink hyperlink = null;
-
- if (textViewer != null && region != null) {
- IDocument doc = textViewer.getDocument();
- if (doc != null) {
- try {
- // check if jsp tag/directive first
- ITypedRegion partition = TextUtilities.getPartition(doc, IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING, region.getOffset(), false);
- if (partition != null && partition.getType() == IJSPPartitions.JSP_DIRECTIVE) {
- // check if jsp taglib directive
- Node currentNode = getCurrentNode(doc, region.getOffset());
- if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
- // get the uri attribute
- Attr taglibNode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
- ITaglibRecord reference = TaglibIndex.resolve(getBaseLocationForTaglib(doc), taglibNode.getValue(), false);
- if (reference != null) {
- // handle taglibs
- switch (reference.getRecordType()) {
- case (ITaglibRecord.TLD) : {
- ITLDRecord record = (ITLDRecord) reference;
- String uriString = record.getPath().toString();
- IRegion hyperlinkRegion = getHyperlinkRegion(taglibNode);
- hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, taglibNode);
- }
- break;
- case (ITaglibRecord.JAR) :
- case (ITaglibRecord.URL) : {
- IRegion hyperlinkRegion = getHyperlinkRegion(taglibNode);
- hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
- if (hyperlink != null)
- return new IHyperlink[]{hyperlink};
- return null;
- }
-
- /**
- * Get the base location from the current model (if within workspace,
- * location is relative to workspace, otherwise, file system path)
- */
- private String getBaseLocationForTaglib(IDocument document) {
- String baseLoc = null;
-
- // get the base location from the current model
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- baseLoc = sModel.getBaseLocation();
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return baseLoc;
- }
-
- // the below methods were copied from URIHyperlinkDetector
-
- private IRegion getHyperlinkRegion(Node node) {
- IRegion hyperRegion = null;
-
- if (node != null) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null) {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue)) {
- ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- }
- return hyperRegion;
- }
-
- /**
- * Returns an IFile from the given uri.
- *
- * @param fileString
- * workspace-relative path to an existing file in the workspace
- * @return returns existing IFile
- */
- private IFile getFile(String fileString) {
- /*
- * Note at this point, fileString is already guaranteed to be pointing
- * to an existing file in the workspace, so we can just call getFile.
- */
- return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileString));
- }
-
- /**
- * Create the appropriate hyperlink
- *
- * @param uriString
- * @param hyperlinkRegion
- * @return IHyperlink
- */
- private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
- IHyperlink link = null;
-
- if (uriString != null) {
- String temp = uriString.toLowerCase();
- if (temp.startsWith(HTTP_PROTOCOL)) {
- // this is a URLHyperlink since this is a web address
- link = new URLHyperlink(hyperlinkRegion, uriString);
- }
-
- // try to locate the file in the workspace
- IFile file = getFile(uriString);
- if (file != null) {
- // this is a WorkspaceFileHyperlink since file exists in
- // workspace
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- }
- else {
- // this is an ExternalFileHyperlink since file does not exist
- // in workspace
- File externalFile = new File(uriString);
- link = new ExternalFileHyperlink(hyperlinkRegion, externalFile);
- }
- }
-
- return link;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null)
- inode = sModel.getIndexedRegion(offset - 1);
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- if (inode instanceof Node) {
- return (Node) inode;
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
deleted file mode 100644
index 676292616e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Hyperlink for taglib files in jars.
- */
-class TaglibJarHyperlink implements IHyperlink {
- static class ZipStorage implements IStorage {
- File fFile = null;
- String fEntryName = null;
-
- ZipStorage(File file, String entryName) {
- fFile = file;
- fEntryName = entryName;
- }
-
- public InputStream getContents() throws CoreException {
- InputStream stream = null;
- try {
- ZipFile file = new ZipFile(fFile);
- ZipEntry entry = file.getEntry(fEntryName);
- stream = file.getInputStream(entry);
- }
- catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, getFullPath().toString(), e));
- }
- return stream;
- }
-
- public IPath getFullPath() {
- return new Path(fFile.getAbsolutePath() + IPath.SEPARATOR + fEntryName);
- }
-
- public String getName() {
- return fEntryName;
- }
-
- public boolean isReadOnly() {
- return true;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
- }
-
- private IRegion fRegion;
- private IPath fZipFilePath;
-
- public TaglibJarHyperlink(IRegion region, IPath zipFilePath) {
- fRegion = region;
- fZipFilePath = zipFilePath;
- }
-
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- IEditorInput input = new URLFileHyperlink.StorageEditorInput(new ZipStorage(fZipFilePath.toFile(), "META-INF/taglib.tld")); //$NON-NLS-1$
- IEditorDescriptor descriptor;
- try {
- descriptor = IDE.getEditorDescriptor(input.getName());
- if (descriptor != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, input, descriptor.getId(), true);
- }
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
deleted file mode 100644
index 1cf7086ce4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsp.core.taglib.IJarRecord;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.IURLRecord;
-
-/**
- * Hyperlink for taglib files in jars or specified by urls.
- */
-class TaglibJarUriHyperlink implements IHyperlink {
- private IRegion fRegion;
- private ITaglibRecord fTaglibRecord;
- private IHyperlink fHyperlink;
-
- public TaglibJarUriHyperlink(IRegion region, ITaglibRecord record) {
- fRegion = region;
- fTaglibRecord = record;
- }
-
- private IHyperlink getHyperlink() {
- if (fHyperlink == null && fTaglibRecord != null) {
- switch (fTaglibRecord.getRecordType()) {
- case (ITaglibRecord.JAR) : {
- IJarRecord record = (IJarRecord) fTaglibRecord;
- fHyperlink = new TaglibJarHyperlink(fRegion, record.getLocation());
- }
- break;
- case (ITaglibRecord.URL) : {
- IURLRecord record = (IURLRecord) fTaglibRecord;
- fHyperlink = new URLFileHyperlink(fRegion, record.getURL());
- }
- }
- }
- return fHyperlink;
- }
-
- public IRegion getHyperlinkRegion() {
- IRegion region = null;
-
- IHyperlink link = getHyperlink();
- if (link != null) {
- region = link.getHyperlinkRegion();
- }
- return region;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- IHyperlink link = getHyperlink();
- if (link != null) {
- link.open();
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
deleted file mode 100644
index 4ce016f622..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Hyperlink for URLs (opens in read-only mode)
- */
-class URLFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- static class StorageEditorInput implements IStorageEditorInput {
- IStorage fStorage = null;
-
- StorageEditorInput(IStorage storage) {
- fStorage = storage;
- }
-
- public IStorage getStorage() throws CoreException {
- return fStorage;
- }
-
- public boolean exists() {
- return fStorage != null;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public String getName() {
- return fStorage.getName();
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- public String getToolTipText() {
- return fStorage.getFullPath() != null ? fStorage.getFullPath().toString() : fStorage.getName();
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
- }
-
- static class URLStorage implements IStorage {
- URL fURL = null;
-
- URLStorage(URL url) {
- fURL = url;
- }
-
- public InputStream getContents() throws CoreException {
- InputStream stream = null;
- try {
- stream = fURL.openStream();
- }
- catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
- }
- return stream;
- }
-
- public IPath getFullPath() {
- return new Path(fURL.toString());
- }
-
- public String getName() {
- return new Path(fURL.getFile()).lastSegment();
- }
-
- public boolean isReadOnly() {
- return true;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- }
-
- private IRegion fRegion;
- private URL fURL;
-
- public URLFileHyperlink(IRegion region, URL url) {
- fRegion = region;
- fURL = url;
- }
-
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- if (fURL != null) {
- IEditorInput input = new StorageEditorInput(new URLStorage(fURL));
- IEditorDescriptor descriptor;
- try {
- descriptor = IDE.getEditorDescriptor(input.getName());
- if (descriptor != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, input, descriptor.getId(), true);
- }
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 17aaa0a431..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Hyperlink for files within the workspace. (As long as there is an IFile,
- * this can be used) Opens the default editor for the file.
- */
-class WorkspaceFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fRegion;
- private IFile fFile;
- private IRegion fHighlightRange;
-
- public WorkspaceFileHyperlink(IRegion region, IFile file) {
- fRegion = region;
- fFile = file;
- }
-
- public WorkspaceFileHyperlink(IRegion region, IFile file, IRegion range) {
- fRegion = region;
- fFile = file;
- fHighlightRange = range;
- }
-
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- if (fFile != null && fFile.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, fFile, true);
- // highlight range in editor if possible
- if (fHighlightRange != null && editor instanceof ITextEditor) {
- ((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
- }
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index 3bee897522..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,503 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- *
- */
-public class XMLHyperlinkDetector implements IHyperlinkDetector {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
- private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
- private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
- private final String XMLNS = "xmlns"; //$NON-NLS-1$
- private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- /**
- * Create the appropriate hyperlink
- *
- * @param uriString
- * @param hyperlinkRegion
- * @return IHyperlink
- */
- private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
- IHyperlink link = null;
-
- if (isHttp(uriString)) {
- link = new URLHyperlink(hyperlinkRegion, uriString);
- }
- else {
- // try to locate the file in the workspace
- File systemFile = getFileFromUriString(uriString);
- if (systemFile != null) {
- String systemPath = systemFile.getPath();
- IFile file = getFile(systemPath);
- if (file != null) {
- // this is a WorkspaceFileHyperlink since file exists in
- // workspace
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- }
- else {
- // this is an ExternalFileHyperlink since file does not
- // exist in workspace
- link = new ExternalFileHyperlink(hyperlinkRegion, systemFile);
- }
- }
- }
- return link;
- }
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- // for now, only capable of creating 1 hyperlink
- List hyperlinks = new ArrayList(0);
-
- if (region != null && textViewer != null) {
- IDocument document = textViewer.getDocument();
- Node currentNode = getCurrentNode(document, region.getOffset());
- if (currentNode != null) {
- String uriString = null;
- if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- // doctype nodes
- uriString = getURIString(currentNode, document);
- }
- else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
- // element nodes
- Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
- if (currentAttr != null) {
- // try to find link for current attribute
- // resolve attribute value
- uriString = getURIString(currentAttr, document);
- // verify validity of uri string
- if (uriString == null || !isValidURI(uriString))
- // reset current attribute
- currentAttr = null;
- }
- if (currentAttr == null) {
- // try to find a linkable attribute within element
- currentAttr = getLinkableAttr((Element) currentNode);
- if (currentAttr != null) {
- uriString = getURIString(currentAttr, document);
- }
- }
- currentNode = currentAttr;
- }
- // try to create hyperlink from information gathered
- if (uriString != null && currentNode != null && isValidURI(uriString)) {
- IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
- IHyperlink hyperlink = createHyperlink(uriString, hyperlinkRegion, document, currentNode);
- if (hyperlink != null) {
- hyperlinks.add(hyperlink);
- }
- }
- }
- }
- if (hyperlinks.size() == 0)
- return null;
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Get the base location from the current model (local file system)
- */
- private String getBaseLocation(IDocument document) {
- String baseLoc = null;
-
- // get the base location from the current model
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- IPath location = new Path(sModel.getBaseLocation());
- if (location.toFile().exists()) {
- baseLoc = location.toString();
- }
- else {
- if (location.segmentCount() > 1)
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(location).getLocation().toString();
- else
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(location).toString();
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return baseLoc;
- }
-
- /**
- * Get the CMElementDeclaration for an element
- *
- * @param element
- * @return CMElementDeclaration
- */
- private CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration ed = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- ed = mq.getCMElementDeclaration(element);
- }
- return ed;
- }
-
- /**
- * Returns the attribute node within node at offset
- *
- * @param node
- * @param offset
- * @return Attr
- */
- private Attr getCurrentAttrNode(Node node, int offset) {
- if ((node instanceof IndexedRegion) && ((IndexedRegion) node).contains(offset) && (node.hasAttributes())) {
- NamedNodeMap attrs = node.getAttributes();
- // go through each attribute in node and if attribute contains
- // offset, return that attribute
- for (int i = 0; i < attrs.getLength(); ++i) {
- // assumption that if parent node is of type IndexedRegion,
- // then its attributes will also be of type IndexedRegion
- IndexedRegion attRegion = (IndexedRegion) attrs.item(i);
- if (attRegion.contains(offset)) {
- return (Attr) attrs.item(i);
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null)
- inode = sModel.getIndexedRegion(offset - 1);
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- if (inode instanceof Node) {
- return (Node) inode;
- }
- return null;
- }
-
- /**
- * Returns an IFile from the given uri if possible, null if cannot find
- * file from uri.
- *
- * @param fileString
- * file system path
- * @return returns IFile if fileString exists in the workspace
- */
- private IFile getFile(String fileString) {
- IFile file = null;
-
- if (fileString != null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
- for (int i = 0; i < files.length && file == null; i++)
- if (files[i].exists())
- file = files[i];
- }
-
- return file;
- }
-
- /**
- * Create a file from the given uri string
- *
- * @param uriString -
- * assumes uriString is not http://
- * @return File created from uriString if possible, null otherwise
- */
- private File getFileFromUriString(String uriString) {
- File file = null;
- try {
- // first just try to create a file directly from uriString as
- // default in case create file from uri does not work
- file = new File(uriString);
-
- // try to create file from uri
- URI uri = new URI(uriString);
- file = new File(uri);
- }
- catch (Exception e) {
- // if exception is thrown while trying to create File just ignore
- // and file will be null
- }
- return file;
- }
-
- private IRegion getHyperlinkRegion(Node node) {
- IRegion hyperRegion = null;
-
- if (node != null) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null) {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue)) {
- ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- }
- return hyperRegion;
- }
-
- /**
- * Attempts to find an attribute within element that is openable.
- *
- * @param element -
- * cannot be null
- * @return Attr attribute that can be used for open on, null if no
- * attribute could be found
- */
- private Attr getLinkableAttr(Element element) {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- // get the list of attributes for this node
- NamedNodeMap attrs = element.getAttributes();
- for (int i = 0; i < attrs.getLength(); ++i) {
- // check if this attribute is "openOn-able"
- Attr att = (Attr) attrs.item(i);
- if (isLinkableAttr(att, ed)) {
- return att;
- }
- }
- return null;
- }
-
- /**
- * Find the location hint for the given namespaceURI if it exists
- *
- * @param elementNode -
- * cannot be null
- * @param namespaceURI -
- * cannot be null
- * @return location hint (systemId) if it was found, null otherwise
- */
- private String getLocationHint(Element elementNode, String namespaceURI) {
- Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
- if (schemaLocNode != null) {
- StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
- while (st.hasMoreTokens()) {
- String publicId = st.hasMoreTokens() ? st.nextToken() : null;
- String systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // found location hint
- if (namespaceURI.equalsIgnoreCase(publicId))
- return systemId;
- }
- }
- return null;
- }
-
- /**
- * Returns the URI string
- *
- * @param node -
- * assumes not null
- */
- private String getURIString(Node node, IDocument document) {
- String resolvedURI = null;
- // need the base location, publicId, and systemId for URIResolver
- String baseLoc = null;
- String publicId = null;
- String systemId = null;
-
- short nodeType = node.getNodeType();
- // handle doc type node
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- baseLoc = getBaseLocation(document);
- publicId = ((DocumentType) node).getPublicId();
- systemId = ((DocumentType) node).getSystemId();
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute node
- Attr attrNode = (Attr) node;
- String attrName = attrNode.getName();
- String attrValue = attrNode.getValue();
- attrValue = StringUtils.strip(attrValue);
- if (attrValue != null && attrValue.length() > 0) {
- baseLoc = getBaseLocation(document);
-
- // handle schemaLocation attribute
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- publicId = attrValue;
- systemId = getLocationHint(attrNode.getOwnerElement(), publicId);
- if (systemId == null) {
- systemId = attrValue;
- }
- }
- else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
- // for now just use the first pair
- // need to look into being more precise
- StringTokenizer st = new StringTokenizer(attrValue);
- publicId = st.hasMoreTokens() ? st.nextToken() : null;
- systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // else check if xmlns publicId = value
- }
- else {
- systemId = attrValue;
- }
- }
- }
-
- resolvedURI = resolveURI(baseLoc, publicId, systemId);
- return resolvedURI;
- }
-
- /**
- * Returns true if this uriString is an http string
- *
- * @param uriString
- * @return true if uriString is http string, false otherwise
- */
- private boolean isHttp(String uriString) {
- boolean isHttp = false;
- if (uriString != null) {
- String tempString = uriString.toLowerCase();
- if (tempString.startsWith(HTTP_PROTOCOL))
- isHttp = true;
- }
- return isHttp;
- }
-
- /**
- * Checks to see if the given attribute is openable. Attribute is openable
- * if it is a namespace declaration attribute or if the attribute value is
- * of type URI.
- *
- * @param attr
- * cannot be null
- * @param cmElement
- * CMElementDeclaration associated with the attribute (can be
- * null)
- * @return true if this attribute is "openOn-able" false otherwise
- */
- private boolean isLinkableAttr(Attr attr, CMElementDeclaration cmElement) {
- String attrName = attr.getName();
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- // determine if attribute is namespace declaration
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName)))
- return true;
-
- // determine if attribute contains schema location
- if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attr))) && ((SCHEMA_LOCATION.equals(unprefixedName)) || (NO_NAMESPACE_SCHEMA_LOCATION.equals(unprefixedName))))
- return true;
-
- // determine if attribute value is of type URI
- if (cmElement != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) cmElement.getAttributes().getNamedItem(attrName);
- if ((attrDecl != null) && (attrDecl.getAttrType() != null) && (CMDataType.URI.equals(attrDecl.getAttrType().getDataTypeName()))) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Checks whether the given uriString is really pointing to a file
- *
- * @param uriString
- * @return boolean
- */
- private boolean isValidURI(String uriString) {
- boolean isValid = false;
-
- if (isHttp(uriString))
- isValid = true;
- else {
- File file = getFileFromUriString(uriString);
- if (file != null)
- isValid = file.isFile();
- }
- return isValid;
- }
-
- /**
- * Resolves the given URI information
- *
- * @param baseLocation
- * @param publicId
- * @param systemId
- * @return String resolved uri.
- */
- private String resolveURI(String baseLocation, String publicId, String systemId) {
- // dont resolve if there's nothing to resolve
- if ((baseLocation == null) && (publicId == null) && (systemId == null))
- return null;
- return URIResolverPlugin.createResolver().resolve(baseLocation, publicId, systemId);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
deleted file mode 100644
index e505f4dd30..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.refactoring;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.DocumentChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.encoding.CodedStreamCreator;
-
-/**
- * Creates document change(s) for an IJavaElement rename.
- * Changes are created for every type "match" in the workspace
- * @author pavery
- */
-public class BasicRefactorSearchRequestor extends SearchRequestor {
-
- /**
- * Workspace operation to perform save on model for updated documents.
- * Should only be done on models not open in an editor.
- */
- private class SaveJspFileOp extends WorkspaceModifyOperation {
-
- private IDocument fJSPDoc = null;
- private IFile fJSPFile = null;
-
- public SaveJspFileOp(IFile jspFile, IDocument jspDoc) {
- this.fJSPDoc = jspDoc;
- this.fJSPFile = jspFile;
- }
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3765
- // save file w/ no intermediate model creation
-
- CodedStreamCreator codedStreamCreator = new CodedStreamCreator();
- Reader reader = new DocumentReader(this.fJSPDoc);
- codedStreamCreator.set(this.fJSPFile, reader);
-
- ByteArrayOutputStream codedByteStream = null;
- InputStream codedStream = null;
- try {
- codedByteStream = codedStreamCreator.getCodedByteArrayOutputStream();
- codedStream = new ByteArrayInputStream(codedByteStream.toByteArray());
- if (this.fJSPFile.exists())
- this.fJSPFile.setContents(codedStream, true, true, null);
- else
- this.fJSPFile.create(codedStream, false, null);
-
- } catch (CoreException e) {
- Logger.logException(e);
- } catch (IOException e) {
- Logger.logException(e);
- }
- finally {
- try {
- if(codedByteStream != null)
- codedByteStream.close();
- if(codedStream != null)
- codedStream.close();
- }
- catch (IOException e){
- // unlikely
- }
- }
- }
- }
- // end inner class SaveJspFileOp
-
- /**
- * Change class that wraps a text edit on the jsp document
- */
- private class RenameChange extends DocumentChange {
-
- private TextEdit fEdit = null;
- private IFile fJSPFile = null;
- private IDocument fJSPDoc = null;
- private String fDescription = JSPUIMessages.BasicRefactorSearchRequestor_0;
-
- public RenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) {
- super(JSPUIMessages.BasicRefactorSearchRequestor_6, jspDoc);
- this.fEdit = edit;
- this.fJSPFile = jspFile;
- this.fJSPDoc = jspDoc;
- this.fDescription = description;
- }
-
- public RefactoringStatus isValid(IProgressMonitor pm)throws CoreException {
- return new RefactoringStatus();
- }
-
- public IDocument getPreviewDocument(IProgressMonitor pm) throws CoreException {
- IDocument copyDoc = new Document(fJSPDoc.get());
- try {
- fEdit.apply(copyDoc);
- }
- catch (MalformedTreeException e) {
- // ignore
- }
- catch (BadLocationException e) {
- // ignore
- }
- return copyDoc;
- }
-
- public Change perform(IProgressMonitor pm) throws CoreException {
- RenameChange undoChange = null;
- try {
-
- if(!isOpenInEditor(this.fJSPDoc)) {
- // apply edit to JSP doc AND save model
- undoChange = new RenameChange(this.fJSPFile, this.fJSPDoc, this.fEdit.apply(fJSPDoc), this.fDescription);
- saveFile(this.fJSPFile, this.fJSPDoc);
- }
- else {
- // just apply edit to JSP document
- undoChange = new RenameChange(this.fJSPFile, this.fJSPDoc, this.fEdit.apply(fJSPDoc), this.fDescription);
- }
-
- } catch (MalformedTreeException e) {
- Logger.logException(e);
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- return undoChange;
- }
-
- /**
- * Performed in an operation since it modifies resources in the workspace
- * @param jspDoc
- * @throws CoreException
- */
- private void saveFile(IFile jspFile, IDocument jspDoc) {
-
- SaveJspFileOp op = new SaveJspFileOp(jspFile, jspDoc);
-
- try {
- op.run(JSPSearchSupport.getInstance().getProgressMonitor());
- } catch (InvocationTargetException e) {
- Logger.logException(e);
- } catch (InterruptedException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * Checks if a document is open in an editor
- * @param jspDoc
- * @return
- */
- private boolean isOpenInEditor(IDocument jspDoc) {
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- IWorkbenchWindow w = null;
- for (int i = 0; i < windows.length; i++) {
-
- w = windows[i];
- IWorkbenchPage page = w.getActivePage();
- if (page != null) {
-
- IEditorReference[] references = page.getEditorReferences();
- IEditorPart editor = null;
- Object o = null;
- IDocument doc = null;
- for (int j = 0; j < references.length; j++) {
-
- editor = references[j].getEditor(true);
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3764
- // use adapter to get ITextEditor (for things like
- // page designer)
- o = editor.getAdapter(ITextEditor.class);
- if (o != null && o instanceof ITextEditor) {
-
- doc = ((ITextEditor) o).getDocumentProvider().getDocument(editor.getEditorInput());
- if (doc != null && doc.equals(jspDoc)) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- public String getName() {
- return this.fDescription;
- }
-
- public Object getModifiedElement() {
- return getElement();
- }
- }
- // end inner class RenameChange
-
-
- /** The type being renamed (the old type)*/
- IJavaElement fElement = null;
- /** The new name of the type being renamed*/
- private String fNewName = ""; //$NON-NLS-1$
- /** maps a JSPSearchDocument path -> MultiTextEdit for the java file*/
- private HashMap fSearchDocPath2JavaEditMap = null;
-
- public BasicRefactorSearchRequestor(IJavaElement element, String newName) {
- this.fNewName = newName;
- this.fElement = element;
- this.fSearchDocPath2JavaEditMap = new HashMap();
- }
-
- public IJavaElement getElement() {
- return this.fElement;
- }
-
- /**
- * @return the new name for the Type
- */
- public String getNewName() {
- return this.fNewName;
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
- */
- public void acceptSearchMatch(SearchMatch javaMatch) throws CoreException {
-
- String matchDocumentPath = javaMatch.getResource().getFullPath().toString();
- SearchDocument searchDoc = JSPSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
-
- if (searchDoc != null && searchDoc instanceof JavaSearchDocumentDelegate) {
-
- String renameText = getRenameText((JavaSearchDocumentDelegate)searchDoc, javaMatch);
-
- // add it for the correct document
- addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
- }
- }
-
- /**
- * @param searchDoc
- * @return
- */
- protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
- return getNewName();
- }
-
- /**
- * Adds to the multi edit for a give java document.
- * @param javaDocument
- * @param javaEdit
- */
- private void addJavaEdit(String searchDocPath, ReplaceEdit javaEdit) {
-
- Object o = this.fSearchDocPath2JavaEditMap.get(searchDocPath);
- if(o != null) {
-
- MultiTextEdit multi = (MultiTextEdit)o;
- multi.addChild(javaEdit);
- }
- else {
- // use a multi edit so doc position offsets get updated automatically
- // when adding multiple child edits
- MultiTextEdit multi = new MultiTextEdit();
- multi.addChild(javaEdit);
- this.fSearchDocPath2JavaEditMap.put(searchDocPath, multi);
- }
- }
-
- /**
- *
- * @return all JSP changes for the search matches for the given Type
- */
- public Change[] getChanges() {
-
- JSPSearchSupport support = JSPSearchSupport.getInstance();
- List changes = new ArrayList();
- Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
- String searchDocPath = null;
- SearchDocument delegate = null;
-
- while(keys.hasNext()) {
- // create on the fly
- searchDocPath = (String)keys.next();
- MultiTextEdit javaEdit = (MultiTextEdit)fSearchDocPath2JavaEditMap.get(searchDocPath);
- delegate = support.getSearchDocument(searchDocPath);
-
- if(delegate != null && delegate instanceof JavaSearchDocumentDelegate) {
- JavaSearchDocumentDelegate javaDelegate = (JavaSearchDocumentDelegate)delegate;
- changes.add(createChange(javaDelegate, javaDelegate.getJspTranslation().getJspEdit(javaEdit)));
- }
- }
- return (Change[])changes.toArray(new Change[changes.size()]);
- }
-
- private Change createChange(JavaSearchDocumentDelegate searchDoc, TextEdit edit) {
-
- IDocument doc = searchDoc.getJspTranslation().getJspDocument();
- String file = searchDoc.getFile().getName();
- String description = getDescription();
- try {
- // document lines are 0 based
- String lineNumber = Integer.toString(doc.getLineOfOffset(edit.getOffset()) + 1);
- description += " " + NLS.bind(JSPUIMessages.BasicRefactorSearchRequestor_1, new String[]{file, lineNumber}); //$NON-NLS-1$
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- return new RenameChange(searchDoc.getFile(), doc, edit, description);
- }
-
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3205
- // only relevant for IType refactorings
- protected boolean isFullyQualified(String matchText) {
- if(getElement() instanceof IType) {
- String pkg = ((IType)getElement()).getPackageFragment().getElementName();
- return matchText.startsWith(pkg);
- }
- return false;
- }
-
- /**
- * Subclasses should override to better describe the change.
- * @return
- */
- protected String getDescription() {
- return ""; //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.java
deleted file mode 100644
index 38f2dac80a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPJavaSelectionProvider.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.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-class JSPJavaSelectionProvider {
- static IJavaElement[] getSelection(ITextEditor textEditor) {
- IJavaElement[] elements = null;
-
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- ISelection selection = textEditor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection = (ITextSelection) selection;
- // get the JSP translation object for this editor's document
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- try {
- if (model instanceof IDOMModel) {
- IDOMModel xmlModel = (IDOMModel)model;
- IDOMDocument xmlDoc = xmlModel.getDocument();
-
- JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (adapter != null) {
- JSPTranslation translation = adapter.getJSPTranslation();
- elements = translation.getElementsFromJspRange(textSelection.getOffset(), textSelection.getOffset() + textSelection.getLength());
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- if (elements == null) {
- elements = new IJavaElement[0];
- }
- return elements;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
deleted file mode 100644
index 485ff11a89..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameChange.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-/**
- * @author pavery
- */
-public class JSPMethodRenameChange extends Change {
-
- public static Change[] createChangesFor(IMethod method, String newName) {
- JSPSearchSupport support = JSPSearchSupport.getInstance();
-
- // should be handled by JSPIndexManager
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
- // support.indexWorkspaceAndWait();
-
- BasicRefactorSearchRequestor requestor = new JSPMethodRenameRequestor(method, newName);
- support.searchRunnable(method, new JSPSearchScope(), requestor);
-
- return requestor.getChanges();
- }
-
- public String getName() {
- return JSPUIMessages.JSP_changes; //$NON-NLS-1$
- }
-
- public void initializeValidationData(IProgressMonitor pm) {
- // pa_TODO implement
- // must be implemented to decide correct value of isValid
- }
-
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
- // pa_TODO implement
- // This method must ensure that the change object is still valid.
- // This is in particular interesting when performing an undo change
- // since the workspace could have changed since the undo change has
- // been created.
- return new RefactoringStatus();
- }
-
- public Change perform(IProgressMonitor pm) throws CoreException {
- // pa_TODO return the "undo" change here
- return null;
- }
-
- public Object getModifiedElement() {
- // pa_TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
deleted file mode 100644
index edac9c846d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 May 6, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * @author pavery
- */
-public class JSPMethodRenameParticipant extends RenameParticipant {
-
- private IMethod fMethod = null;
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- if(element instanceof IMethod) {
- this.fMethod = (IMethod) element;
- return true;
- }
- return false;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- String name = ""; //$NON-NLS-1$
- if(this.fMethod != null) {
- try {
- name = this.fMethod.getSource();
- } catch (JavaModelException e) {
- Logger.logException(e);
- }
- }
- return name;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
- // TODO Auto-generated method stub
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException {
- Change[] changes = JSPMethodRenameChange.createChangesFor(this.fMethod, getArguments().getNewName());
- CompositeChange multiChange = null;
- if(changes.length > 0)
- multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
- return multiChange;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.java
deleted file mode 100644
index 6147208de9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameRequestor.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.jst.jsp.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-
-/**
- * @author pavery
- */
-public class JSPMethodRenameRequestor extends BasicRefactorSearchRequestor {
-
- public JSPMethodRenameRequestor(IJavaElement element, String newName) {
- super(element, newName);
- }
-
- protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
-
- String javaText = searchDoc.getJspTranslation().getJavaText();
- String methodText = javaText.substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
- String methodSuffix = methodText.substring(methodText.indexOf("(")); //$NON-NLS-1$
- return getNewName() + methodSuffix;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
- protected String getDescription() {
-
- String methodName = getElement().getElementName();
- String newName = getNewName();
- String description = MessageFormat.format(JSPUIMessages.BasicRefactorSearchRequestor_3, new String[]{methodName, newName}); //$NON-NLS-1$
- return description;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
deleted file mode 100644
index b61d4bdf8d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.refactoring;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
- * An action delegate that launches JDT move element wizard
- *
- * Still relies heavily on internal API
- * will change post 3.0 with public move support
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
- */
-public class JSPMoveElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- //private IEditorPart fEditor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- //fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- //fEditor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(JSPUIMessages.MoveElement_label);
- action.setToolTipText(JSPUIMessages.MoveElement_label);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void run(IAction action) {
-
- // no-op until we know how we're supposed to use this
- // eclipse 3.2M5
- // public move support: https://bugs.eclipse.org/bugs/show_bug.cgi?id=61817
-
-// IJavaElement[] elements = getSelectedElements();
-// if (elements.length > 0) {
-//
-// // need to check if it's movable
-// try {
-// JavaMoveProcessor processor = JavaMoveProcessor.create(getResources(elements), elements);
-//
-// Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
-// MoveRefactoring refactoring = new MoveRefactoring(processor);
-//
-// RefactoringWizard wizard = createWizard(refactoring);
-//
-// /*
-// * We want to get the shell from the refactoring dialog but
-// * it's not known at this point, so we pass the wizard and
-// * then, once the dialog is open, we will have access to its
-// * shell.
-// */
-//
-// processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
-// processor.setReorgQueries(new ReorgQueries(wizard));
-// // String openRefactoringWizMsg =
-// // RefactoringMessages.getString("OpenRefactoringWizardAction.refactoring");
-// // //$NON-NLS-1$
-// String openRefactoringWizMsg = JSPUIMessages.MoveElementWizard; // "Move
-// // the
-// // selected
-// // elements";
-// // //$NON-NLS-1$
-// new RefactoringStarter().activate(refactoring, wizard, parent, openRefactoringWizMsg, true);
-//
-// PlatformStatusLineUtil.clearStatusLine();
-//
-// }
-// catch (JavaModelException e) {
-// Logger.logException(e);
-// }
-// }
-// else {
-// PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPMoveElementAction_0); //$NON-NLS-1$
-// }
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- PlatformStatusLineUtil.clearStatusLine();
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
-
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
deleted file mode 100644
index d15e089ab0..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameChange.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-/**
- * @author pavery
- */
-public class JSPPackageRenameChange extends Change {
-
- public static Change[] createChangesFor(IPackageFragment pkg, String newName) {
- JSPSearchSupport support = JSPSearchSupport.getInstance();
-
- // should be handled by JSPIndexManager
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
- //support.indexWorkspaceAndWait();
-
- BasicRefactorSearchRequestor requestor = new JSPPackageRenameRequestor(pkg, newName);
- support.searchRunnable(pkg, new JSPSearchScope(), requestor);
-
- return requestor.getChanges();
- }
-
- public String getName() {
- return JSPUIMessages.JSP_changes; //$NON-NLS-1$
- }
-
- public void initializeValidationData(IProgressMonitor pm) {
- // pa_TODO implement
- // must be implemented to decide correct value of isValid
- }
-
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
- // pa_TODO implement
- // This method must ensure that the change object is still valid.
- // This is in particular interesting when performing an undo change
- // since the workspace could have changed since the undo change has
- // been created.
- return new RefactoringStatus();
- }
-
- public Change perform(IProgressMonitor pm) throws CoreException {
- // TODO return the "undo" change here
- return null;
- }
-
- public Object getModifiedElement() {
-
- //return this.pkg;
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
deleted file mode 100644
index 3903d39882..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameParticipant.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * Remember to change the plugin.xml file if the name of this class changes.
- *
- * @author pavery
- */
-public class JSPPackageRenameParticipant extends RenameParticipant {
-
- private IPackageFragment fPkg = null;
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- if(element instanceof IPackageFragment) {
- this.fPkg = (IPackageFragment) element;
- return true;
- }
- return false;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- String name = ""; //$NON-NLS-1$
- if(this.fPkg != null) {
- name = this.fPkg.getElementName();
- }
- return name;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException {
- Change[] changes = JSPPackageRenameChange.createChangesFor(this.fPkg, getArguments().getNewName());
- CompositeChange multiChange = null;
- if(changes.length > 0)
- multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
- return multiChange;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
deleted file mode 100644
index 3cffa0cd11..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPPackageRenameRequestor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Overrides get description
- * @author pavery
- */
-public class JSPPackageRenameRequestor extends BasicRefactorSearchRequestor {
-
- /**
- * Element is the old package. newName is the new package name.
- * @param element
- * @param newName
- */
- public JSPPackageRenameRequestor(IJavaElement element, String newName) {
- super(element, newName);
- }
-
- /*
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
- protected String getDescription() {
- String packageName = getElement().getElementName();
- String newName = getNewName();
- String description = NLS.bind(JSPUIMessages.BasicRefactorSearchRequestor_5, (new String[]{packageName, newName})); //$NON-NLS-1$
- return description;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
deleted file mode 100644
index f487fc54a4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.ui.refactoring.RenameSupport;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-/**
- * An action delegate that launches JDT rename element wizard
- */
-public class JSPRenameElementActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(JSPUIMessages.RenameElement_label);
- action.setToolTipText(JSPUIMessages.RenameElement_label);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void run(IAction action) {
- IJavaElement element = getSelectedElement();
- if(element != null) {
- RenameSupport renameSupport = null;
- try {
- switch(element.getElementType()) {
- case IJavaElement.TYPE:
- renameSupport= RenameSupport.create((IType)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
- break;
- case IJavaElement.METHOD:
- renameSupport= RenameSupport.create((IMethod)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
- break;
- case IJavaElement.PACKAGE_FRAGMENT:
- renameSupport= RenameSupport.create((IPackageFragment)element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
- break;
- }
- if(renameSupport != null) {
- renameSupport.openDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
- PlatformStatusLineUtil.clearStatusLine();
- }
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- else {
- PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPRenameElementAction_0); //$NON-NLS-1$
- PlatformStatusLineUtil.addOneTimeClearListener();
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- PlatformStatusLineUtil.clearStatusLine();
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- private IJavaElement getSelectedElement() {
- IJavaElement element = null;
- if (fEditor instanceof ITextEditor) {
- IJavaElement[] elements = JSPJavaSelectionProvider.getSelection((ITextEditor)fEditor);
- if (elements.length == 1)
- element = elements[0];
- }
- return element;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.java
deleted file mode 100644
index facd6802fb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveChange.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.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-/**
- * @author pavery
- */
-public class JSPTypeMoveChange extends Change {
-
- public static Change[] createChangesFor(IType type, String newName) {
-
- JSPSearchSupport support = JSPSearchSupport.getInstance();
- // should be handled by JSPIndexManager
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
- // support.indexWorkspaceAndWait();
-
- JSPTypeMoveRequestor requestor = new JSPTypeMoveRequestor(type, newName);
- support.searchRunnable(type, new JSPSearchScope(), requestor);
-
- return requestor.getChanges();
- }
-
- public String getName() {
- return JSPUIMessages.JSP_changes; //$NON-NLS-1$
- }
-
- public void initializeValidationData(IProgressMonitor pm) {
- // pa_TODO implement
- // must be implemented to decide correct value of isValid
- }
-
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
- // pa_TODO implement
- // This method must ensure that the change object is still valid.
- // This is in particular interesting when performing an undo change
- // since the workspace could have changed since the undo change has
- // been created.
- return new RefactoringStatus();
- }
-
- public Change perform(IProgressMonitor pm) throws CoreException {
- // TODO return the "undo" change here
- return null;
- }
-
- public Object getModifiedElement() {
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
deleted file mode 100644
index 40c80b17f4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveParticipant.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
-
-/**
- * @author pavery
- */
-public class JSPTypeMoveParticipant extends MoveParticipant {
-
- IType fType = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
-
- if(element instanceof IType) {
- this.fType = (IType)element;
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
-
- String name = ""; //$NON-NLS-1$
- if(this.fType != null)
- name = this.fType.getElementName();
- return name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException {
-
- if(pm != null && pm.isCanceled())
- return null;
-
- CompositeChange multiChange = null;
- Object dest = getArguments().getDestination();
-
- if(dest instanceof IPackageFragment) {
- Change[] changes = JSPTypeMoveChange.createChangesFor(fType, ((IPackageFragment)dest).getElementName());
- if(changes.length > 0)
- multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
- }
- return multiChange;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.java
deleted file mode 100644
index edd02f29de..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeMoveRequestor.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.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-
-/**
- * @author pavery
- */
-public class JSPTypeMoveRequestor extends BasicRefactorSearchRequestor {
-
- /**
- * @param element
- * @param newName
- */
- public JSPTypeMoveRequestor(IJavaElement element, String newPackage) {
- super(element, newPackage);
- }
-
- protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
-
- String renameText = getElement().getElementName();
-
- JSPTranslation trans = searchDoc.getJspTranslation();
- String matchText = trans.getJavaText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
-
- // if it's an import or jsp:useBean, we need to add the package name as well
- if(trans.isImport(javaMatch.getOffset()) || trans.isUseBean(javaMatch.getOffset()) || isFullyQualified(matchText)) {
- if(!getNewName().equals("")) //$NON-NLS-1$
- // getNewName() is the pkg name
- renameText = getNewName() + "." + renameText; //$NON-NLS-1$
- }
- return renameText;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
- protected String getDescription() {
-
- String typeName = getElement().getElementName();
- String newName = getNewName();
- String description = MessageFormat.format(JSPUIMessages.BasicRefactorSearchRequestor_2, new String[]{typeName, newName}); //$NON-NLS-1$
- return description;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
deleted file mode 100644
index 99f1666adf..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameChange.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-
-
-/**
- * @author pavery
- */
-public class JSPTypeRenameChange extends Change {
-
- public static Change[] createChangesFor(IType type, String newName) {
- JSPSearchSupport support = JSPSearchSupport.getInstance();
-
- // should be handled by JSPIndexManager
- // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3036
- // support.indexWorkspaceAndWait();
-
-
- JSPTypeRenameRequestor requestor = new JSPTypeRenameRequestor(type, newName);
- support.searchRunnable(type, new JSPSearchScope(), requestor);
-
- return requestor.getChanges();
- }
-
- public String getName() {
- return JSPUIMessages.JSP_changes; //$NON-NLS-1$
- }
-
- public void initializeValidationData(IProgressMonitor pm) {
- // pa_TODO implement
- // must be implemented to decide correct value of isValid
- }
-
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException {
- // pa_TODO implement
- // This method must ensure that the change object is still valid.
- // This is in particular interesting when performing an undo change
- // since the workspace could have changed since the undo change has
- // been created.
- return new RefactoringStatus();
- }
-
- public Change perform(IProgressMonitor pm) throws CoreException {
- // TODO return the "undo" change here
- return null;
- }
-
- public Object getModifiedElement() {
- // TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
deleted file mode 100644
index e6a16de886..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameParticipant.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.refactoring;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-/**
- * Remember to change the plugin.xml file if the name of this class changes.
- *
- * @author pavery
- */
-public class JSPTypeRenameParticipant extends RenameParticipant {
-
- private IType fType = null;
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
- */
- protected boolean initialize(Object element) {
- if(element instanceof IType) {
- this.fType = (IType) element;
- return true;
- }
- return false;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
- */
- public String getName() {
- String name = ""; //$NON-NLS-1$
- if(this.fType != null) {
- try {
- name = this.fType.getSource();
- } catch (JavaModelException e) {
- Logger.logException(e);
- }
- }
- return name;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#checkConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
- */
- public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(IProgressMonitor pm) throws CoreException {
- Change[] changes = JSPTypeRenameChange.createChangesFor(fType, getArguments().getNewName());
- CompositeChange multiChange = null;
- if(changes.length > 0)
- multiChange = new CompositeChange(JSPUIMessages.JSP_changes, changes); //$NON-NLS-1$
- return multiChange;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
deleted file mode 100644
index d93ccf7e19..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.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.ui.internal.java.refactoring;
-
-import java.text.MessageFormat;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-
-/**
- * Creates document change(s) for a type rename.
- * Changes are created for every type "match" in the workspace
- * @author pavery
- */
-public class JSPTypeRenameRequestor extends BasicRefactorSearchRequestor {
-
- public JSPTypeRenameRequestor(IType type, String newName) {
- super(type, newName);
- }
-
- private IType getType() {
- return (IType)getElement();
- }
-
- protected String getRenameText(JavaSearchDocumentDelegate searchDoc, SearchMatch javaMatch) {
-
- String renameText = getNewName();
-
- String pkg = getType().getPackageFragment().getElementName();
- JSPTranslation trans = searchDoc.getJspTranslation();
- String matchText = trans.getJavaText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength());
-
- // if it's an import or jsp:useBean or fully qualified type, we need to add the package name as well
- if(trans.isImport(javaMatch.getOffset()) || /*trans.isUseBean(javaMatch.getOffset()) ||*/ isFullyQualified(matchText)) {
- if(!pkg.equals("")) //$NON-NLS-1$
- renameText = pkg + "." + renameText; //$NON-NLS-1$
- }
- return renameText;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsp.ui.internal.java.refactoring.BasicRefactorSearchRequestor#getDescription()
- */
- protected String getDescription() {
-
- String typeName = getElement().getElementName();
- String newName = getNewName();
- String description = MessageFormat.format(JSPUIMessages.BasicRefactorSearchRequestor_4, new String[]{typeName, newName}); //$NON-NLS-1$
- return description;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.java
deleted file mode 100644
index ae3dbc49c6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/BasicJSPSearchRequestor.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.ui.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.core.internal.java.search.JavaSearchDocumentDelegate;
-
-/**
- * Accepts matches from JSPSearchSupport.search(...) request.
- * Adapts the results from java to JSP and displays in the SearchResultView.
- *
- * @author pavery
- */
-public class BasicJSPSearchRequestor extends SearchRequestor {
-
- // 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$
- }
-
- /**
- * Maps java search coordinates to corresponding JSP coordinates.
- * Adds the matches to the Search Results view.
- * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
- */
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
-
- if(JSPSearchSupport.getInstance().isCanceled())
- return;
-
- String matchDocumentPath = match.getResource().getFullPath().toString();
- SearchDocument searchDoc = JSPSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
-
- if (searchDoc != null && searchDoc instanceof JavaSearchDocumentDelegate) {
- JavaSearchDocumentDelegate javaSearchDoc = (JavaSearchDocumentDelegate)searchDoc;
- int jspStart = javaSearchDoc.getJspOffset(match.getOffset());
- int jspEnd = javaSearchDoc.getJspOffset(match.getOffset() + match.getLength());
-
- JSPTranslation trans = javaSearchDoc.getJspTranslation();
- String jspText = trans.getJspText();
- String javaText = javaSearchDoc.getJavaText();
-
- if (DEBUG)
- displayDebugInfo(match, jspStart, jspEnd, jspText, javaText);
-
- if (jspStart > -1 && jspEnd > -1)
- addSearchMatch(new Document(trans.getJspText()), javaSearchDoc.getFile(), jspStart, jspEnd, jspText);
- }
- }
-
- /**
- * @param searchDoc
- * @param jspStart
- * @param jspEnd
- * @param jspTranslation
- * @param jspText
- * @throws CoreException
- */
- protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
- // implement in subclass
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.core.search.SearchRequestor#beginReporting()
- */
- public void beginReporting() {
-
- if (DEBUG)
- System.out.println("JSP Search requestor: beginReporting()"); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchRequestor#endReporting()
- */
- public void endReporting() {
-
- if (DEBUG)
- System.out.println("JSP Search requestor: endReporting()"); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchRequestor#enterParticipant(org.eclipse.jdt.core.search.SearchParticipant)
- */
- public void enterParticipant(SearchParticipant participant) {
-
- if (DEBUG)
- System.out.println("JSP Search requestor: enterParticipant()"); //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jdt.core.search.SearchRequestor#exitParticipant(org.eclipse.jdt.core.search.SearchParticipant)
- */
- public void exitParticipant(SearchParticipant participant) {
-
- if (DEBUG)
- System.out.println("JSP Search requestor: exitParticipant()"); //$NON-NLS-1$
- }
-
- /**
- * For debug.
- * @param origMatch
- * @param jspStart
- * @param jspEnd
- * @param jspText
- * @param javaText
- */
- private void displayDebugInfo(SearchMatch origMatch, int jspStart, int jspEnd, String jspText, String javaText) {
-
- if (origMatch == null || jspStart == -1 || jspEnd == -1 || jspEnd < jspStart || jspText == null || javaText == null)
- return;
-
- System.out.println("+-----------------------------------------+"); //$NON-NLS-1$
- System.out.println("accept possible match [jspDoc: " + origMatch.getResource().getFullPath().toOSString() + " " + origMatch.getOffset() + ":" + origMatch.getOffset() + origMatch.getLength() + "]?"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- System.out.println("match info:"); //$NON-NLS-1$
- System.out.println("the java text is:" + javaText.substring(origMatch.getOffset(), origMatch.getOffset() + origMatch.getLength())); //$NON-NLS-1$
- System.out.println("java search match translates to jsp coords [start: " + jspStart + " end:" + jspEnd + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.println(" the jsp text is:" + jspText.substring(jspStart, jspEnd)); //$NON-NLS-1$
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
deleted file mode 100644
index 2eaeec0af6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.search;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
-
-/**
- * Sets up FindOccurrencesActionDelegate for jsp find occurrences processors
- */
-public class JSPFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
- private List fProcessors;
-
- protected List getProcessors() {
- if (fProcessors == null) {
- fProcessors = new ArrayList();
- HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
- fProcessors.add(htmlProcessor);
-// temporary, workaround to disable function, since using the function
-// can easily cause deadlock to occur.
-// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=103662
-// JSPFindOccurrencesProcessor jspProcessor = new JSPFindOccurrencesProcessor();
-// fProcessors.add(jspProcessor);
- }
- return fProcessors;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
deleted file mode 100644
index 9ff15c3028..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * Configures a FindOccurrencesProcessor with JSP partitions and regions
- */
-public class JSPFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
- protected String[] getPartitionTypes() {
- return new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_CONTENT_JAVA};
- }
-
- protected String[] getRegionTypes() {
- return new String[]{DOMRegionContext.BLOCK_TEXT, DOMJSPRegionContexts.JSP_CONTENT};
- }
-
- protected ISearchQuery getSearchQuery(IFile file, IStructuredDocument document, String regionText, String regionType, ITextSelection textSelection) {
- return new JSPSearchQuery(file, getJavaElement(document, textSelection));
- }
-
- private IJavaElement getJavaElement(IDocument document, ITextSelection textSelection) {
- IJavaElement[] elements = getJavaElementsForCurrentSelection(document, textSelection);
- return elements.length > 0 ? elements[0] : null;
- }
-
- /**
- * uses JSPTranslation to get currently selected Java elements.
- *
- * @return currently selected IJavaElements
- */
- private IJavaElement[] getJavaElementsForCurrentSelection(IDocument document, ITextSelection selection) {
- IJavaElement[] elements = new IJavaElement[0];
- // get JSP translation object for this viewer's document
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- try {
- if (model != null && model instanceof IDOMModel) {
- IDOMDocument xmlDoc = ((IDOMModel) model).getDocument();
- JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (adapter != null) {
- JSPTranslation translation = adapter.getJSPTranslation();
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=102211
- elements = translation.getElementsFromJspRange(selection.getOffset(), selection.getOffset() + selection.getLength());
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- return elements;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.java
deleted file mode 100644
index f1d4f8e4db..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPOccurrencesSearchResult.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.jst.jsp.ui.internal.java.search;
-
-import org.eclipse.search.ui.ISearchQuery;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult;
-
-/**
- * @author pavery
- */
-public class JSPOccurrencesSearchResult extends OccurrencesSearchResult {
-
- public JSPOccurrencesSearchResult(ISearchQuery query) {
- super(query);
- }
-
- public Match[] getMatches() {
- return ((JSPSearchQuery)getQuery()).getMatches();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
deleted file mode 100644
index 5f96141abd..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchQuery.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.search.SearchDocument;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.wst.sse.ui.internal.search.BasicSearchQuery;
-
-/**
- * Implementation of <code>ISearchQuery</code> for <code>IJavaElement</code>s in JSP files.
- *
- * @author pavery
- */
-public class JSPSearchQuery extends BasicSearchQuery {
-
- /** the IJavaElement we are searching for in the file **/
- private IJavaElement fElement = null;
-
- public JSPSearchQuery(IFile file, IJavaElement element) {
- super(file);
- this.fElement = element;
- }
-
- public IJavaElement getJavaElement() {
- return this.fElement;
- }
-
- // for access by inner class
- public JSPSearchQuery getInstance() {
- return this;
- }
-
- protected IStatus doQuery() {
-
- clearMatches();
-
- IStatus status = Status.OK_STATUS;
- try {
- JSPSearchSupport support = JSPSearchSupport.getInstance();
- // index the file
- SearchDocument delegate = support.addJspFile(getFile());
-
- String scopePath = delegate.getPath();
- JSPSearchScope singleFileScope = new JSPSearchScope(new String[]{getFile().getFullPath().toString(), scopePath});
-
- // perform a searchs
- // by passing in this jsp search query, requstor can add matches
- support.searchRunnable(getJavaElement(), singleFileScope, new JSPSingleFileSearchRequestor(getInstance()));
- }
- catch (Exception e){
- status = new Status(IStatus.ERROR, "org.eclipse.wst.sse.ui", IStatus.OK, "", null); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return status;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#getLabel()
- */
- public String getLabel() {
- String[] args = {getSearchText(), getOccurrencesCountText(), getFilename()};
- return NLS.bind(JSPUIMessages.OccurrencesSearchQuery_0, args);
- }
-
- private String getFilename() {
- String filename = JSPUIMessages.OccurrencesSearchQuery_2;
- if(getFile() != null)
- filename = getFile().getName();
- return filename;
- }
-
- private String getOccurrencesCountText() {
- String count = ""; //$NON-NLS-1$
- // pa_TODO make dynamic
- return count;
- }
-
- protected String getSearchText() {
- return fElement.getElementName();
- }
-
- public boolean canRerun() {
-
- return false;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground()
- */
- public boolean canRunInBackground() {
- return true;
- }
-
- /**
- * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
- */
- public ISearchResult getSearchResult() {
-
- return new JSPOccurrencesSearchResult(this);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java
deleted file mode 100644
index 9dc8275308..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSearchRequestor.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.search;
-
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.ui.search.ISearchRequestor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.search.ui.NewSearchUI;
-import org.eclipse.search.ui.text.Match;
-
-
-/**
- * @author pavery
- */
-public class JSPSearchRequestor extends BasicJSPSearchRequestor {
-
- private ISearchRequestor fJavaRequestor = null;
-
- public JSPSearchRequestor() {
- super();
- }
-
- public JSPSearchRequestor(ISearchRequestor javaRequestor) {
- // need to report matches to javaRequestor
- this.fJavaRequestor = javaRequestor;
- }
-
-
- protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
-
- if(!jspFile.exists())
- return;
-
- int lineNumber = -1;
- try {
- lineNumber = jspDocument.getLineOfOffset(jspStart);
- } catch (BadLocationException e) {
- Logger.logException(e);
- }
- createSearchMarker(jspFile, jspStart, jspEnd, lineNumber);
-
- if(this.fJavaRequestor != null) {
- Match match = new Match(jspFile, jspStart, jspEnd - jspStart);
- this.fJavaRequestor.reportMatch(match);
- }
- }
-
- /**
- * @param jspFile
- * @param jspStart
- * @param jspEnd
- */
- private void createSearchMarker(IFile jspFile, int jspStart, int jspEnd, int lineNumber) {
-
- try {
- IMarker marker = jspFile.createMarker(NewSearchUI.SEARCH_MARKER);
- HashMap attributes = new HashMap(4);
- attributes.put(IMarker.CHAR_START, new Integer(jspStart));
- attributes.put(IMarker.CHAR_END, new Integer(jspEnd));
- attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
- marker.setAttributes(attributes);
-
- } catch (CoreException e) {
- Logger.logException(e);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.java
deleted file mode 100644
index 4e35d83bed..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPSingleFileSearchRequestor.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.ui.internal.java.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-
-
-/**
- * <p>
- * Special requestor that adds search results for single file search
- * (Used for JSPFindOccurrences action).
- * It groups each match as it's own result.
- * </p>
- *
- * @author pavery
- */
-public class JSPSingleFileSearchRequestor extends BasicJSPSearchRequestor {
-
- private JSPSearchQuery fQuery = null;
-
- public JSPSingleFileSearchRequestor(JSPSearchQuery query) {
- this.fQuery = query;
- }
-
- protected void addSearchMatch(IDocument jspDocument, IFile jspFile, int jspStart, int jspEnd, String jspText) {
- // add match to JSP query...
- this.fQuery.addMatch(jspDocument, jspStart, jspEnd);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.java
deleted file mode 100644
index 74b1a26c91..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPMatchPresentation.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.ui.internal.java.search.ui;
-
-import org.eclipse.jdt.ui.search.IMatchPresentation;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.sse.ui.internal.search.BasicSearchLabelProvider;
-
-/**
- * @author pavery
- */
-public class JSPMatchPresentation implements IMatchPresentation {
-
- /**
- * @see org.eclipse.jdt.ui.search.IMatchPresentation#createLabelProvider()
- */
- public ILabelProvider createLabelProvider() {
- return new BasicSearchLabelProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.search.IMatchPresentation#showMatch(org.eclipse.search.ui.text.Match, int, int, boolean)
- */
- public void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException {
- // pa_TODO implement
-// Object obj = match.getElement();
- // show match in JSP editor
- if(activate) {
- // use show in target?
- }
- else {
- // just select
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
deleted file mode 100644
index badbf187b6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/ui/JSPQueryParticipant.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.java.search.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jdt.ui.search.ElementQuerySpecification;
-import org.eclipse.jdt.ui.search.IMatchPresentation;
-import org.eclipse.jdt.ui.search.IQueryParticipant;
-import org.eclipse.jdt.ui.search.ISearchRequestor;
-import org.eclipse.jdt.ui.search.PatternQuerySpecification;
-import org.eclipse.jdt.ui.search.QuerySpecification;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchScope;
-import org.eclipse.jst.jsp.core.internal.java.search.JSPSearchSupport;
-import org.eclipse.jst.jsp.ui.internal.java.search.JSPSearchRequestor;
-
-/**
- * @author pavery
- */
-public class JSPQueryParticipant implements IQueryParticipant {
-
- // 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$
- }
- /**
- * @see org.eclipse.jdt.ui.search.IQueryParticipant#search(org.eclipse.jdt.ui.search.ISearchRequestor, org.eclipse.jdt.ui.search.QuerySpecification, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
-
- //indexIfNeeded();
-
- // do search based on the particular Java query
- if(querySpecification instanceof ElementQuerySpecification) {
- // element search (eg. from global find references in Java file)
- ElementQuerySpecification elementQuery = (ElementQuerySpecification)querySpecification;
- IJavaElement element = elementQuery.getElement();
-
- if(DEBUG)
- System.out.println("JSP Query Participant searching on ELEMENT: " + element); //$NON-NLS-1$
-
- SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
-
- // pa_TODO need to adapt JavaSearchScope to a JSPSearchScope
- JSPSearchSupport.getInstance().search(element, new JSPSearchScope(), jspRequestor);
-
- }
- else if(querySpecification instanceof PatternQuerySpecification) {
-
- // pattern search (eg. from Java search page)
- PatternQuerySpecification patternQuery = (PatternQuerySpecification)querySpecification;
- String pattern = patternQuery.getPattern();
-
- if(DEBUG)
- System.out.println("JSP Query Participant searching on PATTERN: " + pattern); //$NON-NLS-1$
-
- SearchRequestor jspRequestor = new JSPSearchRequestor(requestor);
-
- JSPSearchSupport.getInstance().search(pattern,
- new JSPSearchScope(),
- patternQuery.getSearchFor(),
- patternQuery.getLimitTo(),
- SearchPattern.R_PATTERN_MATCH,
- false,
- jspRequestor);
- }
- }
-
- /**
- * @see org.eclipse.jdt.ui.search.IQueryParticipant#estimateTicks(org.eclipse.jdt.ui.search.QuerySpecification)
- */
- public int estimateTicks(QuerySpecification data) {
- // pa_TODO use project file counter from JSPSearchSupport...
- return 0;
- }
-
- /**
- * @see org.eclipse.jdt.ui.search.IQueryParticipant#getUIParticipant()
- */
- public IMatchPresentation getUIParticipant() {
- return new JSPMatchPresentation();
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
deleted file mode 100644
index 7b2649ae49..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Sets default values for JSP UI preferences
- */
-public class JSPUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = JSPUIPlugin.getDefault().getPreferenceStore();
-
- // setting the same as HTML
- store.setDefault(JSPUIPreferenceNames.AUTO_PROPOSE, true);
- store.setDefault(JSPUIPreferenceNames.AUTO_PROPOSE_CODE, "<");//$NON-NLS-1$
-
- // JSP Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-
- styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
-
- // specified value is black; leaving as widget default
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue);
-
- styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
- store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-
- styleValue = ColorHelper.getColorString(191, 95, 63) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsJSP.JSP_CONTENT, styleValue);
-
- // set default new jsp file template to use in new file wizard
- /*
- * Need to find template name that goes with default template id (name
- * may change for differnt language)
- */
- String templateName = ""; //$NON-NLS-1$
- Template template = JSPUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.jst.jsp.ui.templates.jsphtml"); //$NON-NLS-1$
- if (template != null)
- templateName = template.getName();
- store.setDefault(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
deleted file mode 100644
index c185063249..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.preferences;
-
-/**
- * Preference keys for JSP UI
- */
-public class JSPUIPreferenceNames {
- /**
- * A named preference that controls if code assist gets auto activated.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String AUTO_PROPOSE = getAutoProposeKey();
-
- private static String getAutoProposeKey() {
- return "autoPropose";//$NON-NLS-1$
- }
-
- /**
- * A named preference that holds the characters that auto activate code
- * assist.
- * <p>
- * Value is of type <code>String</code>. All characters that trigger
- * auto code assist.
- * </p>
- */
- public static final String AUTO_PROPOSE_CODE = getAutoProposeCodeKey();
-
- private static String getAutoProposeCodeKey() {
- return "autoProposeCode";//$NON-NLS-1$
- }
-
- /**
- * The key to store customized templates.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String TEMPLATES_KEY = getTemplatesKey();
-
- private static String getTemplatesKey() {
- return "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
- }
-
- /**
- * The key to store the last template name used in new JSP file wizard.
- * Template name is stored instead of template id because user-created
- * templates do not have template ids.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
deleted file mode 100644
index 7e9eb80c1b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-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.internal.preferences.ui.StyledTextColorPicker;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-public class JSPColorPage extends XMLColorPage {
-
- /**
- * Overridden to set up StyledTextColorPicker differently
- */
- protected void createContentsForPicker(Composite parent) {
- // create the color picker
- fPicker = new JSPStyledTextColorPicker(parent, SWT.NULL);
- GridData data = new GridData(GridData.FILL_BOTH);
- fPicker.setLayoutData(data);
-
- fPicker.setPreferenceStore(fOverlayStore);
- setupPicker(fPicker);
-
- fPicker.setText(getSampleText());
- }
-
- /**
- * 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, (String)i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- public String getSampleText() {
- return JSPUIMessages.Sample_JSP_doc; //$NON-NLS-1$ = "<%@ page \n\tlanguage=\"java\" \n\tcontentType=\"text/html; charset=ISO-8859-1\"\n%>\n<jsp:include flush=\"true\" page=\"titleBar.jsp\"/>\n\n<%-- Use below tags ONLY for JSP 1.1 --%>\n<%\n\tSystem.out.println(\"Welcome!\");\n%>\n<%-- Use below tags ONLY for JSP 1.2 --%>\n<jsp:scriptlet>\n\tSystem.out.println(\"Welcome!\");\n</jsp:scriptlet>"
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
-
- initCommonContextStyleMap(contextStyleMap);
- contextStyleMap.remove(DOMRegionContext.XML_CONTENT); // leave content between tags alone
- contextStyleMap.remove(DOMRegionContext.XML_DECLARATION_OPEN); // xml/html specific
- contextStyleMap.remove(DOMRegionContext.XML_DECLARATION_CLOSE); // xml/html specific
- contextStyleMap.remove(DOMRegionContext.XML_ELEMENT_DECLARATION); // xml/html specific
- contextStyleMap.remove(DOMRegionContext.XML_ELEMENT_DECL_CLOSE); // xml/html specific
-
- // contextStyleMap.put(XMLJSPRegionContexts.JSP_CONTENT, HTMLColorManager.SCRIPT_AREA);
- // contextStyleMap.put(XMLJSPRegionContexts.BLOCK_TEXT, HTMLColorManager.SCRIPT_AREA);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_DECLARATION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_EXPRESSION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
-
- contextStyleMap.put(DOMJSPRegionContexts.JSP_CONTENT, IStyleConstantsJSP.JSP_CONTENT);
-
- contextStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME, IStyleConstantsXML.TAG_NAME);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- contextStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
-
- contextStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- contextStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- }
-
- protected void initDescriptions(Dictionary descriptions) {
- initCommonDescriptions(descriptions);
- descriptions.remove(IStyleConstantsXML.XML_CONTENT); // leave content between tags alone
- descriptions.remove(IStyleConstantsXML.DECL_BORDER); // xml/html specific
- descriptions.put(IStyleConstantsHTML.SCRIPT_AREA_BORDER, JSPUIMessages.JSP_Delimiters_UI_); //$NON-NLS-1$ = "JSP Delimiters"
- descriptions.put(IStyleConstantsJSP.JSP_CONTENT, JSPUIMessages.JSPColorPage_jsp_content);
- }
-
- protected void initStyleList(ArrayList list) {
- initCommonStyleList(list);
- list.remove(IStyleConstantsXML.XML_CONTENT); // leave content between tags alone
- list.remove(IStyleConstantsXML.DECL_BORDER); // xml/html specific
- list.add(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- list.add(IStyleConstantsJSP.JSP_CONTENT);
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForJSP.ContentTypeID_JSP).getParser());
-
- // create descriptions for highlighting types
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- // map region types to highlighting types
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
-
- Control c = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.JSP_PREFWEBX_STYLES_HELPID);
- return c;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- JSPUIPlugin.getDefault().savePluginPreferences();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
deleted file mode 100644
index ffd71b7b69..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-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.PlatformUI;
-import org.eclipse.wst.html.ui.internal.preferences.ui.HTMLFilesPreferencePage;
-
-public class JSPFilesPreferencePage extends HTMLFilesPreferencePage {
- private Button fValidateFragments;
-
- protected Preferences getModelPreferences() {
- return JSPCorePlugin.getDefault().getPluginPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- JSPCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
-
- Group g = createGroup((Composite) c, 1);
- g.setText(JSPUIMessages.JSPFilesPreferencePage_0);
- fValidateFragments = createCheckBox(g, JSPUIMessages.JSPFilesPreferencePage_1);
- boolean validateFragments = getModelPreferences().getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS);
- fValidateFragments.setSelection(validateFragments);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
-
- setSize((Composite)c);
- return c;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#createContentsForLoadingGroup(org.eclipse.swt.widgets.Composite)
- */
- protected void createContentsForLoadingGroup(Composite parent) {
- // no loading preferences
- }
-
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#initializeValuesForLoadingGroup()
- */
- protected void initializeValuesForLoadingGroup() {
- // no loading preferences
- }
-
- protected void performDefaults() {
- super.performDefaults();
-
- boolean validateFragments = getModelPreferences().getDefaultBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS);
- fValidateFragments.setSelection(validateFragments);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#performDefaultsForLoadingGroup()
- */
- protected void performDefaultsForLoadingGroup() {
- // no loading preferences
- }
-
- protected void storeValues() {
- boolean validateFragments = fValidateFragments.getSelection();
- getModelPreferences().setValue(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, validateFragments);
- super.storeValues();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#storeValuesForLoadingGroup()
- */
- protected void storeValuesForLoadingGroup() {
- // no loading preferences
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java
deleted file mode 100644
index 4830cdaced..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-
-public class JSPSourcePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = createScrolledComposite(parent);
-
- Text label = new Text(composite, SWT.READ_ONLY);
- label.setText(JSPUIMessages.JSPSourcePreferencePage_0);
- GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- data.horizontalIndent = 0;
- label.setLayoutData(data);
-
- PreferenceLinkArea fileEditorsArea = new PreferenceLinkArea(composite, SWT.NONE, "org.eclipse.wst.html.ui.preferences.source", JSPUIMessages.JSPSourcePreferencePage_1,//$NON-NLS-1$
- (IWorkbenchPreferenceContainer) getContainer(), null);
-
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- data.horizontalIndent = 5;
- fileEditorsArea.getControl().setLayoutData(data);
-
- PreferenceLinkArea contentTypeArea = new PreferenceLinkArea(composite, SWT.NONE, "org.eclipse.wst.sse.ui.preferences.xml.source", JSPUIMessages.JSPSourcePreferencePage_2,//$NON-NLS-1$
- (IWorkbenchPreferenceContainer) getContainer(), null);
-
- data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- data.horizontalIndent = 5;
- contentTypeArea.getControl().setLayoutData(data);
-
- setSize(composite);
- return composite;
- }
-
- private Composite createScrolledComposite(Composite parent) {
- // create scrollbars for this parent when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite composite = createComposite(sc1);
- sc1.setContent(composite);
-
- // not calling setSize for composite will result in a blank composite,
- // so calling it here initially
- // setSize actually needs to be called after all controls are created,
- // so scrolledComposite
- // has correct minSize
- setSize(composite);
- return composite;
- }
-
- private void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-
- private Composite createComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL);
- data.horizontalIndent = 0;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
-
- composite.setFont(parent.getFont());
- return composite;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java
deleted file mode 100644
index 19bd809d7c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPStyledTextColorPicker.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.preferences.ui;
-
-import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;
-
-/**
-* Overrides StyledTextColorPicker for special enablement behavior
-* for JSPContent (only background settable)
-**/
-public class JSPStyledTextColorPicker extends StyledTextColorPicker {
-
- public JSPStyledTextColorPicker(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * Activate controls based on the given local color type.
- * Overridden to disable foreground color, bold.
- */
- protected void activate(String namedStyle) {
- super.activate(namedStyle);
-
- if(namedStyle == IStyleConstantsJSP.JSP_CONTENT) {
- fForeground.setEnabled(false);
- fBold.setEnabled(false);
- if (showItalic)
- fItalic.setEnabled(false);
- fForegroundLabel.setEnabled(false);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
deleted file mode 100644
index e4151c3611..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.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.ui.internal.preferences.ui;
-
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-
-
-/**
- * Preference page for JSP templates
- */
-public class JSPTemplatePreferencePage extends TemplatePreferencePage {
-
- public JSPTemplatePreferencePage() {
- JSPUIPlugin jspEditorPlugin = JSPUIPlugin.getDefault();
-
- setPreferenceStore(jspEditorPlugin.getPreferenceStore());
- setTemplateStore(jspEditorPlugin.getTemplateStore());
- setContextTypeRegistry(jspEditorPlugin.getTemplateContextRegistry());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- JSPUIPlugin.getDefault().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);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.JSP_PREFWEBX_TEMPLATES_HELPID);
- return c;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java
deleted file mode 100644
index f1a58f1ef2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionAnnotationModelChanges.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.w3c.dom.Node;
-
-/**
- * Contains a set of projection model additions/deletions/modifications
- */
-class ProjectionAnnotationModelChanges {
- // copies of this class located in:
- // org.eclipse.wst.xml.ui.internal.projection
- // org.eclipse.wst.css.ui.internal.projection
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
- private Node fNode;
- private Annotation[] fDeletions;
- private Map fAdditions;
- private Annotation[] fModifications;
-
- public ProjectionAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
- fNode = node;
- fDeletions = deletions;
- fAdditions = additions;
- fModifications = modifications;
- }
-
- public Map getAdditions() {
- return fAdditions;
- }
-
- public Annotation[] getDeletions() {
- return fDeletions;
- }
-
- public Annotation[] getModifications() {
- return fModifications;
- }
-
- public Node getNode() {
- return fNode;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index 3612ec63a5..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- /**
- * List of projection viewers currently associated with this projection
- * model node adapter factory.
- */
- private HashMap fProjectionViewers;
-
- public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey) {
- super(adapterKey);
- }
-
- public ProjectionModelNodeAdapterFactoryHTML() {
- this(ProjectionModelNodeAdapterHTML.class);
- }
-
- /**
- * Actually creates an adapter for the parent of target if target is the
- * "adapt-able" node
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if ((isActive()) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
- Node node = (Node) target;
- if (isNodeProjectable(node)) {
-
- // actually work with the parent node to listen for add,
- // delete events
- Node parent = node.getParentNode();
- if (parent instanceof INodeNotifier) {
- INodeNotifier parentNotifier = (INodeNotifier) parent;
- ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (parentAdapter == null) {
- // create a new adapter for parent
- parentAdapter = new ProjectionModelNodeAdapterHTML(this);
- parentNotifier.addAdapter(parentAdapter);
- }
- // call update on parent because a new node has just been
- // added
- parentAdapter.updateAdapter(parent);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Returns true if node is a node type able to fold
- *
- * @param node
- * @return boolean true if node is projectable, false otherwise
- */
- boolean isNodeProjectable(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String tagName = node.getNodeName();
- // node is only projectable if it is head, body, script, style,
- // table, ul, ol tags
- if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.UL.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.OL.equalsIgnoreCase(tagName))
- return true;
- }
- return false;
- }
-
- /**
- * Return true if this factory is currently actively managing projection
- *
- * @return
- */
- boolean isActive() {
- return (fProjectionViewers != null && !fProjectionViewers.isEmpty());
- }
-
- /**
- * Updates projection annotation model if document is not in flux.
- * Otherwise, queues up the changes to be applied when document is ready.
- *
- * @param node
- * @param deletions
- * @param additions
- * @param modifications
- */
- void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
- queueAnnotationModelChanges(node, deletions, additions, modifications, null);
- }
-
- /**
- * Updates projection annotation model for a specific projection viewer if
- * document is not in flux. Otherwise, queues up the changes to be applied
- * when document is ready.
- *
- * @param node
- * @param deletions
- * @param additions
- * @param modifications
- * @param viewer
- */
- void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications, ProjectionViewer viewer) {
- // create a change object for latest change and add to queue
- ProjectionAnnotationModelChanges newChange = new ProjectionAnnotationModelChanges(node, deletions, additions, modifications);
- if (fProjectionViewers != null) {
- if (viewer != null) {
- ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.get(viewer);
- if (info != null) {
- info.queueAnnotationModelChanges(newChange);
- }
- }
- else {
- Iterator infos = fProjectionViewers.values().iterator();
- while (infos.hasNext()) {
- ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
- info.queueAnnotationModelChanges(newChange);
- }
- }
- }
- }
-
- public void release() {
- // go through every projectionviewer and call
- // removeProjectionViewer(viewer);
- if (fProjectionViewers != null) {
- Iterator infos = fProjectionViewers.values().iterator();
- while (infos.hasNext()) {
- ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
- info.dispose();
- infos.remove();
- }
- fProjectionViewers = null;
- }
- super.release();
- }
-
- /**
- * Adds viewer to list of projection viewers this factory is associated
- * with
- *
- * @param viewer -
- * assumes viewer's document and projection annotation model
- * are not null
- */
- void addProjectionViewer(ProjectionViewer viewer) {
- // remove old entry if it exists
- removeProjectionViewer(viewer);
-
- if (fProjectionViewers == null) {
- fProjectionViewers = new HashMap();
- }
-
- // create new object containing projection viewer and its info
- ProjectionViewerInformation info = new ProjectionViewerInformation(viewer);
- fProjectionViewers.put(viewer, info);
- info.initialize();
- }
-
- /**
- * Removes the given viewer from the list of projection viewers this
- * factor is associated with
- *
- * @param viewer
- */
- void removeProjectionViewer(ProjectionViewer viewer) {
- if (fProjectionViewers != null) {
- // remove entry from list of viewers
- ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.remove(viewer);
- if (info != null) {
- info.dispose();
- }
- // if removing last projection viewer, clear out everything
- if (fProjectionViewers.isEmpty()) {
- fProjectionViewers = null;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java
deleted file mode 100644
index 911edfee68..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterFactoryJSP.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.projection;
-
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryJSP extends ProjectionModelNodeAdapterFactoryHTML {
- public ProjectionModelNodeAdapterFactoryJSP() {
- this(ProjectionModelNodeAdapterJSP.class);
- }
-
- public ProjectionModelNodeAdapterFactoryJSP(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- public ProjectionModelNodeAdapterFactoryJSP(Object adapterKey) {
- super(adapterKey);
- }
-
- /**
- * Actually creates an adapter for the parent of target if target is the
- * "adapt-able" node
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if ((isActive()) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
- Node node = (Node) target;
- if (isNodeProjectable(node)) {
-
- // actually work with the parent node to listen for add,
- // delete events
- Node parent = node.getParentNode();
- if (parent instanceof INodeNotifier) {
- INodeNotifier parentNotifier = (INodeNotifier) parent;
- ProjectionModelNodeAdapterJSP parentAdapter = (ProjectionModelNodeAdapterJSP) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
- if (parentAdapter == null) {
- // create a new adapter for parent
- parentAdapter = new ProjectionModelNodeAdapterJSP(this);
- parentNotifier.addAdapter(parentAdapter);
- }
- // call update on parent because a new node has just been
- // added
- parentAdapter.updateAdapter(parent);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Returns true if node is a node type able to fold
- *
- * @param node
- * @return boolean true if node is projectable, false otherwise
- */
- boolean isNodeProjectable(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String tagName = node.getNodeName();
- // node is only projectable if it is jsp scriptlet tag
- if (JSP11Namespace.ElementName.SCRIPTLET.equalsIgnoreCase(tagName))
- return true;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index 97621b6611..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
- private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private class TagProjectionAnnotation extends ProjectionAnnotation {
- private boolean fIsVisible = false; /* workaround for BUG85874 */
- private Node fNode;
-
- public TagProjectionAnnotation(Node node, boolean isCollapsed) {
- super(isCollapsed);
- fNode = node;
- }
-
- public Node getNode() {
- return fNode;
- }
-
- public void setNode(Node node) {
- fNode = node;
- }
-
- /**
- * Does not paint hidden annotations. Annotations are hidden when they
- * only span one line.
- *
- * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
- * org.eclipse.swt.widgets.Canvas,
- * org.eclipse.swt.graphics.Rectangle)
- */
- public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
- /* workaround for BUG85874 */
- /*
- * only need to check annotations that are expanded because hidden
- * annotations should never have been given the chance to
- * collapse.
- */
- if (!isCollapsed()) {
- // working with rectangle, so line height
- FontMetrics metrics = gc.getFontMetrics();
- if (metrics != null) {
- // do not draw annotations that only span one line and
- // mark them as not visible
- if ((rectangle.height / metrics.getHeight()) <= 1) {
- fIsVisible = false;
- return;
- }
- }
- }
- fIsVisible = true;
- super.paint(gc, canvas, rectangle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
- */
- public void markCollapsed() {
- /* workaround for BUG85874 */
- // do not mark collapsed if annotation is not visible
- if (fIsVisible)
- super.markCollapsed();
- }
- }
-
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
- private Map fTagAnnotations = new HashMap();
-
- public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
- fAdapterFactory = factory;
- }
-
- /**
- * Create a projection position from the given node. Able to get
- * projection position if node isNodeProjectable.
- *
- * @param node
- * @return null if no projection position possible, a Position otherwise
- */
- private Position createProjectionPosition(Node node) {
- Position pos = null;
- if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
- // IDocument document =
- // fAdapterFactory.getProjectionViewer().getDocument();
- // if (document != null) {
- IndexedRegion inode = (IndexedRegion) node;
- int start = inode.getStartOffset();
- int end = inode.getEndOffset();
- if (start >= 0 && start < end) {
- // region-based
- // extra line when collapsed, but no region
- // increase when add newline
- pos = new Position(start, end - start);
- // try {
- // // line-based
- // // extra line when collapsed, but no region
- // // increase when add newline
- // IRegion startLineRegion =
- // document.getLineInformationOfOffset(start);
- // IRegion endLineRegion =
- // document.getLineInformationOfOffset(end);
- // int startOffset = startLineRegion.getOffset();
- // int endOffset = endLineRegion.getOffset() +
- // endLineRegion.getLength();
- // if (endOffset > startOffset) {
- // pos = new Position(startOffset, endOffset -
- // startOffset);
- // }
- //
- // // line-based
- // // no extra line when collapsed, but region increase
- // // when add newline
- // int startLine = document.getLineOfOffset(start);
- // int endLine = document.getLineOfOffset(end);
- // if (endLine + 1 < document.getNumberOfLines()) {
- // int offset = document.getLineOffset(startLine);
- // int endOffset = document.getLineOffset(endLine + 1);
- // pos = new Position(offset, endOffset - offset);
- // }
- // }
- // catch (BadLocationException x) {
- // Logger.log(Logger.WARNING_DEBUG, null, x);
- // }
- }
- }
- // }
- return pos;
- }
-
- /**
- * Find TagProjectionAnnotation for node in the current list of projection
- * annotations for this adapter
- *
- * @param node
- * @return TagProjectionAnnotation
- */
- private TagProjectionAnnotation getExistingAnnotation(Node node) {
- TagProjectionAnnotation anno = null;
-
- if ((node != null) && (!fTagAnnotations.isEmpty())) {
- Iterator it = fTagAnnotations.keySet().iterator();
- while (it.hasNext() && anno == null) {
- TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
- Node n = a.getNode();
- if (node.equals(n)) {
- anno = a;
- }
- }
- }
- return anno;
- }
-
- public boolean isAdapterForType(Object type) {
- return type == ProjectionModelNodeAdapterHTML.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // check if folding is even enabled, if not, just ignore notifyChanged
- // events
- if (!fAdapterFactory.isActive()) {
- return;
- }
-
- if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
- updateAdapter((Node) notifier);
- }
- }
-
- /**
- * Update the projection annotation of all the nodes that are children of
- * node
- *
- * @param node
- */
- void updateAdapter(Node node) {
- updateAdapter(node, null);
- }
-
- /**
- * Update the projection annotation of all the nodes that are children of
- * node and adds all projection annotations to viewer (for newly added
- * viewers)
- *
- * @param node
- * @param viewer
- */
- void updateAdapter(Node node, ProjectionViewer viewer) {
- long start = System.currentTimeMillis();
-
- Map additions = new HashMap();
- Map projectionAnnotations = new HashMap();
-
- // go through immediate child nodes and figure out projection
- // model annotations
- if (node != null) {
- Node childNode = node.getFirstChild();
- while (childNode != null) {
- Position newPos = createProjectionPosition(childNode);
- if (newPos != null) {
- TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
- TagProjectionAnnotation existing = getExistingAnnotation(childNode);
- if (existing == null) {
- // add to map containing all annotations for this
- // adapter
- projectionAnnotations.put(newAnnotation, newPos);
- // add to map containing annotations to add
- additions.put(newAnnotation, newPos);
- }
- else {
- // add to map containing all annotations for this
- // adapter
- projectionAnnotations.put(existing, newPos);
- // remove from map containing annotations to delete
- fTagAnnotations.remove(existing);
- }
- }
- childNode = childNode.getNextSibling();
- }
-
- // in the end, want to delete anything leftover in old list, add
- // everything in additions, and update everything in
- // projectionAnnotations
- ProjectionAnnotation[] oldList = null;
- if (!fTagAnnotations.isEmpty()) {
- oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
- }
- ProjectionAnnotation[] modifyList = null;
- if (!projectionAnnotations.isEmpty()) {
- modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
- }
-
- // specifically add all annotations to viewer
- if (viewer != null && !projectionAnnotations.isEmpty()) {
- fAdapterFactory.queueAnnotationModelChanges(node, null, projectionAnnotations, null, viewer);
- }
-
- // only update when there is something to update
- if ((oldList != null && oldList.length > 0) || (!additions.isEmpty()) || (modifyList != null && modifyList.length > 0))
- fAdapterFactory.queueAnnotationModelChanges(node, oldList, additions, modifyList);
- }
-
- // save new list of annotations
- fTagAnnotations = projectionAnnotations;
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
- System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java
deleted file mode 100644
index a195368688..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionModelNodeAdapterJSP.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.projection;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterJSP extends ProjectionModelNodeAdapterHTML {
- public ProjectionModelNodeAdapterJSP(ProjectionModelNodeAdapterFactoryJSP factory) {
- super(factory);
- }
-
- public boolean isAdapterForType(Object type) {
- return type == ProjectionModelNodeAdapterJSP.class;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java
deleted file mode 100644
index 5f84d1cc2e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/ProjectionViewerInformation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-
-/**
- * Contains information about a projection viewer and also manages updating
- * the viewer's projection annotation model
- */
-class ProjectionViewerInformation {
- // copies of this class located in:
- // org.eclipse.wst.xml.ui.internal.projection
- // org.eclipse.wst.css.ui.internal.projection
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- /**
- * Listens to document to be aware of when to update the projection
- * annotation model.
- */
- private class DocumentListener implements IDocumentListener {
- private ProjectionViewerInformation fInfo;
-
- public DocumentListener(ProjectionViewerInformation info) {
- fInfo = info;
- }
-
- public void documentAboutToBeChanged(DocumentEvent event) {
- IDocument document = event.getDocument();
- if (fInfo.getDocument() == document) {
- fInfo.setIsDocumentChanging(true);
- }
- }
-
- public void documentChanged(DocumentEvent event) {
- // register a post notification replace so that projection
- // annotation model will be updated after all documentChanged
- // listeners have been notified
- IDocument document = event.getDocument();
- if (document instanceof IDocumentExtension && fInfo.getDocument() == document) {
- if (fInfo.hasChangesQueued())
- ((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener(fInfo));
- }
- }
- }
-
- /**
- * Essentially a post document changed listener because it is called after
- * documentchanged has been fired.
- */
- private class PostDocumentChangedListener implements IDocumentExtension.IReplace {
- private ProjectionViewerInformation fInfo;
-
- public PostDocumentChangedListener(ProjectionViewerInformation info) {
- fInfo = info;
- }
-
- public void perform(IDocument document, IDocumentListener owner) {
- fInfo.applyAnnotationModelChanges();
- fInfo.setIsDocumentChanging(false);
- }
- }
-
- /**
- * Projection annotation model current associated with this projection
- * viewer
- */
- private ProjectionAnnotationModel fProjectionAnnotationModel;
- /**
- * Document currently associated with this projection viewer
- */
- private IDocument fDocument;
- /**
- * Listener to fProjectionViewer's document
- */
- private IDocumentListener fDocumentListener;
- /**
- * Indicates whether or not document is in the middle of changing
- */
- private boolean fIsDocumentChanging = false;
- /**
- * List of projection annotation model changes that need to be applied
- */
- private List fQueuedAnnotationChanges;
-
- public ProjectionViewerInformation(ProjectionViewer viewer) {
- fDocument = viewer.getDocument();
- fProjectionAnnotationModel = viewer.getProjectionAnnotationModel();
- }
-
- IDocument getDocument() {
- return fDocument;
- }
-
- private List getQueuedAnnotationChanges() {
- if (fQueuedAnnotationChanges == null) {
- fQueuedAnnotationChanges = new ArrayList();
- }
- return fQueuedAnnotationChanges;
- }
-
- void setIsDocumentChanging(boolean changing) {
- fIsDocumentChanging = changing;
- }
-
- private boolean isDocumentChanging() {
- return fIsDocumentChanging;
- }
-
- /**
- * Applies the pending projection annotation model changes to the
- * projection annotation model.
- */
- void applyAnnotationModelChanges() {
- List queuedChanges = getQueuedAnnotationChanges();
- // go through all the pending annotation changes and apply
- // them to
- // the projection annotation model
- while (!queuedChanges.isEmpty()) {
- ProjectionAnnotationModelChanges changes = (ProjectionAnnotationModelChanges) queuedChanges.remove(0);
- try {
- fProjectionAnnotationModel.modifyAnnotations(changes.getDeletions(), changes.getAdditions(), changes.getModifications());
- }
- catch (Exception e) {
- // if anything goes wrong, log it be continue
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-
- /**
- * Returns true if there are annotation changes queued up, false otherwise
- *
- * @return boolean
- */
- boolean hasChangesQueued() {
- return !getQueuedAnnotationChanges().isEmpty();
- }
-
- /**
- * Updates projection annotation model if document is not in flux.
- * Otherwise, queues up the changes to be applied when document is ready.
- */
- public void queueAnnotationModelChanges(ProjectionAnnotationModelChanges newChange) {
- /*
- * future_TODO: maybe improve by checking if annotation projection
- * model change already exists for node. if so, throw out old change.
- */
- getQueuedAnnotationChanges().add(newChange);
-
- // if document isn't changing, go ahead and apply it
- if (!isDocumentChanging()) {
- applyAnnotationModelChanges();
- }
- }
-
- public void initialize() {
- // add document listener
- if (fDocumentListener == null) {
- fDocumentListener = new DocumentListener(this);
- }
- getDocument().addDocumentListener(fDocumentListener);
- }
-
- public void dispose() {
- // remove document listener
- if (fDocumentListener != null) {
- getDocument().removeDocumentListener(fDocumentListener);
- }
-
- // clear out list of queued changes since it may no longer
- // be accurate
- if (fQueuedAnnotationChanges != null) {
- fQueuedAnnotationChanges.clear();
- fQueuedAnnotationChanges = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
deleted file mode 100644
index 12666af0d1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
+++ /dev/null
@@ -1,399 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for JSP.
- */
-public class StructuredTextFoldingProviderJSP implements IStructuredTextFoldingProvider, IProjectionListener, ITextInputListener {
- private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jst.jsp.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private IDocument fDocument;
- private ProjectionViewer fViewer;
- private boolean fProjectionNeedsToBeEnabled = false;
- /**
- * Maximum number of child nodes to add adapters to (limit for performance
- * sake)
- */
- private final int MAX_CHILDREN = 10;
- /**
- * Maximum number of sibling nodes to add adapters to (limit for
- * performance sake)
- */
- private final int MAX_SIBLINGS = 1000;
-
- /**
- * Adds an adapter to node and its children
- *
- * @param node
- * @param childLevel
- */
- private void addAdapterToNodeAndChildren(Node node, int childLevel) {
- // stop adding initial adapters MAX_CHILDREN levels deep for
- // performance sake
- if (node instanceof INodeNotifier && childLevel < MAX_CHILDREN) {
- INodeNotifier notifier = (INodeNotifier) node;
-
- // try and get the adapter for the current node and update the
- // adapter with projection information
- ProjectionModelNodeAdapterJSP adapter = (ProjectionModelNodeAdapterJSP) notifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
- if (adapter != null) {
- adapter.updateAdapter(node, fViewer);
- }
- else {
- // just call getadapter so the adapter is created and
- // automatically initialized
- notifier.getAdapterFor(ProjectionModelNodeAdapterJSP.class);
- }
- ProjectionModelNodeAdapterHTML adapter2 = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (adapter2 != null) {
- adapter2.updateAdapter(node);
- }
- else {
- // just call getadapter so the adapter is created and
- // automatically initialized
- notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
- }
- int siblingLevel = 0;
- Node nextChild = node.getFirstChild();
- while (nextChild != null && siblingLevel < MAX_SIBLINGS) {
- Node childNode = nextChild;
- nextChild = childNode.getNextSibling();
-
- addAdapterToNodeAndChildren(childNode, childLevel + 1);
- ++siblingLevel;
- }
- }
- }
-
- /**
- * Goes through every node and adds an adapter onto each for tracking
- * purposes
- */
- private void addAllAdapters() {
- long start = System.currentTimeMillis();
-
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- int startOffset = 0;
- IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
- if (startNode instanceof Node) {
- int siblingLevel = 0;
- Node nextSibling = (Node) startNode;
- while (nextSibling != null && siblingLevel < MAX_SIBLINGS) {
- Node currentNode = nextSibling;
- nextSibling = currentNode.getNextSibling();
-
- addAdapterToNodeAndChildren(currentNode, 0);
- ++siblingLevel;
- }
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- }
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderJSP.addAllAdapters: " + (end - start)); //$NON-NLS-1$
- }
- }
-
- /**
- * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
- * provider.
- *
- * @return ProjectionModelNodeAdapterFactoryHTML
- */
- private ProjectionModelNodeAdapterFactoryHTML getAdapterFactoryHTML(boolean createIfNeeded) {
- long start = System.currentTimeMillis();
-
- ProjectionModelNodeAdapterFactoryHTML factory = null;
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
- // getting the projectionmodelnodeadapter for the first
- // time
- // so do some initializing
- if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
- ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
- // add factory to factory registry
- factoryRegistry.addFactory(newFactory);
-
- // add factory to propogating adapter
- IDOMModel domModel = (IDOMModel) sModel;
- Document document = domModel.getDocument();
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- if (propagatingAdapter != null) {
- propagatingAdapter.addAdaptOnCreateFactory(newFactory);
- }
- }
-
- // try and get the factory
- factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- }
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderJSP.getAdapterFactoryHTML: " + (end - start)); //$NON-NLS-1$
- }
- return factory;
- }
-
- /**
- * Get the ProjectionModelNodeAdapterFactoryJSP to use with this provider.
- *
- * @return ProjectionModelNodeAdapterFactoryJSP
- */
- private ProjectionModelNodeAdapterFactoryJSP getAdapterFactoryJSP(boolean createIfNeeded) {
- long start = System.currentTimeMillis();
-
- ProjectionModelNodeAdapterFactoryJSP factory = null;
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
- // getting the projectionmodelnodeadapter for the first
- // time
- // so do some initializing
- if (!factoryRegistry.contains(ProjectionModelNodeAdapterJSP.class) && createIfNeeded) {
- ProjectionModelNodeAdapterFactoryJSP newFactory = new ProjectionModelNodeAdapterFactoryJSP();
-
- // add factory to factory registry
- factoryRegistry.addFactory(newFactory);
-
- // add factory to propogating adapter
- IDOMModel domModel = (IDOMModel) sModel;
- Document document = domModel.getDocument();
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- if (propagatingAdapter != null) {
- propagatingAdapter.addAdaptOnCreateFactory(newFactory);
- }
- }
-
- // try and get the factory
- factory = (ProjectionModelNodeAdapterFactoryJSP) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterJSP.class);
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- }
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderJSP.getAdapterFactoryJSP: " + (end - start)); //$NON-NLS-1$
- }
- return factory;
- }
-
- /**
- * Initialize this provider with the correct document. Assumes projection
- * is enabled. (otherwise, only install would have been called)
- */
- public void initialize() {
- if (!isInstalled())
- return;
-
- // clear out old info
- projectionDisabled();
-
- fDocument = fViewer.getDocument();
-
- // set projection viewer on new document's adapter factory
- if (fViewer.getProjectionAnnotationModel() != null) {
- ProjectionModelNodeAdapterFactoryJSP factory = getAdapterFactoryJSP(true);
- if (factory != null) {
- factory.addProjectionViewer(fViewer);
- }
- ProjectionModelNodeAdapterFactoryHTML factory2 = getAdapterFactoryHTML(true);
- if (factory2 != null) {
- factory2.addProjectionViewer(fViewer);
- }
-
- addAllAdapters();
- }
- fProjectionNeedsToBeEnabled = false;
- }
-
- /**
- * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
- *
- * @param viewer -
- * assumes not null
- */
- public void install(ProjectionViewer viewer) {
- // uninstall before trying to install new viewer
- if (isInstalled()) {
- uninstall();
- }
- fViewer = viewer;
- fViewer.addProjectionListener(this);
- fViewer.addTextInputListener(this);
- }
-
- private boolean isInstalled() {
- return fViewer != null;
- }
-
- public void projectionDisabled() {
- ProjectionModelNodeAdapterFactoryJSP factory = getAdapterFactoryJSP(false);
- if (factory != null) {
- factory.removeProjectionViewer(fViewer);
- }
- ProjectionModelNodeAdapterFactoryHTML factory2 = getAdapterFactoryHTML(false);
- if (factory2 != null) {
- factory2.removeProjectionViewer(fViewer);
- }
-
- // clear out all annotations
- if (fViewer.getProjectionAnnotationModel() != null)
- fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
- removeAllAdapters();
-
- fDocument = null;
- fProjectionNeedsToBeEnabled = false;
- }
-
- public void projectionEnabled() {
- initialize();
- }
-
- /**
- * Removes an adapter from node and its children
- *
- * @param node
- * @param level
- */
- private void removeAdapterFromNodeAndChildren(Node node, int level) {
- if (node instanceof INodeNotifier) {
- INodeNotifier notifier = (INodeNotifier) node;
-
- // try and get the adapter for the current node and remove it
- INodeAdapter adapter = notifier.getExistingAdapter(ProjectionModelNodeAdapterJSP.class);
- if (adapter != null) {
- notifier.removeAdapter(adapter);
- }
-
- INodeAdapter adapter2 = notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (adapter2 != null) {
- notifier.removeAdapter(adapter2);
- }
-
- Node nextChild = node.getFirstChild();
- while (nextChild != null) {
- Node childNode = nextChild;
- nextChild = childNode.getNextSibling();
-
- removeAdapterFromNodeAndChildren(childNode, level + 1);
- }
- }
- }
-
- /**
- * Goes through every node and removes adapter from each for cleanup
- * purposes
- */
- private void removeAllAdapters() {
- long start = System.currentTimeMillis();
-
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- int startOffset = 0;
- IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
- if (startNode instanceof Node) {
- Node nextSibling = (Node) startNode;
- while (nextSibling != null) {
- Node currentNode = nextSibling;
- nextSibling = currentNode.getNextSibling();
-
- removeAdapterFromNodeAndChildren(currentNode, 0);
- }
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- }
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderJSP.addAllAdapters: " + (end - start)); //$NON-NLS-1$
- }
- }
-
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- // if folding is enabled and new document is going to be a totally
- // different document, disable projection
- if (fDocument != null && fDocument != newInput) {
- // disable projection and disconnect everything
- projectionDisabled();
- fProjectionNeedsToBeEnabled = true;
- }
- }
-
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- // if projection was previously enabled before input document changed
- // and new document is different than old document
- if (fProjectionNeedsToBeEnabled && fDocument == null && newInput != null) {
- projectionEnabled();
- fProjectionNeedsToBeEnabled = false;
- }
- }
-
- /**
- * Disconnect this IStructuredTextFoldingProvider from projection viewer
- */
- public void uninstall() {
- if (isInstalled()) {
- projectionDisabled();
-
- fViewer.removeProjectionListener(this);
- fViewer.removeTextInputListener(this);
- fViewer = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java
deleted file mode 100644
index ec08c1574a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.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.ui.internal.registry;
-
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.modelhandler.ModelHandlerForJSP;
-import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class AdapterFactoryProviderForJSP implements AdapterFactoryProvider {
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
- // these are the main factories, on model's factory registry
- addContentBasedFactories(structuredModel);
- // -------
- // Must update/add to propagating adapters here too
- addPropagatingAdapters(structuredModel);
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
- FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- INodeAdapterFactory factory = null;
- factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
- if (factory == null) {
- factory = new JFaceNodeAdapterFactoryForHTML(IJFaceNodeAdapter.class, true);
- factoryRegistry.addFactory(factory);
- }
-
- factory = factoryRegistry.getFactoryFor(IJSPTranslation.class);
- if (factory == null) {
- factory = new JSPTranslationAdapterFactory();
- factoryRegistry.addFactory(factory);
- }
- }
-
- protected void addPropagatingAdapters(IStructuredModel structuredModel) {
-
- if (structuredModel instanceof IDOMModel) {
- IDOMModel xmlModel = (IDOMModel) structuredModel;
- IDOMDocument document = xmlModel.getDocument();
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) document.getAdapterFor(PropagatingAdapter.class);
- if (propagatingAdapter != null) {
- // what to do?
- }
- }
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForJSP);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java
deleted file mode 100644
index 2b81bf80d4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/IStyleConstantsJSP.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.style;
-
-public interface IStyleConstantsJSP {
- public static final String JSP_CONTENT = "jsp_content"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
deleted file mode 100644
index 68e8e3de3c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/LineStyleProviderForJSP.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Frits Jalvingh - contributions for bug 150794
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.provisional.style.AbstractLineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-public class LineStyleProviderForJSP extends AbstractLineStyleProvider implements LineStyleProvider{
-
- private String fLanguage = null;
-
- // private static final String JAVA = "java"; //$NON-NLS-1$
- // private static 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$
-
- public LineStyleProviderForJSP() {
- super();
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- /**
- * a method to centralize all the "sytle rules" for regions
- */
- TextAttribute result = null;
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
- }
- else {
-
- if (result == null) {
- String type = region.getType();
- if ((type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN) || (type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN) || (type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN) || (type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN) || (type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE) || (type == DOMJSPRegionContexts.JSP_CLOSE)) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- }
- else if (type == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME || type == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
- }
- else if ((type == DOMJSPRegionContexts.JSP_COMMENT_OPEN) || (type == DOMJSPRegionContexts.JSP_COMMENT_CLOSE)) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_BORDER);
- }
- else if (type == DOMJSPRegionContexts.JSP_COMMENT_TEXT) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.COMMENT_TEXT);
- }
- // ============ These are in common with XML --- (for XML form
- // of tags)
- // Note: this assume's this provider is only called for
- // true JSP Nodes. If its called for others, then this will
- // cause their tag names to be highlighted too!
- // Further checks could be done to prevent that, but doesn't
- // seem worth it, since if adpaters factories are working
- // right,
- // then wouldn't be needed.
- else if (type == DOMRegionContext.XML_TAG_NAME) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_NAME);
- }
- else if ((type == DOMRegionContext.XML_TAG_OPEN) || (type == DOMRegionContext.XML_END_TAG_OPEN) || (type == DOMRegionContext.XML_TAG_CLOSE) || (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_BORDER);
- }
- else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- }
- else if ((type == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE)|| (type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_DQUOTE) || (type == DOMJSPRegionContexts.JSP_TAG_ATTRIBUTE_VALUE_SQUOTE)) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- }
- else if (type == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- }
-
- // DMW: added 9/1/2002 Undefined color may need addjustment :)
- else if (type == DOMRegionContext.UNDEFINED)
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
-
- else if (type == DOMRegionContext.WHITE_SPACE)
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- // DMW added 8/30/2002 -- should provide JSP specific
- // preference for "custom tag content" (both tag dependent,
- // BLOCKED_TEXT, and not, XML CONTENT)
- else if (type == DOMRegionContext.XML_CONTENT)
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- else if (type == DOMRegionContext.BLOCK_TEXT)
- result = (TextAttribute) getTextAttributes().get(IStyleConstantsXML.CDATA_TEXT);
- }
- }
- // default, return null to signal "not handled"
- // in which case, other factories should be tried
- return result;
- }
-
-
- protected IPreferenceStore getColorPreferences() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void loadColors() {
- addTextAttribute(IStyleConstantsXML.TAG_NAME);
- addTextAttribute(IStyleConstantsXML.TAG_BORDER);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS);
- addTextAttribute(IStyleConstantsXML.COMMENT_BORDER);
- addTextAttribute(IStyleConstantsXML.COMMENT_TEXT);
- addTextAttribute(IStyleConstantsXML.CDATA_BORDER);
- addTextAttribute(IStyleConstantsXML.CDATA_TEXT);
- addTextAttribute(IStyleConstantsXML.DECL_BORDER);
- addTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID);
- addTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF);
- addTextAttribute(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF);
- addTextAttribute(IStyleConstantsXML.DOCTYPE_NAME);
- addTextAttribute(IStyleConstantsXML.PI_CONTENT);
- addTextAttribute(IStyleConstantsXML.PI_BORDER);
- addTextAttribute(IStyleConstantsXML.XML_CONTENT);
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsXML.TAG_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_NAME;
- }
- else if (IStyleConstantsXML.TAG_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_BORDER;
- }
- else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
- }
- else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
- }
- else if (IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS;
- }
- else if (IStyleConstantsXML.COMMENT_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXML.COMMENT_BORDER;
- }
- else if (IStyleConstantsXML.COMMENT_TEXT.equals(prefKey)) {
- styleKey = IStyleConstantsXML.COMMENT_TEXT;
- }
- else if (IStyleConstantsXML.CDATA_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXML.CDATA_BORDER;
- }
- else if (IStyleConstantsXML.CDATA_TEXT.equals(prefKey)) {
- styleKey = IStyleConstantsXML.CDATA_TEXT;
- }
- else if (IStyleConstantsXML.DECL_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXML.DECL_BORDER;
- }
- else if (IStyleConstantsXML.DOCTYPE_EXTERNAL_ID.equals(prefKey)) {
- styleKey = IStyleConstantsXML.DOCTYPE_EXTERNAL_ID;
- }
- else if (IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF.equals(prefKey)) {
- styleKey = IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF;
- }
- else if (IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF.equals(prefKey)) {
- styleKey = IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF;
- }
- else if (IStyleConstantsXML.DOCTYPE_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXML.DOCTYPE_NAME;
- }
- else if (IStyleConstantsXML.PI_CONTENT.equals(prefKey)) {
- styleKey = IStyleConstantsXML.PI_CONTENT;
- }
- else if (IStyleConstantsXML.PI_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsXML.PI_BORDER;
- }
- else if (IStyleConstantsXML.XML_CONTENT.equals(prefKey)) {
- styleKey = IStyleConstantsXML.XML_CONTENT;
- }
- else if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
- }
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- super.handlePropertyChange(event);
- }
- }
-
- /**
- * 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;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java
deleted file mode 100644
index eabb960039..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/DoubleQuotedStringRule.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Frits Jalvingh and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Frits Jalvingh - initial version (bugfix for 150794)
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style.java;
-
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-
-/**
- * This rule matches the double-quoted strings present in JSP tag attributes. A double-quoted
- * strings starts with \" (two characters!) and ends with \" (two characters!) too. The sequence
- * \" is escaped by the horror \\\" (4 chars!?) as per the JSP spec.
- *
- * @author <a href="mailto:jal@etc.to">Frits Jalvingh</a>
- * Created on Aug 5, 2007
- */
-public class DoubleQuotedStringRule implements IPredicateRule {
- private IToken fToken;
- private int m_qc;
-
- public DoubleQuotedStringRule(IToken tok) {
- fToken = tok;
- }
- public IToken evaluate(ICharacterScanner scanner, boolean resume) {
- if(resume) {
- if(findEnd(scanner, m_qc))
- return fToken;
- } else {
- int c= scanner.read();
- if(c == '\\') {
- c = scanner.read();
- if(c == '"' || c == '\'') {
- if(findEnd(scanner, c))
- return fToken;
- }
- scanner.unread();
- }
- scanner.unread();
- }
- return Token.UNDEFINED;
- }
-
- private boolean findEnd(ICharacterScanner scanner, int qc) {
- m_qc = qc;
- int count = 0;
- int c;
- int nsl = 0;
- while((c= scanner.read()) != ICharacterScanner.EOF) {
- count++;
- if(c == '\\') {
- nsl++;
- if(nsl >= 4)
- nsl = 0;
- } else if(c == qc) {
- if(nsl == 1)
- return true;
- nsl = 0;
- } else
- nsl= 0;
- }
- while(--count >= 0)
- scanner.unread();
- return false;
- }
-
- public IToken getSuccessToken() {
- return fToken;
- }
-
- public IToken evaluate(ICharacterScanner scanner) {
- return evaluate(scanner, false);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java
deleted file mode 100644
index 9725028f04..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/IStyleConstantsJSPJava.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.jst.jsp.ui.internal.style.java;
-
-public interface IStyleConstantsJSPJava {
- String JAVA_KEYWORD = "keyword"; //$NON-NLS-1$
- String JAVA_SINGLE_LINE_COMMENT = "single_line_comment"; //$NON-NLS-1$
- String JAVA_STRING = "string"; //$NON-NLS-1$
- String JAVA_DEFAULT = "default"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
deleted file mode 100644
index 9d6c26eb60..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaCodeScanner.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Frits Jalvingh - contributions for bug 150794
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style.java;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.rules.EndOfLineRule;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.SingleLineRule;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WordRule;
-
-/**
- * A Java code scanner.
- */
-class JavaCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
- private IToken fKeywordToken;
- private IToken fTypeToken;
- private IToken fStringToken;
- private IToken fSingleLineCommentToken;
- private IToken fDefaultToken;
-
- private static String[] fgKeywords = {"abstract", //$NON-NLS-1$
- "break", //$NON-NLS-1$
- "case", "catch", "class", "continue", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- "default", "do", //$NON-NLS-2$//$NON-NLS-1$
- "else", "extends", //$NON-NLS-2$//$NON-NLS-1$
- "final", "finally", "for", //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- "if", "implements", "import", "instanceof", "interface", //$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- "native", "new", //$NON-NLS-2$//$NON-NLS-1$
- "package", "private", "protected", "public", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- "return", //$NON-NLS-1$
- "static", "super", "switch", "synchronized", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- "this", "throw", "throws", "transient", "try", //$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- "volatile", //$NON-NLS-1$
- "while", //$NON-NLS-1$
- "strictfp",//$NON-NLS-1$
- };
- private static String[] fgTypes = {"void", "boolean", "char", "byte", "short", "int", "long", "float", "double"};//$NON-NLS-9$//$NON-NLS-8$//$NON-NLS-7$//$NON-NLS-6$//$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- private static String[] fgConstants = {"false", "null", "true"};//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
-
- /**
- * Creates a Java code scanner
- */
- public JavaCodeScanner() {
- super();
- }
-
- public void initializeRules() {
- List rules = new ArrayList();
-
- // Add rule for multiple line comments.
- rules.add(new MultiLineRule("/*", "*/", fSingleLineCommentToken));//$NON-NLS-1$ //$NON-NLS-2$
-
- // Add rule for single line comments.
- rules.add(new EndOfLineRule("//", fSingleLineCommentToken));//$NON-NLS-1$
-
- // Add rule for strings and character constants.
- rules.add(new SingleLineRule("\"", "\"", fStringToken, '\\'));//$NON-NLS-2$//$NON-NLS-1$
- rules.add(new SingleLineRule("'", "'", fStringToken, '\\'));//$NON-NLS-2$//$NON-NLS-1$
-
- // Add generic whitespace rule.
- //rules.add(new WhitespaceRule(new JavaWhitespaceDetector()));
-
- // Add word rule for keywords, types, and constants.
- WordRule wordRule = new WordRule(new JavaWordDetector(), fDefaultToken);
- for (int i = 0; i < fgKeywords.length; i++)
- wordRule.addWord(fgKeywords[i], fKeywordToken);
- for (int i = 0; i < fgTypes.length; i++)
- wordRule.addWord(fgTypes[i], fTypeToken);
- for (int i = 0; i < fgConstants.length; i++)
- wordRule.addWord(fgConstants[i], fTypeToken);
- rules.add(wordRule);
-
- // Add the double-quoted string rule
- rules.add(new DoubleQuotedStringRule(fStringToken));
-
- IRule[] result = new IRule[rules.size()];
- rules.toArray(result);
- setRules(result);
- }
-
- public void setTokenData(String tokenKey, Object data) {
- if (tokenKey == IStyleConstantsJSPJava.JAVA_KEYWORD) {
- fKeywordToken = new Token(data);
- fTypeToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSPJava.JAVA_STRING) {
- fStringToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT) {
- fSingleLineCommentToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSPJava.JAVA_DEFAULT) {
- fDefaultToken = new Token(data);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java
deleted file mode 100644
index d943561425..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaColorProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style.java;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Colors used in the Java editor
- */
-public class JavaColorProvider {
-
- // people should not be setting these, even though they are currently not final
- public static RGB MULTI_LINE_COMMENT = new RGB(128, 0, 0);
- public static RGB SINGLE_LINE_COMMENT = new RGB(128, 128, 0);
- public static RGB KEYWORD = new RGB(0, 0, 128);
- public static RGB TYPE = new RGB(0, 0, 128);
- public static RGB STRING = new RGB(0, 128, 0);
- public static RGB DEFAULT = new RGB(0, 0, 0);
- public static RGB JAVADOC_KEYWORD = new RGB(0, 128, 0);
- public static RGB JAVADOC_TAG = new RGB(128, 128, 128);
- public static RGB JAVADOC_LINK = new RGB(128, 128, 128);
- public static RGB JAVADOC_DEFAULT = new RGB(0, 128, 128);
-
- public static int MULTI_LINE_COMMENT_BOLD = SWT.NORMAL;
- public static int SINGLE_LINE_COMMENT_BOLD = SWT.NORMAL;
- public static int KEYWORD_BOLD = SWT.BOLD;
- public static int TYPE_BOLD = SWT.BOLD;
- public static int STRING_BOLD = SWT.NORMAL;
- public static int DEFAULT_BOLD = SWT.NORMAL;
- public static int JAVADOC_KEYWORD_BOLD = SWT.BOLD;
- public static int JAVADOC_TAG_BOLD = SWT.NORMAL;
- public static int JAVADOC_LINK_BOLD = SWT.NORMAL;
- public static int JAVADOC_DEFAULT_BOLD = SWT.NORMAL;
-
- private static JavaColorProvider fInstance = null;
-
- public static JavaColorProvider getInstance() {
- if (fInstance == null) {
- fInstance = new JavaColorProvider();
- }
- return fInstance;
- }
-
- /**
- * Use colors from JDT plugin
- */
- public void loadJavaColors() {
- IPreferenceStore jdtStore = PreferenceConstants.getPreferenceStore();
- MULTI_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR);
- SINGLE_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
- KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
- TYPE = KEYWORD;
- STRING = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_STRING_COLOR);
- DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
- JAVADOC_KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR);
- JAVADOC_TAG = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR);
- JAVADOC_LINK = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR);
- JAVADOC_DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR);
-
- MULTI_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- SINGLE_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- KEYWORD_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
- TYPE_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
- STRING_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD) ? SWT.BOLD : SWT.NORMAL;
- DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- JAVADOC_TAG_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD) ? SWT.BOLD : SWT.NORMAL;
- JAVADOC_LINK_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD) ? SWT.BOLD : SWT.NORMAL;
- JAVADOC_DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.java
deleted file mode 100644
index 381893e74d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWhitespaceDetector.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.ui.internal.style.java;
-
-
-
-/**
- * A java aware white space detector.
- */
-public class JavaWhitespaceDetector implements org.eclipse.jface.text.rules.IWhitespaceDetector {
-
- /**
- * @see org.eclipse.jface.text.rules.IWhitespaceDetector#isWhitespace
- */
- public boolean isWhitespace(char c) {
- return Character.isWhitespace(c);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.java
deleted file mode 100644
index 77fe762368..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/JavaWordDetector.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.jst.jsp.ui.internal.style.java;
-
-
-/**
- * A Java aware word detector.
- */
-public class JavaWordDetector implements org.eclipse.jface.text.rules.IWordDetector {
-
- /**
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierPart
- */
- public boolean isWordPart(char c) {
- return Character.isJavaIdentifierPart(c);
- }
-
- /**
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierStart
- */
- public boolean isWordStart(char c) {
- return Character.isJavaIdentifierStart(c);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
deleted file mode 100644
index a41e055d7b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Frits Jalvingh - contributions for bug 150794
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.style.java;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-// Note: many of the methods in this class were based on (or copied from) those
-// found in the example Java Editor
-public class LineStyleProviderForJava implements LineStyleProvider{
- private class PropertyChangeListener implements IPropertyChangeListener {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- // have to do it this way so others can override the method
- handlePropertyChange(event);
- }
- }
-
- private IDocument fDocument;
- private Highlighter fHighlighter;
- private boolean fIsInitialized = false;
- private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
- /** The scanner it uses */
- private JavaCodeScanner fScanner;
- /** Contains all text attributes pretaining to this line style provider */
- private HashMap fTextAttributes = null;
-
- public LineStyleProviderForJava() {
- super();
- fScanner = new JavaCodeScanner();
- loadColors(); // Make sure we have rules before we start parsing
- }
-
- /**
- * Adds style information to the given text presentation.
- *
- * @param presentation the text presentation to be extended
- * @param offset the offset of the range to be styled
- * @param length the length of the range to be styled
- * @param attr the attribute describing the style of the range to be styled
- */
- private void addRange(Collection presentation, int offset, int length, TextAttribute attr) {
- // support for user defined backgroud for JSP scriptlet regions
- String styleString = JSPUIPlugin.getDefault().getPreferenceStore().getString(IStyleConstantsJSP.JSP_CONTENT);
- String[] prefs = ColorHelper.unpackStylePreferences(styleString);
- Color bgColor = (prefs != null && prefs.length == 3 && prefs[1].startsWith("#") && Display.getCurrent() != null) //$NON-NLS-1$
- ? new Color(Display.getCurrent(), ColorHelper.toRGB(prefs[1]))
- : attr.getBackground();
-
- presentation.add(new StyleRange(offset, length, attr.getForeground(), bgColor, attr.getStyle()));
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- private void addTextAttribute(String colorKey) {
- if (getColorPreferences() != null) {
- String prefString = getColorPreferences().getString(colorKey);
- 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();
- getTextAttributes().put(colorKey, createTextAttribute(foreground, background, bold));
- }
- }
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- private void addJavaTextAttribute(String colorKey) {
- IPreferenceStore store = getJavaColorPreferences();
- if (store != null && colorKey != null) {
- TextAttribute ta = null;
- if (colorKey == IStyleConstantsJSPJava.JAVA_KEYWORD) {
- // keyword
- RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
- boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD);
- boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC);
- ta = createTextAttribute(foreground, null, bold, italics);
- } else if (colorKey == IStyleConstantsJSPJava.JAVA_STRING) {
- // string
- RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_STRING_COLOR);
- boolean bold = store.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD);
- boolean italics = store.getBoolean(PreferenceConstants.EDITOR_STRING_ITALIC);
- ta = createTextAttribute(foreground, null, bold, italics);
- } else if (colorKey == IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT) {
- // single line comment
- RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
- boolean bold = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD);
- boolean italics = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC);
- ta = createTextAttribute(foreground, null, bold, italics);
- } else if (colorKey == IStyleConstantsJSPJava.JAVA_DEFAULT) {
- // default
- RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
- boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD);
- boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC);
- ta = createTextAttribute(foreground, null, bold, italics);
- }
- if (ta != null) {
- getTextAttributes().put(colorKey, ta);
- fScanner.setTokenData(colorKey, ta);
- }
- }
- }
-
- private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
- }
-
- private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold, boolean italics) {
- int style = bold ? SWT.BOLD : SWT.NORMAL;
- if (italics)
- style |= SWT.ITALIC;
-
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
- /**
- * Returns the hashtable containing all the text attributes for this line
- * style provider. Lazily creates a hashtable if one has not already been
- * created.
- *
- * @return
- */
- private HashMap getTextAttributes() {
- if (fTextAttributes == null) {
- fTextAttributes = new HashMap();
- loadColors();
- }
- return fTextAttributes;
- }
-
- /**
- * Returns a text attribute encoded in the given token. If the token's
- * data is not <code>null</code> and a text attribute it is assumed that
- * it is the encoded text attribute. It returns the default text attribute
- * if there is no encoded text attribute found.
- *
- * @param token the token whose text attribute is to be determined
- * @return the token's text attribute
- */
- private TextAttribute getTokenTextAttribute(IToken token) {
- TextAttribute ta = null;
-
- Object data = token.getData();
- if (data instanceof TextAttribute)
- ta = (TextAttribute)data;
- else {
- ta = (TextAttribute)getTextAttributes().get(IStyleConstantsJSPJava.JAVA_DEFAULT);
- }
- return ta;
- }
-
- public void init(IStructuredDocument document, Highlighter highlighter) {
- fDocument = document;
- fHighlighter = highlighter;
-
- if (fIsInitialized)
- return;
-
- registerPreferenceListener();
-
- fIsInitialized = true;
- }
-
- private void loadColors() {
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-
- addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_KEYWORD);
- addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_STRING);
- addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT);
- addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_DEFAULT);
-
- fScanner.initializeRules();
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
- String javaStyleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
- }
- else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
- }
- else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
- } else if (PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC.equals(prefKey))) {
- javaStyleKey = IStyleConstantsJSPJava.JAVA_KEYWORD;
- } else if (PreferenceConstants.EDITOR_STRING_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_STRING_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_STRING_ITALIC.equals(prefKey))) {
- javaStyleKey = IStyleConstantsJSPJava.JAVA_STRING;
- } else if (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_ITALIC.equals(prefKey))) {
- javaStyleKey = IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT;
- } else if (PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD.equals(prefKey))|| (PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC.equals(prefKey))) {
- javaStyleKey = IStyleConstantsJSPJava.JAVA_DEFAULT;
- }
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- }
- if (javaStyleKey != null) {
- // overwrite style preference with new value
- addJavaTextAttribute(javaStyleKey);
- fScanner.initializeRules();
- }
- if (styleKey != null || javaStyleKey != null) {
- // force a full update of the text viewer
- fHighlighter.refreshDisplay();
- }
- }
-
- public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
- boolean result = true;
- try {
- // ideally, eventually, we'll have a "virtualDocument" we can
- // refer to, but for now ... we'll simple rescan the one region.
- // use simple adjustment (since "sub-content" starts at 0
- int offsetAdjustment = typedRegion.getOffset();
- String content = fDocument.get(typedRegion.getOffset(), typedRegion.getLength());
- IDocument document = new Document(content);
-
- int lastStart = 0;
- int length = 0;
- IToken lastToken = Token.UNDEFINED;
-
- int remainingLength = typedRegion.getLength();
- fScanner.setRange(document, lastStart, remainingLength);
-
- while (true) {
-
- IToken token = fScanner.nextToken();
-
- if (token.isEOF()) {
- if (!lastToken.isUndefined() && length != 0)
- addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
- break;
- }
-
- if (token.isWhitespace()) {
- length += fScanner.getTokenLength();
- continue;
- }
-
- if (lastToken.isUndefined()) {
- lastToken = token;
- length += fScanner.getTokenLength();
- continue;
- }
-
- if (token != lastToken) {
- addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
- lastToken = token;
- lastStart = fScanner.getTokenOffset();
- length = fScanner.getTokenLength();
- continue;
- }
-
- length += fScanner.getTokenLength();
- }
- }
- catch (BadLocationException e) {
- // shouldn't happen, but we don't want it to stop other highlighting, if it does.
- result = false;
- }
- return result;
- }
-
- private void registerPreferenceListener() {
- getColorPreferences().addPropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
- }
-
- public void release() {
- unregisterPreferenceManager();
- if (fTextAttributes != null) {
- fTextAttributes.clear();
- fTextAttributes = null;
- }
- }
-
- private void unregisterPreferenceManager() {
- getColorPreferences().removePropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
- }
-
- private IPreferenceStore getColorPreferences() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- private IPreferenceStore getJavaColorPreferences() {
- return PreferenceConstants.getPreferenceStore();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java
deleted file mode 100644
index 5198842524..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/IStyleConstantsJSPEL.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *******************************************************************************/
-
-package org.eclipse.jst.jsp.ui.internal.style.jspel;
-
-public interface IStyleConstantsJSPEL {
- String EL_KEYWORD = "keyword"; //$NON-NLS-1$
- String EL_DEFAULT = "default"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.java
deleted file mode 100644
index e7f7cc9f9a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELCodeScanner.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.ui.internal.style.jspel;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WhitespaceRule;
-import org.eclipse.jface.text.rules.WordRule;
-
-/**
- * A Java code scanner.
- */
-public class JSPELCodeScanner extends org.eclipse.jface.text.rules.RuleBasedScanner {
- private IToken fKeywordToken;
- private IToken fTypeToken;
- private IToken fDefaultToken;
-
- private static String[] fgKeywords = {
- "and", //$NON-NLS-1$
- "did", //$NON-NLS-1$
- "div", //$NON-NLS-1$
- "empty", //$NON-NLS-1$
- "eq", //$NON-NLS-1$
- "ge", //$NON-NLS-1$
- "gt", //$NON-NLS-1$
- "or", //$NON-NLS-1$
- "le", //$NON-NLS-1$
- "lt", //$NON-NLS-1$
- "mod", //$NON-NLS-1$
- "ne", //$NON-NLS-1$
- "not" //$NON-NLS-1$
- };
- private static String[] fgConstants = {"false", "true"};//$NON-NLS-2$//$NON-NLS-1$
-
- /**
- * Creates a Java code scanner
- */
- public JSPELCodeScanner() {
- super();
- }
-
- public void initializeRules() {
- List rules = new ArrayList();
-
- // Add generic whitespace rule.
- rules.add(new WhitespaceRule(new JSPELWhitespaceDetector()));
-
- // Add word rule for keywords, types, and constants.
- WordRule wordRule = new WordRule(new JSPELWordDetector(), fDefaultToken);
- for (int i = 0; i < fgKeywords.length; i++)
- wordRule.addWord(fgKeywords[i], fKeywordToken);
- for (int i = 0; i < fgConstants.length; i++)
- wordRule.addWord(fgConstants[i], fTypeToken);
- rules.add(wordRule);
-
- IRule[] result = new IRule[rules.size()];
- rules.toArray(result);
- setRules(result);
- }
-
- public void setTokenData(String tokenKey, Object data) {
- if (tokenKey == IStyleConstantsJSPEL.EL_KEYWORD) {
- fKeywordToken = new Token(data);
- fTypeToken = new Token(data);
- } else if (tokenKey == IStyleConstantsJSPEL.EL_DEFAULT) {
- fDefaultToken = new Token(data);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.java
deleted file mode 100644
index 716071ffea..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELColorProvider.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.jst.jsp.ui.internal.style.jspel;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Colors used in the Java editor
- */
-public class JSPELColorProvider {
-
- // people should not be setting these, even though they are currently not final
- public static RGB MULTI_LINE_COMMENT = new RGB(128, 0, 0);
- public static RGB SINGLE_LINE_COMMENT = new RGB(128, 128, 0);
- public static RGB KEYWORD = new RGB(0, 0, 128);
- public static RGB TYPE = new RGB(0, 0, 128);
- public static RGB STRING = new RGB(0, 128, 0);
- public static RGB DEFAULT = new RGB(0, 0, 0);
- public static RGB JAVADOC_KEYWORD = new RGB(0, 128, 0);
- public static RGB JAVADOC_TAG = new RGB(128, 128, 128);
- public static RGB JAVADOC_LINK = new RGB(128, 128, 128);
- public static RGB JAVADOC_DEFAULT = new RGB(0, 128, 128);
-
- public static int MULTI_LINE_COMMENT_BOLD = SWT.NORMAL;
- public static int SINGLE_LINE_COMMENT_BOLD = SWT.NORMAL;
- public static int KEYWORD_BOLD = SWT.BOLD;
- public static int TYPE_BOLD = SWT.BOLD;
- public static int STRING_BOLD = SWT.NORMAL;
- public static int DEFAULT_BOLD = SWT.NORMAL;
- public static int JAVADOC_KEYWORD_BOLD = SWT.BOLD;
- public static int JAVADOC_TAG_BOLD = SWT.NORMAL;
- public static int JAVADOC_LINK_BOLD = SWT.NORMAL;
- public static int JAVADOC_DEFAULT_BOLD = SWT.NORMAL;
-
- /**
- * @deprecated all editors use same
- */
- public static RGB EDITOR_BACKGROUND = new RGB(255, 255, 255);
- /**
- * @deprecated all editors use same
- */
- public static boolean EDITOR_CURRENT_LINE = true;
- /**
- * @deprecated all editors use same
- */
- public static RGB EDITOR_CURRENT_LINE_COLOR = new RGB(128, 128, 128);
-
- private static JSPELColorProvider fInstance = null;
-
- public static JSPELColorProvider getInstance() {
- if (fInstance == null) {
- fInstance = new JSPELColorProvider();
- }
- return fInstance;
- }
-
- /**
- * Use colors from JDT plugin
- */
- public void loadJavaColors() {
-
- IPreferenceStore jdtStore = PreferenceConstants.getPreferenceStore();
- MULTI_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_COLOR);
- SINGLE_LINE_COMMENT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR);
- KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
- TYPE = KEYWORD;
- STRING = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_STRING_COLOR);
- DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
- JAVADOC_KEYWORD = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR);
- JAVADOC_TAG = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR);
- JAVADOC_LINK = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR);
- JAVADOC_DEFAULT = PreferenceConverter.getColor(jdtStore, PreferenceConstants.EDITOR_JAVADOC_DEFAULT_COLOR);
-
- MULTI_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- SINGLE_LINE_COMMENT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- KEYWORD_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
- TYPE_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD) ? SWT.BOLD : SWT.NORMAL;
- STRING_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_STRING_BOLD) ? SWT.BOLD : SWT.NORMAL;
- DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
- JAVADOC_TAG_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD) ? SWT.BOLD : SWT.NORMAL;
- JAVADOC_LINK_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD) ? SWT.BOLD : SWT.NORMAL;
- JAVADOC_DEFAULT_BOLD = jdtStore.getBoolean(PreferenceConstants.EDITOR_JAVADOC_DEFAULT_BOLD) ? SWT.BOLD : SWT.NORMAL;
-
-// EDITOR_BACKGROUND = new RGB(255, 255, 255);
-
-// IPreferenceStore sseStore = SSEUIPlugin.getDefault().getPreferenceStore();
-// EDITOR_CURRENT_LINE = sseStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE);
-// EDITOR_CURRENT_LINE_COLOR = PreferenceConverter.getColor(sseStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.java
deleted file mode 100644
index 5c2345d7e9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWhitespaceDetector.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.ui.internal.style.jspel;
-
-
-
-/**
- * A java aware white space detector.
- */
-public class JSPELWhitespaceDetector implements org.eclipse.jface.text.rules.IWhitespaceDetector {
-
- /**
- * @see org.eclipse.jface.text.rules.IWhitespaceDetector#isWhitespace
- */
- public boolean isWhitespace(char c) {
- return Character.isWhitespace(c);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.java
deleted file mode 100644
index 4676e239bf..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/JSPELWordDetector.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.jst.jsp.ui.internal.style.jspel;
-
-
-/**
- * A Java aware word detector.
- */
-public class JSPELWordDetector implements org.eclipse.jface.text.rules.IWordDetector {
-
- /**
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierPart
- */
- public boolean isWordPart(char c) {
- return Character.isJavaIdentifierPart(c);
- }
-
- /**
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordIdentifierStart
- */
- public boolean isWordStart(char c) {
- return Character.isJavaIdentifierStart(c);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
deleted file mode 100644
index 8f000a0069..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.style.jspel;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.style.IStyleConstantsJSP;
-import org.eclipse.jst.jsp.ui.internal.style.java.IStyleConstantsJSPJava;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.provisional.style.Highlighter;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-// Note: many of the methods in this class were based on (or copied from)
-// those
-// found in the example Java Editor
-public class LineStyleProviderForJSPEL implements LineStyleProvider {
- private class PropertyChangeListener implements IPropertyChangeListener {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- // have to do it this way so others can override the method
- handlePropertyChange(event);
- }
- }
-
- private IDocument fDocument;
- private Highlighter fHighlighter;
- private boolean fIsInitialized = false;
- private PropertyChangeListener fPreferenceListener = new PropertyChangeListener();
- /** The scanner it uses */
- private JSPELCodeScanner fScanner;
- /** Contains all text attributes pretaining to this line style provider */
- private HashMap fTextAttributes = null;
-
- public LineStyleProviderForJSPEL() {
- super();
- fScanner = new JSPELCodeScanner();
- }
-
- /**
- * Adds style information to the given text presentation.
- *
- * @param presentation
- * the text presentation to be extended
- * @param offset
- * the offset of the range to be styled
- * @param length
- * the length of the range to be styled
- * @param attr
- * the attribute describing the style of the range to be styled
- */
- private void addRange(Collection presentation, int offset, int length, TextAttribute attr) {
- // support for user defined backgroud for JSP scriptlet regions
- String styleString = JSPUIPlugin.getDefault().getPreferenceStore().getString(IStyleConstantsJSP.JSP_CONTENT);
- String[] prefs = ColorHelper.unpackStylePreferences(styleString);
- Color bgColor = (prefs != null && prefs.length == 3 && prefs[1].startsWith("#") && Display.getCurrent() != null) //$NON-NLS-1$
- ? new Color(Display.getCurrent(), ColorHelper.toRGB(prefs[1])) : attr.getBackground();
-
- presentation.add(new StyleRange(offset, length, attr.getForeground(), bgColor, attr.getStyle()));
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- private void addTextAttribute(String colorKey) {
- if (getColorPreferences() != null) {
- String prefString = getColorPreferences().getString(colorKey);
- 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();
- getTextAttributes().put(colorKey, createTextAttribute(foreground, background, bold));
- }
- }
- }
-
- /**
- * Looks up the colorKey in the preference store and adds the style
- * information to list of TextAttributes
- *
- * @param colorKey
- */
- private void addJavaTextAttribute(String colorKey) {
- IPreferenceStore store = getJavaColorPreferences();
- if (store != null && colorKey != null) {
- TextAttribute ta = null;
- if (colorKey == IStyleConstantsJSPEL.EL_KEYWORD) {
- // keyword
- RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR);
- boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD);
- boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC);
- ta = createTextAttribute(foreground, null, bold, italics);
- } else if (colorKey == IStyleConstantsJSPEL.EL_DEFAULT) {
- // default
- RGB foreground = PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR);
- boolean bold = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD);
- boolean italics = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC);
- ta = createTextAttribute(foreground, null, bold, italics);
- }
- if (ta != null) {
- getTextAttributes().put(colorKey, ta);
- fScanner.setTokenData(colorKey, ta);
- }
- }
- }
-
- private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold) {
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, bold ? SWT.BOLD : SWT.NORMAL);
- }
-
- private TextAttribute createTextAttribute(RGB foreground, RGB background, boolean bold, boolean italics) {
- int style = bold ? SWT.BOLD : SWT.NORMAL;
- if (italics)
- style |= SWT.ITALIC;
-
- return new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, style);
- }
-
- /**
- * Returns the hashtable containing all the text attributes for this line
- * style provider. Lazily creates a hashtable if one has not already been
- * created.
- *
- * @return
- */
- private HashMap getTextAttributes() {
- if (fTextAttributes == null) {
- fTextAttributes = new HashMap();
- loadColors();
- }
- return fTextAttributes;
- }
-
- /**
- * Returns a text attribute encoded in the given token. If the token's
- * data is not <code>null</code> and a text attribute it is assumed that
- * it is the encoded text attribute. It returns the default text attribute
- * if there is no encoded text attribute found.
- *
- * @param token
- * the token whose text attribute is to be determined
- * @return the token's text attribute
- */
- private TextAttribute getTokenTextAttribute(IToken token) {
- TextAttribute ta = null;
-
- Object data = token.getData();
- if (data instanceof TextAttribute)
- ta = (TextAttribute) data;
- else {
- ta = (TextAttribute) getTextAttributes().get(IStyleConstantsJSPJava.JAVA_DEFAULT);
- }
- return ta;
- }
-
- public void init(IStructuredDocument document, Highlighter highlighter) {
- fDocument = document;
- fHighlighter = highlighter;
-
- if (fIsInitialized)
- return;
-
- registerPreferenceListener();
-
- fIsInitialized = true;
- }
-
- private void loadColors() {
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
-
- addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_KEYWORD);
- addJavaTextAttribute(IStyleConstantsJSPJava.JAVA_DEFAULT);
-
- fScanner.initializeRules();
- }
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- String styleKey = null;
- String javaStyleKey = null;
-
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
- styleKey = IStyleConstantsHTML.SCRIPT_AREA_BORDER;
- } else if (IStyleConstantsXML.TAG_ATTRIBUTE_NAME.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_NAME;
- } else if (IStyleConstantsXML.TAG_ATTRIBUTE_VALUE.equals(prefKey)) {
- styleKey = IStyleConstantsXML.TAG_ATTRIBUTE_VALUE;
- } else if (PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_KEYWORD_ITALIC.equals(prefKey))) {
- javaStyleKey = IStyleConstantsJSPEL.EL_KEYWORD;
- } else if (PreferenceConstants.EDITOR_JAVA_DEFAULT_COLOR.equals(prefKey) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD.equals(prefKey)) || (PreferenceConstants.EDITOR_JAVA_DEFAULT_ITALIC.equals(prefKey))) {
- javaStyleKey = IStyleConstantsJSPEL.EL_DEFAULT;
- }
- }
-
- if (styleKey != null) {
- // overwrite style preference with new value
- addTextAttribute(styleKey);
- }
- if (javaStyleKey != null) {
- // overwrite style preference with new value
- addJavaTextAttribute(javaStyleKey);
- fScanner.initializeRules();
- }
- if (styleKey != null || javaStyleKey != null) {
- // force a full update of the text viewer
- fHighlighter.refreshDisplay();
- }
- }
-
- public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
- boolean result = true;
- try {
- // ideally, eventually, we'll have a "virtualDocument" we can
- // refer to, but for now ... we'll simple rescan the one region.
- // use simple adjustment (since "sub-content" starts at 0
- int offsetAdjustment = typedRegion.getOffset();
- String content = fDocument.get(typedRegion.getOffset(), typedRegion.getLength());
- IDocument document = new Document(content);
-
- int lastStart = 0;
- int length = 0;
- IToken lastToken = Token.UNDEFINED;
-
- int remainingLength = typedRegion.getLength();
- fScanner.setRange(document, lastStart, remainingLength);
-
- while (true) {
-
- IToken token = fScanner.nextToken();
-
- if (token.isEOF()) {
- if (!lastToken.isUndefined() && length != 0)
- addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
- break;
- }
-
- if (token.isWhitespace()) {
- length += fScanner.getTokenLength();
- continue;
- }
-
- if (lastToken.isUndefined()) {
- lastToken = token;
- length += fScanner.getTokenLength();
- continue;
- }
-
- if (token != lastToken) {
- addRange(holdResults, lastStart + offsetAdjustment, length, getTokenTextAttribute(lastToken));
- lastToken = token;
- lastStart = fScanner.getTokenOffset();
- length = fScanner.getTokenLength();
- continue;
- }
-
- length += fScanner.getTokenLength();
- }
- } catch (BadLocationException e) {
- // shouldn't happen, but we don't want it to stop other
- // highlighting, if it does.
- result = false;
- }
- return result;
- }
-
- private void registerPreferenceListener() {
- getColorPreferences().addPropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
- }
-
- public void release() {
- unRegisterPreferenceManager();
- if (fTextAttributes != null) {
- fTextAttributes.clear();
- fTextAttributes = null;
- }
- }
-
- private void unRegisterPreferenceManager() {
- getColorPreferences().removePropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
- }
-
- private IPreferenceStore getColorPreferences() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- private IPreferenceStore getJavaColorPreferences() {
- return PreferenceConstants.getPreferenceStore();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.java
deleted file mode 100644
index 25dfb4417e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/HTMLPrinter.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.ui.internal.taginfo;
-
-
-import java.io.IOException;
-import java.io.Reader;
-import java.net.URL;
-
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- * Provides a set of convenience methods for creating HTML pages.
- *
- * Based on org.eclipse.jdt.internal.ui.text.HTMLPrinter
- */
-class HTMLPrinter {
-
- static RGB BG_COLOR_RGB = null;
-
- static {
- final Display display = Display.getDefault();
- if (display != null && !display.isDisposed()) {
- try {
- display.asyncExec(new Runnable() {
- /*
- * @see java.lang.Runnable#run()
- */
- public void run() {
- BG_COLOR_RGB = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
- }
- });
- }
- catch (SWTError err) {
- // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=45294
- if (err.code != SWT.ERROR_DEVICE_DISPOSED)
- throw err;
- }
- }
- }
-
- private HTMLPrinter() {
- // nothing
- }
-
- private static String replace(String text, char c, String s) {
-
- int previous = 0;
- int current = text.indexOf(c, previous);
-
- if (current == -1)
- return text;
-
- StringBuffer buffer = new StringBuffer();
- while (current > -1) {
- buffer.append(text.substring(previous, current));
- buffer.append(s);
- previous = current + 1;
- current = text.indexOf(c, previous);
- }
- buffer.append(text.substring(previous));
-
- return buffer.toString();
- }
-
- public static String convertToHTMLContent(String content) {
- content = replace(content, '&', "&amp;"); //$NON-NLS-1$
- content = replace(content, '"', "&quot;"); //$NON-NLS-1$
- content = replace(content, '<', "&lt;"); //$NON-NLS-1$
- return replace(content, '>', "&gt;"); //$NON-NLS-1$
- }
-
- static String read(Reader rd) {
-
- StringBuffer buffer = new StringBuffer();
- char[] readBuffer = new char[2048];
-
- try {
- int n = rd.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n = rd.read(readBuffer);
- }
- return buffer.toString();
- }
- catch (IOException x) {
- // never expected
- Logger.log(Logger.WARNING_DEBUG, x.getMessage(), x);
- }
-
- return null;
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, URL styleSheetURL) {
-
- if (bgRGB == null)
- insertPageProlog(buffer, position, styleSheetURL);
- else {
- StringBuffer pageProlog = new StringBuffer(300);
-
- pageProlog.append("<html>"); //$NON-NLS-1$
-
- appendStyleSheetLink(pageProlog, styleSheetURL);
-
- pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
- appendColor(pageProlog, bgRGB);
- pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
-
- buffer.insert(position, pageProlog.toString());
- }
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB) {
- if (bgRGB == null)
- insertPageProlog(buffer, position);
- else {
- StringBuffer pageProlog = new StringBuffer(60);
- pageProlog.append("<html><body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
- appendColor(pageProlog, bgRGB);
- pageProlog.append("\"><font size=-1>"); //$NON-NLS-1$
- buffer.insert(position, pageProlog.toString());
- }
- }
-
- private static void appendStyleSheetLink(StringBuffer buffer, URL styleSheetURL) {
- if (styleSheetURL == null)
- return;
-
- buffer.append("<head>"); //$NON-NLS-1$
-
- buffer.append("<LINK REL=\"stylesheet\" HREF= \""); //$NON-NLS-1$
- buffer.append(styleSheetURL);
- buffer.append("\" CHARSET=\"ISO-8859-1\" TYPE=\"text/css\">"); //$NON-NLS-1$
-
- buffer.append("</head>"); //$NON-NLS-1$
- }
-
- private static void appendColor(StringBuffer buffer, RGB rgb) {
- buffer.append('#');
- buffer.append(Integer.toHexString(rgb.red));
- buffer.append(Integer.toHexString(rgb.green));
- buffer.append(Integer.toHexString(rgb.blue));
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position) {
- insertPageProlog(buffer, position, getBgColor());
- }
-
- public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
- insertPageProlog(buffer, position, getBgColor(), styleSheetURL);
- }
-
- private static RGB getBgColor() {
- if (BG_COLOR_RGB != null)
- return BG_COLOR_RGB;
- // RGB value of info bg color on WindowsXP
- return new RGB(255, 255, 225);
- }
-
- public static void addPageProlog(StringBuffer buffer) {
- insertPageProlog(buffer, buffer.length());
- }
-
- public static void addPageEpilog(StringBuffer buffer) {
- buffer.append("</font></body></html>"); //$NON-NLS-1$
- }
-
- public static void startBulletList(StringBuffer buffer) {
- buffer.append("<ul>"); //$NON-NLS-1$
- }
-
- public static void endBulletList(StringBuffer buffer) {
- buffer.append("</ul>"); //$NON-NLS-1$
- }
-
- public static void addBullet(StringBuffer buffer, String bullet) {
- if (bullet != null) {
- buffer.append("<li>"); //$NON-NLS-1$
- buffer.append(bullet);
- buffer.append("</li>"); //$NON-NLS-1$
- }
- }
-
- public static void addSmallHeader(StringBuffer buffer, String header) {
- if (header != null) {
- buffer.append("<h5>"); //$NON-NLS-1$
- buffer.append(header);
- buffer.append("</h5>"); //$NON-NLS-1$
- }
- }
-
- public static void addParagraph(StringBuffer buffer, String paragraph) {
- if (paragraph != null) {
- buffer.append("<p>"); //$NON-NLS-1$
- buffer.append(paragraph);
- }
- }
-
- public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
- if (paragraphReader != null)
- addParagraph(buffer, read(paragraphReader));
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
deleted file mode 100644
index b2f680b260..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides context help for JSP tags (Show tooltip description)
- */
-public class JSPInformationProvider implements IInformationProvider, IInformationProviderExtension {
- private ITextHover fTextHover = null;
-
- public JSPInformationProvider() {
- fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSPTagInfoHoverProcessor());
- }
-
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String) getInformation2(textViewer, subject);
- }
-
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
deleted file mode 100644
index 88c609327f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import java.io.Reader;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.ui.JavaElementLabels;
-import org.eclipse.jdt.ui.JavadocContentAccess;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslation;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.taginfo.AbstractHoverProcessor;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * Provides javadoc hover help documentation for java code inside JSPs
- */
-public class JSPJavaJavadocHoverProcessor extends AbstractHoverProcessor {
- /*
- * Bulk of the work was copied from
- * org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover
- */
- private final long LABEL_FLAGS = JavaElementLabels.ALL_FULLY_QUALIFIED | JavaElementLabels.M_PRE_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.M_PARAMETER_NAMES | JavaElementLabels.M_EXCEPTIONS | JavaElementLabels.F_PRE_TYPE_SIGNATURE | JavaElementLabels.M_PRE_TYPE_PARAMETERS | JavaElementLabels.T_TYPE_PARAMETERS | JavaElementLabels.USE_RESOLVED;
- private final long LOCAL_VARIABLE_FLAGS = LABEL_FLAGS & ~JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED;
-
- private String getHoverInfo(IJavaElement[] result) {
- StringBuffer buffer = new StringBuffer();
- int nResults = result.length;
- if (nResults == 0)
- return null;
-
- if (nResults > 1) {
-
- for (int i = 0; i < result.length; i++) {
- HTMLPrinter.startBulletList(buffer);
- IJavaElement curr = result[i];
- if (curr instanceof IMember || curr.getElementType() == IJavaElement.LOCAL_VARIABLE)
- HTMLPrinter.addBullet(buffer, getInfoText(curr));
- HTMLPrinter.endBulletList(buffer);
- }
-
- }
- else {
-
- IJavaElement curr = result[0];
- if (curr instanceof IMember) {
- IMember member = (IMember) curr;
- HTMLPrinter.addSmallHeader(buffer, getInfoText(member));
- Reader reader;
- try {
- reader = JavadocContentAccess.getHTMLContentReader(member, true, true);
- }
- catch (JavaModelException ex) {
- return null;
- }
- if (reader != null) {
- HTMLPrinter.addParagraph(buffer, reader);
- }
- }
- else if (curr.getElementType() == IJavaElement.LOCAL_VARIABLE || curr.getElementType() == IJavaElement.TYPE_PARAMETER)
- HTMLPrinter.addSmallHeader(buffer, getInfoText(curr));
- }
-
- if (buffer.length() > 0) {
- HTMLPrinter.insertPageProlog(buffer, 0);
- HTMLPrinter.addPageEpilog(buffer);
- return buffer.toString();
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
- * org.eclipse.jface.text.IRegion)
- */
- public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
- // get JSP translation object for this viewer's document
- IDOMModel xmlModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
- try {
- if (xmlModel != null) {
- IDOMDocument xmlDoc = xmlModel.getDocument();
- JSPTranslationAdapter adapter = (JSPTranslationAdapter) xmlDoc.getAdapterFor(IJSPTranslation.class);
- if (adapter != null) {
- JSPTranslation translation = adapter.getJSPTranslation();
-
- IJavaElement[] result = translation.getElementsFromJspRange(hoverRegion.getOffset(), hoverRegion.getOffset() + hoverRegion.getLength());
- return translation.fixupMangledName(getHoverInfo(result));
- }
- }
- }
- finally {
- if (xmlModel != null)
- xmlModel.releaseFromRead();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
- return JavaWordFinder.findWord(textViewer.getDocument(), offset);
- }
-
- private String getInfoText(IJavaElement member) {
- long flags = member.getElementType() == IJavaElement.LOCAL_VARIABLE ? LOCAL_VARIABLE_FLAGS : LABEL_FLAGS;
- String label = JavaElementLabels.getElementLabel(member, flags);
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < label.length(); i++) {
- char ch = label.charAt(i);
- if (ch == '<') {
- buf.append("&lt;"); //$NON-NLS-1$
- }
- else if (ch == '>') {
- buf.append("&gt;"); //$NON-NLS-1$
- }
- else {
- buf.append(ch);
- }
- }
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
deleted file mode 100644
index 190f5aaf91..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides javadoc context information for java code inside JSPs (Shows
- * tooltip description)
- */
-public class JSPJavaJavadocInformationProvider implements IInformationProvider, IInformationProviderExtension {
- private ITextHover fTextHover = null;
-
- public JSPJavaJavadocInformationProvider() {
- fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new JSPJavaJavadocHoverProcessor());
- }
-
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String) getInformation2(textViewer, subject);
- }
-
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.java
deleted file mode 100644
index 2a234ca745..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPTagInfoHoverProcessor.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.jst.jsp.ui.internal.taginfo;
-
-
-
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * Provides hover help documentation for JSP tags
- */
-public class JSPTagInfoHoverProcessor extends HTMLTagInfoHoverProcessor {
-
- protected String computeRegionHelp(IndexedRegion treeNode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
- String result = null;
-
- if (region == null)
- return null;
-
- String regionType = region.getType();
- if (regionType == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- result = computeJSPDirHelp((IDOMNode) treeNode, parentNode, flatNode, region);
- }
- else
- result = super.computeRegionHelp(treeNode, parentNode, flatNode, region);
-
- return result;
- }
-
- /**
- * Computes the hover help for the jsp directive name
- * for now, treat jsp directives like any other tag name
- */
- protected String computeJSPDirHelp(IDOMNode xmlnode, IDOMNode parentNode, IStructuredDocumentRegion flatNode, ITextRegion region) {
- return computeTagNameHelp(xmlnode, parentNode, flatNode, region);
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
deleted file mode 100644
index d3c5b67122..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JavaWordFinder.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.taginfo;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-
-/**
- * Copied from org.eclipse.jdt.internal.ui.text.JavaWordFinder
- */
-class JavaWordFinder {
-
- public static IRegion findWord(IDocument document, int offset) {
-
- int start= -1;
- int end= -1;
-
-
- try {
-
- int pos= offset;
- char c;
-
- while (pos >= 0) {
- c= document.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- --pos;
- }
-
- start= pos;
-
- pos= offset;
- int length= document.getLength();
-
- while (pos < length) {
- c= document.getChar(pos);
- if (!Character.isJavaIdentifierPart(c))
- break;
- ++pos;
- }
-
- end= pos;
-
- } catch (BadLocationException x) {
- }
-
- if (start > -1 && end > -1) {
- if (start == offset && end == offset)
- return new Region(offset, 0);
- else if (start == offset)
- return new Region(start, end - start);
- else
- return new Region(start + 1, end - start - 1);
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java
deleted file mode 100644
index 23b1058209..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/EncodingTemplateVariableResolverJSP.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-
-public class EncodingTemplateVariableResolverJSP extends SimpleTemplateVariableResolver {
- private static final String ENCODING_TYPE = getEncodingType();
-
- private static String getEncodingType() {
- return "encoding"; //$NON-NLS-1$
- }
-
- /**
- * Creates a new encoding variable
- */
- public EncodingTemplateVariableResolverJSP() {
- super(ENCODING_TYPE, JSPUIMessages.Creating_files_encoding);
- }
-
- protected String resolve(TemplateContext context) {
- return JSPCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java
deleted file mode 100644
index 8e5d9e3743..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsJSP {
-
- public static final String ALL = getAll();
-
- public static final String ATTRIBUTE = getAttribute();
-
- public static final String ATTRIBUTE_VALUE = getAttributeValue();
-
- public static final String NEW = getNew();
-
- public static final String TAG = getTag();
-
- private static String getAll() {
- return getPrefix() + "_all"; //$NON-NLS-1$
- }
-
- private static String getAttribute() {
- return getPrefix() + "_attribute"; //$NON-NLS-1$
- }
-
- private static String getAttributeValue() {
- return getPrefix() + "_attribute_value"; //$NON-NLS-1$
- }
-
- private static String getNew() {
- return getPrefix() + "_new"; //$NON-NLS-1$
- }
-
- private static String getPrefix() {
- return "jsp"; //$NON-NLS-1$
- }
-
- private static String getTag() {
- return getPrefix() + "_tag"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.java
deleted file mode 100644
index a907d25af5..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeJSP.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.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for JSP template context types. Templates of this context type
- * apply to any place within JSP content type.
- */
-public class TemplateContextTypeJSP extends TemplateContextType {
- public TemplateContextTypeJSP() {
- super();
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new EncodingTemplateVariableResolverJSP());
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.java
deleted file mode 100644
index ae12677b8a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JSPDocumentRegionEdgeMatcher.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.ui.internal.text;
-
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class JSPDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public JSPDocumentRegionEdgeMatcher() {
- super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMJSPRegionContexts.JSP_COMMENT_TEXT, DOMJSPRegionContexts.JSP_DIRECTIVE_NAME, DOMJSPRegionContexts.JSP_ROOT_TAG_NAME, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, new JavaPairMatcher(BRACKETS));
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
deleted file mode 100644
index 2483dd26d4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 2, 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.ui.internal.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.ui.internal.derived.SingleCharReader;
-
-
-/**
- * Reads from a document either forwards or backwards. May be configured to
- * skip comments and strings.
- *
- * Copied from org.eclipse.jdt.internal.ui.text so we don't have to
- * depend on the org.eclipse.jdt.ui plugin.
- *
- * No modifications were made.
- */
-class JavaCodeReader extends SingleCharReader {
-
- /** The EOF character */
- public static final int EOF = -1;
-
- private boolean fSkipComments = false;
- private boolean fSkipStrings = false;
- private boolean fForward = false;
-
- private IDocument fDocument;
- private int fOffset;
-
- private int fEnd = -1;
- private int fCachedLineNumber = -1;
- private int fCachedLineOffset = -1;
-
-
- public JavaCodeReader() {
- }
-
- /**
- * Returns the offset of the last read character. Should only be called after read has been called.
- */
- public int getOffset() {
- return fForward ? fOffset - 1 : fOffset;
- }
-
- public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException {
- fDocument = document;
- fOffset = offset;
- fSkipComments = skipComments;
- fSkipStrings = skipStrings;
-
- fForward = true;
- fEnd = Math.min(fDocument.getLength(), fOffset + length);
- }
-
- public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException {
- fDocument = document;
- fOffset = offset;
- fSkipComments = skipComments;
- fSkipStrings = skipStrings;
-
- fForward = false;
- try {
- fCachedLineNumber = fDocument.getLineOfOffset(fOffset);
- }
- catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- /*
- * @see Reader#close()
- */
- public void close() throws IOException {
- fDocument = null;
- }
-
- /*
- * @see SingleCharReader#read()
- */
- public int read() throws IOException {
- try {
- return fForward ? readForwards() : readBackwards();
- }
- catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- private void gotoCommentEnd() throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
- if (current == '*') {
- if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') {
- ++fOffset;
- return;
- }
- }
- }
- }
-
- private void gotoStringEnd(char delimiter) throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
- if (current == '\\') {
- // ignore escaped characters
- ++fOffset;
- }
- else if (current == delimiter) {
- return;
- }
- }
- }
-
- private void gotoLineEnd() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- fOffset = fDocument.getLineOffset(line + 1);
- }
-
- private int readForwards() throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
-
- switch (current) {
- case '/' :
-
- if (fSkipComments && fOffset < fEnd) {
- char next = fDocument.getChar(fOffset);
- if (next == '*') {
- // a comment starts, advance to the comment end
- ++fOffset;
- gotoCommentEnd();
- continue;
- }
- else if (next == '/') {
- // '//'-comment starts, advance to the line end
- gotoLineEnd();
- continue;
- }
- }
-
- return current;
-
- case '"' :
- case '\'' :
-
- if (fSkipStrings) {
- gotoStringEnd(current);
- continue;
- }
-
- return current;
- }
-
- return current;
- }
-
- return EOF;
- }
-
- private void handleSingleLineComment() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- if (line < fCachedLineNumber) {
- fCachedLineNumber = line;
- fCachedLineOffset = fDocument.getLineOffset(line);
- int offset = fOffset;
- while (fCachedLineOffset < offset) {
- char current = fDocument.getChar(offset--);
- if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') {
- fOffset = offset;
- return;
- }
- }
- }
- }
-
- private void gotoCommentStart() throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset--);
- if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/')
- return;
- }
- }
-
- private void gotoStringStart(char delimiter) throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset);
- if (current == delimiter) {
- if (!(0 <= fOffset && fDocument.getChar(fOffset - 1) == '\\'))
- return;
- }
- --fOffset;
- }
- }
-
- private int readBackwards() throws BadLocationException {
-
- while (0 < fOffset) {
- --fOffset;
-
- handleSingleLineComment();
-
- char current = fDocument.getChar(fOffset);
- switch (current) {
- case '/' :
-
- if (fSkipComments && fOffset > 1) {
- char next = fDocument.getChar(fOffset - 1);
- if (next == '*') {
- // a comment ends, advance to the comment start
- fOffset -= 2;
- gotoCommentStart();
- continue;
- }
- }
-
- return current;
-
- case '"' :
- case '\'' :
-
- if (fSkipStrings) {
- --fOffset;
- gotoStringStart(current);
- continue;
- }
-
- return current;
- }
-
- return current;
- }
-
- return EOF;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.java
deleted file mode 100644
index 0a55e93c26..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaPairMatcher.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.jst.jsp.ui.internal.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-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;
-
-
-/**
- * Helper class for match pairs of characters.
- *
- * Copied from org.eclipse.jdt.internal.ui.text so we don't have to
- * depend on the org.eclipse.jdt.ui plugin.
- *
- * No modifications were made.
- */
-class JavaPairMatcher implements ICharacterPairMatcher {
-
- protected char[] fPairs;
- protected IDocument fDocument;
- protected int fOffset;
-
- protected int fStartPos;
- protected int fEndPos;
- protected int fAnchor;
-
- protected JavaCodeReader fReader = new JavaCodeReader();
-
-
- public JavaPairMatcher(char[] pairs) {
- fPairs = pairs;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument, int)
- */
- public IRegion match(IDocument document, int offset) {
-
- fOffset = offset;
-
- if (fOffset < 0)
- return null;
-
- fDocument = document;
-
- if (fDocument != null && matchPairsAt() && fStartPos != fEndPos)
- return new Region(fStartPos, fEndPos - fStartPos + 1);
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
- */
- public int getAnchor() {
- return fAnchor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- clear();
- fDocument = null;
- fReader = null;
- }
-
- /*
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- if (fReader != null) {
- try {
- fReader.close();
- }
- catch (IOException x) {
- // ignore
- }
- }
- }
-
- protected boolean matchPairsAt() {
-
- int i;
- int pairIndex1 = fPairs.length;
- int pairIndex2 = fPairs.length;
-
- fStartPos = -1;
- fEndPos = -1;
-
- // get the chars preceding and following the start position
- try {
-
- char prevChar = fDocument.getChar(Math.max(fOffset - 1, 0));
- // modified behavior for http://dev.eclipse.org/bugs/show_bug.cgi?id=16879
- // char nextChar= fDocument.getChar(fOffset);
-
- // search for opening peer character next to the activation point
- for (i = 0; i < fPairs.length; i = i + 2) {
- // if (nextChar == fPairs[i]) {
- // fStartPos= fOffset;
- // pairIndex1= i;
- // } else
- if (prevChar == fPairs[i]) {
- fStartPos = fOffset - 1;
- pairIndex1 = i;
- }
- }
-
- // search for closing peer character next to the activation point
- for (i = 1; i < fPairs.length; i = i + 2) {
- if (prevChar == fPairs[i]) {
- fEndPos = fOffset - 1;
- pairIndex2 = i;
- }
- // else if (nextChar == fPairs[i]) {
- // fEndPos= fOffset;
- // pairIndex2= i;
- // }
- }
-
- if (fEndPos > -1) {
- fAnchor = RIGHT;
- fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
- if (fStartPos > -1)
- return true;
- else
- fEndPos = -1;
- }
- else if (fStartPos > -1) {
- fAnchor = LEFT;
- fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument);
- if (fEndPos > -1)
- return true;
- else
- fStartPos = -1;
- }
-
- }
- catch (BadLocationException x) {
- }
- catch (IOException x) {
- }
-
- return false;
- }
-
- protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
-
- fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
-
- int stack = 1;
- int c = fReader.read();
- while (c != JavaCodeReader.EOF) {
- if (c == openingPeer && c != closingPeer)
- stack++;
- else if (c == closingPeer)
- stack--;
-
- if (stack == 0)
- return fReader.getOffset();
-
- c = fReader.read();
- }
-
- return -1;
- }
-
- protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
-
- fReader.configureBackwardReader(document, offset, true, true);
-
- int stack = 1;
- int c = fReader.read();
- while (c != JavaCodeReader.EOF) {
- if (c == closingPeer && c != openingPeer)
- stack++;
- else if (c == openingPeer)
- stack--;
-
- if (stack == 0)
- return fReader.getOffset();
-
- c = fReader.read();
- }
-
- return -1;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java
deleted file mode 100644
index 8262bda8d4..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPActionSourceValidator.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.internal.validation;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-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.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentProperties;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.validation.JSPActionValidator;
-import org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.ConfigurationManager;
-import org.eclipse.wst.validation.internal.ProjectConfiguration;
-import org.eclipse.wst.validation.internal.ValidationConfiguration;
-import org.eclipse.wst.validation.internal.ValidationRegistryReader;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-/**
- * Source validator (able to check partial document) that checks for: -
- * missing required attributes & undefined attributes in jsp action tags such
- * as jsp directives and jsp custom tags
- */
-public class JSPActionSourceValidator extends JSPActionValidator implements ISourceValidator {
- private IDocument fDocument;
- private boolean fEnableSourceValidation;
- private IContentType fJSPFContentType = null;
-
- public void connect(IDocument document) {
- fDocument = document;
-
- // special checks to see source validation should really execute
- IFile file = null;
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- String baseLocation = model.getBaseLocation();
- // The baseLocation may be a path on disk or relative to the
- // workspace root. Don't translate on-disk paths to
- // in-workspace resources.
- IPath basePath = new Path(baseLocation);
- if (basePath.segmentCount() > 1) {
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
- /*
- * If the IFile doesn't exist, make sure it's not returned
- */
- if (!file.exists())
- file = null;
- }
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- fEnableSourceValidation = (file != null && isBatchValidatorPreferenceEnabled(file) && shouldValidate(file) && fragmentCheck(file));
- }
-
- public void disconnect(IDocument document) {
- fDocument = null;
- }
-
- public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
- if (helper == null || fDocument == null || !fEnableSourceValidation)
- return;
-
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
-
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (model == null)
- return;
-
- try {
- ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
- if (fb == null)
- return;
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fb.getLocation());
- if (file == null || !file.exists())
- return;
- performValidation(file, reporter, model, dirtyRegion);
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- /**
- * Gets current validation configuration based on current project (which
- * is based on current document) or global configuration if project does
- * not override
- *
- * @return ValidationConfiguration
- */
- private ValidationConfiguration getValidationConfiguration(IFile file) {
- ValidationConfiguration configuration = null;
- if (file != null) {
- IProject project = file.getProject();
- if (project != null) {
- try {
- ProjectConfiguration projectConfiguration = ConfigurationManager.getManager().getProjectConfiguration(project);
- configuration = projectConfiguration;
- if (projectConfiguration == null || projectConfiguration.useGlobalPreference()) {
- configuration = ConfigurationManager.getManager().getGlobalConfiguration();
- }
- }
- catch (InvocationTargetException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-
- return configuration;
- }
-
- /**
- * Checks if validator is enabled according in Validation preferences
- *
- * @param vmd
- * @return
- */
- private boolean isBatchValidatorPreferenceEnabled(IFile file) {
- if (file == null) {
- return true;
- }
-
- boolean enabled = true;
- ValidationConfiguration configuration = getValidationConfiguration(file);
- if (configuration != null) {
- org.eclipse.wst.validation.internal.ValidatorMetaData metadata = ValidationRegistryReader.getReader().getValidatorMetaData(JSPBatchValidator.class.getName());
- if (metadata != null) {
- if (!configuration.isBuildEnabled(metadata) && !configuration.isManualEnabled(metadata))
- enabled = false;
- }
- }
- return enabled;
- }
-
- /**
- * Checks if file is a jsp fragment or not. If so, check if the fragment
- * should be validated or not.
- *
- * @param file
- * Assumes shouldValidate was already called on file so it
- * should not be null and does exist
- * @return false if file is a fragment and it should not be validated,
- * true otherwise
- */
- private boolean fragmentCheck(IFile file) {
- // copied from JSPValidator
- boolean shouldValidate = true;
- // quick check to see if this is possibly a jsp fragment
- if (getJSPFContentType().isAssociatedWith(file.getName())) {
- // get preference for validate jsp fragments
- boolean shouldValidateFragments = Boolean.valueOf(JSPFContentProperties.getProperty(JSPFContentProperties.VALIDATE_FRAGMENTS, file, true)).booleanValue();
- /*
- * if jsp fragments should not be validated, check if file is
- * really jsp fragment
- */
- if (!shouldValidateFragments) {
- boolean isFragment = isFragment(file);
- shouldValidate = !isFragment;
- }
- }
- return shouldValidate;
- }
-
- /**
- * Determines if file is jsp fragment or not (does a deep, indepth check,
- * looking into contents of file)
- *
- * @param file
- * assumes file is not null and exists
- * @return true if file is jsp fragment, false otherwise
- */
- private boolean isFragment(IFile file) {
- // copied from JSPValidator
- boolean isFragment = false;
- InputStream is = null;
- try {
- 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();
- isFragment = (fileCtId != null && ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT.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 isFragment;
- }
-
- private boolean shouldValidate(IFile file) {
- // copied from JSPValidator
- IResource resource = file;
- do {
- if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || resource.getName().charAt(0) == '.') {
- return false;
- }
- resource = resource.getParent();
- }
- while ((resource.getType() & IResource.PROJECT) == 0);
- return true;
- }
-
- /**
- * Returns JSP fragment content type
- *
- * @return jspf content type
- */
- private IContentType getJSPFContentType() {
- // copied from JSPValidator
- if (fJSPFContentType == null) {
- fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT);
- }
- return fJSPFContentType;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java
deleted file mode 100644
index 068aae56d9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.wizard;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-class NewJSPFileWizardPage extends WizardNewFileCreationPage {
-
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewJSPFileWizardPage(String pageName, IStructuredSelection selection) {
- super(pageName, selection);
- }
-
- /**
- * This method is overriden to set the selected folder to web contents
- * folder if the current selection is outside the web contents folder.
- */
- protected void initialPopulateContainerNameField() {
- super.initialPopulateContainerNameField();
-
- IPath fullPath = getContainerFullPath();
- IProject project = getProjectFromPath(fullPath);
- IPath webContentPath = getWebContentPath(project);
-
- if (webContentPath != null && !webContentPath.isPrefixOf(fullPath)) {
- setContainerFullPath(webContentPath);
- }
- }
-
- /**
- * This method is overriden to set additional validation specific to jsp
- * files.
- */
- protected boolean validatePage() {
- setMessage(null);
- setErrorMessage(null);
-
- if (!super.validatePage()) {
- return false;
- }
-
- String fileName = getFileName();
- IPath fullPath = getContainerFullPath();
- if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
- // check that filename does not contain invalid extension
- if (!extensionValidForContentType(fileName)) {
- setErrorMessage(NLS.bind(JSPUIMessages._ERROR_FILENAME_MUST_END_JSP, getValidExtensions().toString()));
- return false;
- }
- // no file extension specified so check adding default
- // extension doesn't equal a file that already exists
- if (fileName.lastIndexOf('.') == -1) {
- String newFileName = addDefaultExtension(fileName);
- IPath resourcePath = fullPath.append(newFileName);
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
- if (!result.isOK()) {
- // path invalid
- setErrorMessage(result.getMessage());
- return false;
- }
-
- if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
- setErrorMessage(JSPUIMessages.ResourceGroup_nameExists);
- return false;
- }
- }
-
- // get the IProject for the selection path
- IProject project = getProjectFromPath(fullPath);
- if (project != null) {
- if (!isJavaProject(project)) {
- setMessage(JSPUIMessages._WARNING_FILE_MUST_BE_INSIDE_JAVA_PROJECT, WARNING);
- }
- // if inside web project, check if inside webContent folder
- if (isDynamicWebProject(project)) {
- // check that the path is inside the webContent folder
- IPath webContentPath = getWebContentPath(project);
- if (!webContentPath.isPrefixOf(fullPath)) {
- setMessage(JSPUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
- }
- }
- }
- }
-
- return true;
- }
-
- /**
- * Adds default extension to the filename
- *
- * @param filename
- * @return
- */
- String addDefaultExtension(String filename) {
- StringBuffer newFileName = new StringBuffer(filename);
-
- Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
- String ext = preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);
-
- newFileName.append("."); //$NON-NLS-1$
- newFileName.append(ext);
-
- return newFileName.toString();
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- private IContentType getContentType() {
- if (fContentType == null)
- fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- return fContentType;
- }
-
- /**
- * Get list of valid extensions for JSP Content type
- *
- * @return
- */
- private List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- /**
- * Verifies if fileName is valid name for content type. Takes base content
- * type into consideration.
- *
- * @param fileName
- * @return true if extension is valid for this content type
- */
- private boolean extensionValidForContentType(String fileName) {
- boolean valid = false;
-
- IContentType type = getContentType();
- // there is currently an extension
- if (fileName.lastIndexOf('.') != -1) {
- // check what content types are associated with current extension
- IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
- int i = 0;
- while (i < types.length && !valid) {
- valid = types[i].isKindOf(type);
- ++i;
- }
- }
- else
- valid = true; // no extension so valid
- return valid;
- }
-
- /**
- * Returns the project that contains the specified path
- *
- * @param path
- * the path which project is needed
- * @return IProject object. If path is <code>null</code> the return
- * value is also <code>null</code>.
- */
- private IProject getProjectFromPath(IPath path) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = null;
-
- if (path != null) {
- if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
- project = workspace.getRoot().getProject(path.toString());
- }
- else {
- project = workspace.getRoot().getFile(path).getProject();
- }
- }
-
- return project;
- }
-
- /**
- * Checks if the specified project is a web project.
- *
- * @param project
- * project to be checked
- * @return true if the project is web project, otherwise false
- */
- private boolean isDynamicWebProject(IProject project) {
- IFacetedProject faceted = null;
- try {
- faceted = ProjectFacetsManager.create(project);
- }
- catch (CoreException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- if (faceted != null && faceted.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE))) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Checks if the specified project is a type of java project.
- *
- * @param project
- * project to be checked (cannot be null)
- * @return true if the project is a type of java project, otherwise false
- */
- private boolean isJavaProject(IProject project) {
- boolean isJava = false;
- try {
- isJava = project.hasNature(JavaCore.NATURE_ID);
- }
- catch (CoreException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- return isJava;
- }
-
- /**
- * Returns the web contents folder of the specified project
- *
- * @param project
- * the project which web contents path is needed
- * @return IPath of the web contents folder
- */
- private IPath getWebContentPath(IProject project) {
- IPath path = null;
-
- if (project != null && isDynamicWebProject(project)) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- path = component.getRootFolder().getWorkspaceRelativePath();
- }
-
- return path;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
deleted file mode 100644
index 95ece8c58c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateBuffer;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-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.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-
-/**
- * Templates page in new file wizard. Allows users to select a new file
- * template to be applied in new file.
- *
- */
-public class NewJSPTemplatesWizardPage extends WizardPage {
-
- /**
- * Content provider for templates
- */
- private class TemplateContentProvider implements IStructuredContentProvider {
- /** The template store. */
- private TemplateStore fStore;
-
- /*
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- fStore = null;
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object input) {
- return fStore.getTemplates(TemplateContextTypeIdsJSP.NEW);
- }
-
- /*
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fStore = (TemplateStore) newInput;
- }
- }
-
- /**
- * Label provider for templates.
- */
- private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- /*
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
- * int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /*
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
- * int)
- */
- public String getColumnText(Object element, int columnIndex) {
- Template template = (Template) element;
-
- switch (columnIndex) {
- case 0 :
- return template.getName();
- case 1 :
- return template.getDescription();
- default :
- return ""; //$NON-NLS-1$
- }
- }
- }
-
- /** Last selected template name */
- private String fLastSelectedTemplateName;
- /** The viewer displays the pattern of selected template. */
- private SourceViewer fPatternViewer;
- /** The table presenting the templates. */
- private TableViewer fTableViewer;
- /** Template store used by this wizard page */
- private TemplateStore fTemplateStore;
- /** Checkbox for using templates. */
- private Button fUseTemplateButton;
-
- public NewJSPTemplatesWizardPage() {
- super("NewJSPTemplatesWizardPage", JSPUIMessages.NewJSPTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(JSPUIMessages.NewJSPTemplatesWizardPage_1);
- }
-
- /**
- * Correctly resizes the table so no phantom columns appear
- *
- * @param parent
- * the parent control
- * @param buttons
- * the buttons
- * @param table
- * the table
- * @param column1
- * the first column
- * @param column2
- * the second column
- * @param column3
- * the third column
- */
- private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
- parent.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area = parent.getClientArea();
- Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height) {
- // Subtract the scrollbar width from the total column
- // width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
-
- Point oldSize = table.getSize();
- if (oldSize.x > width) {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- table.setSize(width, area.height);
- }
- else {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- table.setSize(width, area.height);
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- }
- }
- });
- }
-
- public void createControl(Composite ancestor) {
- Composite parent = new Composite(ancestor, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout(layout);
-
- // create checkbox for user to use JSP Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText(JSPUIMessages.NewJSPTemplatesWizardPage_4);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- fUseTemplateButton.setLayoutData(data);
- fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- enableTemplates();
- }
- });
-
- // create composite for Templates table
- Composite innerParent = new Composite(parent, SWT.NONE);
- GridLayout innerLayout = new GridLayout();
- innerLayout.numColumns = 2;
- innerLayout.marginHeight = 0;
- innerLayout.marginWidth = 0;
- innerParent.setLayout(innerLayout);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
- innerParent.setLayoutData(gd);
-
- // Create linked text to just to templates preference page
- Link link = new Link(innerParent, SWT.NONE);
- link.setText(JSPUIMessages.NewJSPTemplatesWizardPage_6);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- // create table that displays templates
- Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
-
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertWidthInCharsToPixels(2);
- data.heightHint = convertHeightInCharsToPixels(10);
- data.horizontalSpan = 2;
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText(JSPUIMessages.NewJSPTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(JSPUIMessages.NewJSPTemplatesWizardPage_3);
-
- fTableViewer = new TableViewer(table);
- fTableViewer.setLabelProvider(new TemplateLabelProvider());
- fTableViewer.setContentProvider(new TemplateContentProvider());
-
- fTableViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object object1, Object object2) {
- if ((object1 instanceof Template) && (object2 instanceof Template)) {
- Template left = (Template) object1;
- Template right = (Template) object2;
- int result = left.getName().compareToIgnoreCase(right.getName());
- if (result != 0)
- return result;
- return left.getDescription().compareToIgnoreCase(right.getDescription());
- }
- return super.compare(viewer, object1, object2);
- }
-
- public boolean isSorterProperty(Object element, String property) {
- return true;
- }
- });
-
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- updateViewerInput();
- }
- });
-
- // create viewer that displays currently selected template's contents
- fPatternViewer = doCreateViewer(parent);
-
- fTemplateStore = JSPUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.JSP_NEWWIZARD_TEMPLATE_HELPID);
- Dialog.applyDialogFont(parent);
- setControl(parent);
- }
-
- /**
- * Creates, configures and returns a source viewer to present the template
- * pattern on the preference page. Clients may override to provide a
- * custom source viewer featuring e.g. syntax coloring.
- *
- * @param parent
- * the parent control
- * @return a configured source viewer
- */
- private SourceViewer createViewer(Composite parent) {
- SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- SourceViewerConfiguration configuration = new SourceViewerConfiguration();
- viewer.configure(configuration);
- IDocument document = new Document();
- viewer.setDocument(document);
- return viewer;
- }
-
- private SourceViewer doCreateViewer(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(JSPUIMessages.NewJSPTemplatesWizardPage_5);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- SourceViewer viewer = createViewer(parent);
- viewer.setEditable(false);
-
- Control control = viewer.getControl();
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- data.heightHint = convertHeightInCharsToPixels(5);
- control.setLayoutData(data);
-
- return viewer;
- }
-
- /**
- * Enable/disable controls in page based on fUseTemplateButton's current
- * state.
- */
- void enableTemplates() {
- boolean enabled = fUseTemplateButton.getSelection();
-
- if (!enabled) {
- // save last selected template
- Template template = getSelectedTemplate();
- if (template != null)
- fLastSelectedTemplateName = template.getName();
- else
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
-
- fTableViewer.setSelection(null);
- }
- else {
- setSelectedTemplate(fLastSelectedTemplateName);
- }
-
- fTableViewer.getControl().setEnabled(enabled);
- fPatternViewer.getControl().setEnabled(enabled);
- }
-
- /**
- * Return the template preference page id
- *
- * @return
- */
- private String getPreferencePageId() {
- return "org.eclipse.wst.sse.ui.preferences.jsp.templates"; //$NON-NLS-1$
- }
-
- /**
- * Get the currently selected template.
- *
- * @return
- */
- private Template getSelectedTemplate() {
- Template template = null;
- IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
-
- if (selection.size() == 1) {
- template = (Template) selection.getFirstElement();
- }
- return template;
- }
-
- /**
- * Returns template string to insert.
- *
- * @return String to insert or null if none is to be inserted
- */
- String getTemplateString() {
- String templateString = null;
-
- Template template = getSelectedTemplate();
- if (template != null) {
- TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW);
- IDocument document = new Document();
- TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
- try {
- TemplateBuffer buffer = context.evaluate(template);
- templateString = buffer.getString();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Could not create template for new jsp", e); //$NON-NLS-1$
- }
- }
-
- return templateString;
- }
-
- void linkClicked() {
- String pageId = getPreferencePageId();
- PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
- dialog.open();
- fTableViewer.refresh();
- }
-
- /**
- * Load the last template name used in New JSP File wizard.
- */
- private void loadLastSavedPreferences() {
- String templateName = JSPUIPlugin.getDefault().getPreferenceStore().getString(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- fUseTemplateButton.setSelection(false);
- }
- else {
- fLastSelectedTemplateName = templateName;
- fUseTemplateButton.setSelection(true);
- }
- enableTemplates();
- }
-
- /**
- * Save template name used for next call to New JSP File wizard.
- */
- void saveLastSavedPreferences() {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null) {
- templateName = template.getName();
- }
-
- JSPUIPlugin.getDefault().getPreferenceStore().setValue(JSPUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- JSPUIPlugin.getDefault().savePluginPreferences();
- }
-
- /**
- * Select a template in the table viewer given the template name. If
- * template name cannot be found or templateName is null, just select
- * first item in table. If no items in table select nothing.
- *
- * @param templateName
- */
- private void setSelectedTemplate(String templateName) {
- Object template = null;
-
- if (templateName != null && templateName.length() > 0) {
- // pick the last used template
- template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsJSP.NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null) {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null) {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- /**
- * Updates the pattern viewer.
- */
- void updateViewerInput() {
- Template template = getSelectedTemplate();
- if (template != null) {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
deleted file mode 100644
index d152057e89..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
-import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImages;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-public class NewJSPWizard extends Wizard implements INewWizard {
- private NewJSPFileWizardPage fNewFilePage;
- private NewJSPTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- public void addPages() {
- fNewFilePage = new NewJSPFileWizardPage("JSPWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
- fNewFilePage.setTitle(JSPUIMessages._UI_WIZARD_NEW_HEADING);
- fNewFilePage.setDescription(JSPUIMessages._UI_WIZARD_NEW_DESCRIPTION);
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewJSPTemplatesWizardPage();
- addPage(fNewFileTemplatesPage);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- fSelection = aSelection;
- setWindowTitle(JSPUIMessages._UI_WIZARD_NEW_TITLE);
-
- ImageDescriptor descriptor = JSPEditorPluginImageHelper.getInstance().getImageDescriptor(JSPEditorPluginImages.IMG_OBJ_WIZBAN_NEWJSPFILE);
- setDefaultPageImageDescriptor(descriptor);
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- });
- }
- }
-
- public boolean performFinish() {
- boolean performedOK = false;
-
- // save user options for next use
- fNewFileTemplatesPage.saveLastSavedPreferences();
-
- // no file extension specified so add default extension
- String fileName = fNewFilePage.getFileName();
- if (fileName.lastIndexOf('.') == -1) {
- String newFileName = fNewFilePage.addDefaultExtension(fileName);
- fNewFilePage.setFileName(newFileName);
- }
-
- // create a new empty file
- IFile file = fNewFilePage.createNewFile();
-
- // if there was problem with creating file, it will be null, so make
- // sure to check
- if (file != null) {
- // put template contents into file
- String templateString = fNewFileTemplatesPage.getTemplateString();
- if (templateString != null) {
- // determine the encoding for the new file
- Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
- try {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- OutputStreamWriter outputStreamWriter = null;
- if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
- // just use default encoding
- outputStreamWriter = new OutputStreamWriter(outputStream);
- }
- else {
- outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
- }
- outputStreamWriter.write(templateString);
- outputStreamWriter.flush();
- outputStreamWriter.close();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- file.setContents(inputStream, true, false, null);
- inputStream.close();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new JSP file", e); //$NON-NLS-1$
- }
- }
-
- // open the file in editor
- openEditor(file);
-
- // everything's fine
- performedOK = true;
- }
- return performedOK;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
deleted file mode 100644
index f9a15705b3..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/views/contentoutline/JSPContentOutlineConfiguration.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ui.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows JSP content.
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class JSPContentOutlineConfiguration extends HTMLContentOutlineConfiguration {
-
- // private static final String ATT_CLASS = "class"; //$NON-NLS-1$
-
- // TODO: Automate the loading of a real configuration based on the model
- // type at
- // creation time; clear on unConfigure so that a new embedded
- // configuration can
- // be used
- // private StructuredContentOutlineConfiguration fEmbeddedConfiguration =
- // null;
-
- /**
- * Create new instance of JSPContentOutlineConfiguration
- */
- public JSPContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
deleted file mode 100644
index 54eff47484..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
+++ /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
-###############################################################################
-Templates.jspscriptlet.name=JSP scriptlet
-Templates.jspscriptlet.desc=JSP scriptlet <%..%>
-Templates.jspscriptlet.content=<% ${cursor} %>
-Templates.jsphiddencomment.name=JSP hidden comment
-Templates.jsphiddencomment.desc=JSP hidden comment <%-- --%>
-Templates.jsphiddencomment.content=<%-- ${cursor} --%>
-Templates.jspdeclaration.name=JSP declaration(s)
-Templates.jspdeclaration.desc=JSP declaration(s) <%!..%>
-Templates.jspdeclaration.content=<%! ${cursor} %>
-Templates.jspexpression.name=JSP expression
-Templates.jspexpression.desc=JSP expression <%=..%>
-Templates.jspexpression.content=<%= ${cursor} %>
-Templates.jspincludedirective.name=JSP include directive
-Templates.jspincludedirective.desc=JSP include directive
-Templates.jspincludedirective.content=<%@ include file="${cursor}" %>
-Templates.jsppagedirective.name=JSP page directive
-Templates.jsppagedirective.desc=JSP page directive
-Templates.jsppagedirective.content=<%@ page contentType="text/html; charset=${encoding}" %>
-Templates.jsptaglibdirective.name=JSP taglib directive
-Templates.jsptaglibdirective.desc=JSP taglib directive
-Templates.jsptaglibdirective.content=<%@ taglib uri="" prefix="${cursor}" %>
-Templates.jsphtml.name=New JSP File (html)
-Templates.jsphtml.desc=JSP with html markup
-Templates.jsphtml.content=<%@ page language="java" contentType="text/html; charset=${encoding}"\n pageEncoding="${encoding}"%>\n<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.jspxhtml.name=New JSP File (xhtml)
-Templates.jspxhtml.desc=JSP with xhtml markup
-Templates.jspxhtml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<%@ page language="java" contentType="text/html; charset=${encoding}"\n pageEncoding="${encoding}"%>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.jspxhtmlxml.name=New JSP File (xhtml, xml syntax)
-Templates.jspxhtmlxml.desc=JSP with xhtml markup and xml style syntax
-Templates.jspxhtmlxml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">\n <jsp:directive.page language="java"\n contentType="text/html; charset=${encoding}" pageEncoding="${encoding}" />\n <jsp:text>\n <![CDATA[ <?xml version="1.0" encoding="${encoding}" ?> ]]>\n </jsp:text>\n <jsp:text>\n <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>\n </jsp:text>\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>\n</jsp:root> \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml b/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
deleted file mode 100644
index 35396315a2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-
-<template name="%Templates.jspscriptlet.name" description="%Templates.jspscriptlet.desc" id="org.eclipse.jst.jsp.ui.templates.jspscriptlet" context="jsp_tag" enabled="true">%Templates.jspscriptlet.content</template>
-
-<template name="%Templates.jsphiddencomment.name" description="%Templates.jsphiddencomment.desc" id="org.eclipse.jst.jsp.ui.templates.jsphiddencomment" context="jsp_tag" enabled="true">%Templates.jsphiddencomment.content</template>
-
-<template name="%Templates.jspdeclaration.name" description="%Templates.jspdeclaration.desc" id="org.eclipse.jst.jsp.ui.templates.jspdeclaration" context="jsp_tag" enabled="true">%Templates.jspdeclaration.content</template>
-
-<template name="%Templates.jspexpression.name" description="%Templates.jspexpression.desc" id="org.eclipse.jst.jsp.ui.templates.jspexpression" context="jsp_all" enabled="true">%Templates.jspexpression.content</template>
-
-<template name="%Templates.jspincludedirective.name" description="%Templates.jspincludedirective.desc" id="org.eclipse.jst.jsp.ui.templates.jspincludedirective" context="jsp_tag" enabled="true">%Templates.jspincludedirective.content</template>
-
-<template name="%Templates.jsppagedirective.name" description="%Templates.jsppagedirective.desc" id="org.eclipse.jst.jsp.ui.templates.jsppagedirective" context="jsp_tag" enabled="true">%Templates.jsppagedirective.content</template>
-
-<template name="%Templates.jsptaglibdirective.name" description="%Templates.jsptaglibdirective.desc" id="org.eclipse.jst.jsp.ui.templates.jsptaglibdirective" context="jsp_tag" enabled="true">%Templates.jsptaglibdirective.content</template>
-
-<template name="%Templates.jsphtml.name" description="%Templates.jsphtml.desc" id="org.eclipse.jst.jsp.ui.templates.jsphtml" context="jsp_new" enabled="true">%Templates.jsphtml.content</template>
-
-<template name="%Templates.jspxhtml.name" description="%Templates.jspxhtml.desc" id="org.eclipse.jst.jsp.ui.templates.jspxhtml" context="jsp_new" enabled="true">%Templates.jspxhtml.content</template>
-
-<template name="%Templates.jspxhtmlxml.name" description="%Templates.jspxhtmlxml.desc" id="org.eclipse.jst.jsp.ui.templates.jspxhtmlxml" context="jsp_new" enabled="true">%Templates.jspxhtmlxml.content</template>
-</templates>
diff --git a/bundles/org.eclipse.wst.html.core/.classpath b/bundles/org.eclipse.wst.html.core/.classpath
deleted file mode 100644
index cb0105380b..0000000000
--- a/bundles/org.eclipse.wst.html.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.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.html.core/.cvsignore b/bundles/org.eclipse.wst.html.core/.cvsignore
deleted file mode 100644
index 02ca6cb2c7..0000000000
--- a/bundles/org.eclipse.wst.html.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-htmlmodel.jar
-temp.folder
-dev.properties
-build.xml
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.html.core/.options b/bundles/org.eclipse.wst.html.core/.options
deleted file mode 100644
index e66a59f041..0000000000
--- a/bundles/org.eclipse.wst.html.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.html.core/debug=true
-org.eclipse.wst.html.core/debug/tracefilter= \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/.project b/bundles/org.eclipse.wst.html.core/.project
deleted file mode 100644
index 13a9facdf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.html.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 17 01:48:39 EDT 2006
-eclipse.preferences.version=1
-line.separator=\r\n
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 5f7bac7128..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sat Aug 19 16:31:43 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=ignore
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Apr 17 01:48:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<templates/>
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 061cd53dd0..0000000000
--- a/bundles/org.eclipse.wst.html.core/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,16 +0,0 @@
-#Mon Apr 17 02:01:33 EDT 2006
-compilers.incompatible-environment=0
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
deleted file mode 100644
index a3f55a1be8..0000000000
--- a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,37 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.1.3.qualifier
-Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.core.internal;x-internal:=true,
- org.eclipse.wst.html.core.internal.cleanup;x-internal:=true,
- org.eclipse.wst.html.core.internal.commentelement.handlers;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel.chtml;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentmodel.ssi;x-internal:=true,
- org.eclipse.wst.html.core.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.html.core.internal.contenttype;x-internal:=true,
- org.eclipse.wst.html.core.internal.document;x-internal:=true,
- org.eclipse.wst.html.core.internal.encoding;x-internal:=true,
- org.eclipse.wst.html.core.internal.format;x-internal:=true,
- org.eclipse.wst.html.core.internal.htmlcss;x-internal:=true,
- org.eclipse.wst.html.core.internal.modelhandler;x-internal:=true,
- org.eclipse.wst.html.core.internal.modelquery;x-internal:=true,
- org.eclipse.wst.html.core.internal.preferences;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional.contenttype;x-internal:=true,
- org.eclipse.wst.html.core.internal.provisional.text;x-internal:=true,
- org.eclipse.wst.html.core.internal.text;x-internal:=true,
- org.eclipse.wst.html.core.internal.validate;x-internal:=true,
- org.eclipse.wst.html.core.text
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.4.4,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.0,1.2.0)"
-Eclipse-LazyStart: true; exceptions="org.eclipse.wst.html.core.internal.contenttype"
diff --git a/bundles/org.eclipse.wst.html.core/about.html b/bundles/org.eclipse.wst.html.core/about.html
deleted file mode 100644
index 4ec5989581..0000000000
--- a/bundles/org.eclipse.wst.html.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 2, 2006</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.html.core/build.properties b/bundles/org.eclipse.wst.html.core/build.properties
deleted file mode 100644
index 82622b7269..0000000000
--- a/bundles/org.eclipse.wst.html.core/build.properties
+++ /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
-###############################################################################
-bin.includes = plugin.xml,\
- .options,\
- data/,\
- plugin.properties,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = component.xml,\
- build.properties
-source.. = src/
diff --git a/bundles/org.eclipse.wst.html.core/component.xml b/bundles/org.eclipse.wst.html.core/component.xml
deleted file mode 100644
index 8565aecd93..0000000000
--- a/bundles/org.eclipse.wst.html.core/component.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.html">
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.html.core" fragment="false" />
- <plugin id="org.eclipse.wst.html.standard.dtds" fragment="false" />
- <plugin id="org.eclipse.wst.html.ui" fragment="false" />
- <description url="http://eclipse.org/webtools/wst/components/html/overview.html" />
- <package name="org.eclipse.wst.html.ui" api="false">
- <type name="StructuredTextViewerConfigurationHTML" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.html.ui.views.contentoutline" api="false">
- <type name="HTMLContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
- <plugin id="org.eclipse.wst.html.ui.infopop" fragment="false" />
-</component>
diff --git a/bundles/org.eclipse.wst.html.core/data/htmref.properties b/bundles/org.eclipse.wst.html.core/data/htmref.properties
deleted file mode 100644
index 9cd460d81e..0000000000
--- a/bundles/org.eclipse.wst.html.core/data/htmref.properties
+++ /dev/null
@@ -1,108 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ATagInfo=A link if the href attribute is present, and the target for a link if the name attribute is present
-ABBRTagInfo=An abbreviation (for example, WWW, HTTP)
-ACRONYMTagInfo=An acronym (for example, SCUBA)
-ADDRESSTagInfo=Address information for the author of the page
-APPLETTagInfo=A Java applet
-AREATagInfo=Defines a client-side image map area
-BTagInfo=Displays contained text as bold
-BASETagInfo=The base URI for the page, to be used when calculating relative paths
-BASEFONTTagInfo=The base font size for the page
-BDOTagInfo=Overrides default bidirectional display. For use with bidirectional languages.
-BIGTagInfo=Displays contained text as large
-BGSOUNDTagInfo=Defines a sound file for the page. Not supported by W3C HTML 4.01.
-BLINKTagInfo=Displays text as blinking. Not supported by W3C HTML 4.01.
-BLOCKQUOTETagInfo=A long quotation
-BODYTagInfo=The document body. Contains all the content for the page.
-BRTagInfo=Forces a line break
-BUTTONTagInfo=Defines a push button
-CAPTIONTagInfo=Defines a table caption
-CENTERTagInfo=Displays contained text centered. Equivalent to DIV with align=center.
-CITETagInfo=A citation
-CODETagInfo=A computer code fragment
-COLTagInfo=A table column
-COLGROUPTagInfo=A group of table columns
-DDTagInfo=A definition or description in a definition or description list
-DELTagInfo=Displays text as deleted
-DFNTagInfo=A definition
-DIRTagInfo=A directory listing
-DIVTagInfo=A generic container, which can be used for defining language or style for the contents
-DLTagInfo=A definition or description list
-DTTagInfo=A term or subject in a definition or description list
-EMTagInfo=Displays text emphasized (generally italicized)
-EMBEDTagInfo=Defines an embedded plug-in. Not supported by W3C HTML 4.01.
-FIELDSETTagInfo=Defines a form control group
-FONTTagInfo=Displays text in the given font
-FORMTagInfo=Defines an interactive form
-FRAMETagInfo=Defines a frame within the current window
-FRAMESETTagInfo=Defines a frameset that divides the window into frames
-H1TagInfo=A top-level heading
-H2TagInfo=A second-level heading
-H3TagInfo=A third-level heading
-H4TagInfo=A fourth-level heading
-H5TagInfo=A fifth-level heading
-H6TagInfo=A sixth-level heading
-HEADTagInfo=Contains metadata and window title information for the document
-HRTagInfo=A horizontal rule
-HTMLTagInfo=The root element for the document.
-ITagInfo=Displays text as italic
-IFRAMETagInfo=Defines an inline subwindow
-IMGTagInfo=Displays the referenced image as embedded content
-INPUTTagInfo=Defines a form control for user input
-INSTagInfo=Defines inserted text
-ISINDEXTagInfo=Defines a single line prompt
-KBDTagInfo=Defines text to be entered by the user
-LABELTagInfo=Defines the label for a form field
-LEGENDTagInfo=Defines the label for a set of form fields
-LITagInfo=Defines a list item within a list
-LINKTagInfo=A media-independent link
-MAPTagInfo=Defines a client-side image map
-MARQUEETagInfo=Displays text as scrolling. Not supported by W3C HTML 4.01.
-MENUTagInfo=Defines a menu list
-METATagInfo=Defines metadata information for the document
-NOBRTagInfo=Overrides and prevents line breaks. Not supported by W3C HTML 4.01.
-NOFRAMESTagInfo=Provides information to display if the current browser does not support frames
-NOSCRIPTTagInfo=Provides information to display if the current browser does not support scripting
-OBJECTTagInfo=Defines a generic embedded object
-OLTagInfo=An ordered list
-OPTGROUPTagInfo=An option group
-OPTIONTagInfo=A selectable choice
-PTagInfo=A paragraph
-PARAMTagInfo=A named property value
-PRETagInfo=Preformatted text
-QTagInfo=A short inline quotation
-STagInfo=Display text in strike-through style
-SAMPTagInfo=Sample program output, scripts, etc. Displays in monospace font.
-SCRIPTTagInfo=Script statements
-SELECTTagInfo=An option selector
-SMALLTagInfo=Displays text as small
-SPANTagInfo=A generic container, which can be used for defining language or style for the contents
-STRIKETagInfo=Display text in strike-through style
-STRONGTagInfo=Displays text as strongly emphasized (generally bold)
-STYLETagInfo=Defines a style for the contained information
-SUBTagInfo=Display as subscript
-SUPTagInfo=Display as superscript
-TABLETagInfo=Defines a table
-TBODYTagInfo=The body of the table
-TDTagInfo=A cell within a table
-TEXTAREATagInfo=A multi-line text field
-TFOOTTagInfo=A table footer
-THTagInfo=A table header cell
-THEADTagInfo=A table header
-TITLETagInfo=The document title, displayed in the browser's title bar
-TRTagInfo=A table row
-TTTagInfo=Displays text in teletype or monospaced text style
-UTagInfo=Displays text as underlined
-ULTagInfo=An unordered list
-VARTagInfo=An instance of a variable or program argument
-WBRTagInfo=Allows a line break within <B>&lt;NOBR&gt;</B> tag. Not supported by W3C HTML 4.01.
diff --git a/bundles/org.eclipse.wst.html.core/data/htmref.xml b/bundles/org.eclipse.wst.html.core/data/htmref.xml
deleted file mode 100644
index c7bcd64385..0000000000
--- a/bundles/org.eclipse.wst.html.core/data/htmref.xml
+++ /dev/null
@@ -1,306 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
- -->
-<abstractGrammarAnnotations propertiesLocation="htmref" caseSensitive="false">
- <annotation spec="A">
- <property name="tagInfo">%ATagInfo</property>
- </annotation>
- <annotation spec="ABBR">
- <property name="tagInfo">%ABBRTagInfo</property>
- </annotation>
- <annotation spec="ACRONYM">
- <property name="tagInfo">%ACRONYMTagInfo</property>
- </annotation>
- <annotation spec="ADDRESS">
- <property name="tagInfo">%ADDRESSTagInfo</property>
- </annotation>
- <annotation spec="APPLET">
- <property name="tagInfo">%APPLETTagInfo</property>
- </annotation>
- <annotation spec="AREA">
- <property name="tagInfo">%AREATagInfo</property>
- </annotation>
- <annotation spec="B">
- <property name="tagInfo">%BTagInfo</property>
- </annotation>
- <annotation spec="BASE">
- <property name="tagInfo">%BASETagInfo</property>
- </annotation>
- <annotation spec="BASEFONT">
- <property name="tagInfo">%BASEFONTTagInfo</property>
- </annotation>
- <annotation spec="BDO">
- <property name="tagInfo">%BDOTagInfo</property>
- </annotation>
- <annotation spec="BGSOUND">
- <property name="tagInfo">%BGSOUNDTagInfo</property>
- </annotation>
- <annotation spec="BIG">
- <property name="tagInfo">%BIGTagInfo</property>
- </annotation>
- <annotation spec="BLINK">
- <property name="tagInfo">%BLINKTagInfo</property>
- </annotation>
- <annotation spec="BLOCKQUOTE">
- <property name="tagInfo">%BLOCKQUOTETagInfo</property>
- </annotation>
- <annotation spec="BODY">
- <property name="tagInfo">%BODYTagInfo</property>
- </annotation>
- <annotation spec="BR">
- <property name="tagInfo">%BRTagInfo</property>
- </annotation>
- <annotation spec="BUTTON">
- <property name="tagInfo">%BUTTONTagInfo</property>
- </annotation>
- <annotation spec="CAPTION">
- <property name="tagInfo">%CAPTIONTagInfo</property>
- </annotation>
- <annotation spec="CENTER">
- <property name="tagInfo">%CENTERTagInfo</property>
- </annotation>
- <annotation spec="CITE">
- <property name="tagInfo">%CITETagInfo</property>
- </annotation>
- <annotation spec="CODE">
- <property name="tagInfo">%CODETagInfo</property>
- </annotation>
- <annotation spec="COL">
- <property name="tagInfo">%COLTagInfo</property>
- </annotation>
- <annotation spec="COLGROUP">
- <property name="tagInfo">%COLGROUPTagInfo</property>
- </annotation>
- <annotation spec="DD">
- <property name="tagInfo">%DDTagInfo</property>
- </annotation>
- <annotation spec="DEL">
- <property name="tagInfo">%DELTagInfo</property>
- </annotation>
- <annotation spec="DFN">
- <property name="tagInfo">%DFNTagInfo</property>
- </annotation>
- <annotation spec="DIR">
- <property name="tagInfo">%DIRTagInfo</property>
- </annotation>
- <annotation spec="DIV">
- <property name="tagInfo">%DIVTagInfo</property>
- </annotation>
- <annotation spec="DL">
- <property name="tagInfo">%DLTagInfo</property>
- </annotation>
- <annotation spec="DT">
- <property name="tagInfo">%DTTagInfo</property>
- </annotation>
- <annotation spec="EM">
- <property name="tagInfo">%EMTagInfo</property>
- </annotation>
- <annotation spec="EMBED">
- <property name="tagInfo">%EMBEDTagInfo</property>
- </annotation>
- <annotation spec="FIELDSET">
- <property name="tagInfo">%FIELDSETTagInfo</property>
- </annotation>
- <annotation spec="FONT">
- <property name="tagInfo">%FONTTagInfo</property>
- </annotation>
- <annotation spec="FORM">
- <property name="tagInfo">%FORMTagInfo</property>
- </annotation>
- <annotation spec="FRAME">
- <property name="tagInfo">%FRAMETagInfo</property>
- </annotation>
- <annotation spec="FRAMESET">
- <property name="tagInfo">%FRAMESETTagInfo</property>
- </annotation>
- <annotation spec="H1">
- <property name="tagInfo">%H1TagInfo</property>
- </annotation>
- <annotation spec="H2">
- <property name="tagInfo">%H2TagInfo</property>
- </annotation>
- <annotation spec="H3">
- <property name="tagInfo">%H3TagInfo</property>
- </annotation>
- <annotation spec="H4">
- <property name="tagInfo">%H4TagInfo</property>
- </annotation>
- <annotation spec="H5">
- <property name="tagInfo">%H5TagInfo</property>
- </annotation>
- <annotation spec="H6">
- <property name="tagInfo">%H6TagInfo</property>
- </annotation>
- <annotation spec="HEAD">
- <property name="tagInfo">%HEADTagInfo</property>
- </annotation>
- <annotation spec="HR">
- <property name="tagInfo">%HRTagInfo</property>
- </annotation>
- <annotation spec="HTML">
- <property name="tagInfo">%HTMLTagInfo</property>
- </annotation>
- <annotation spec="I">
- <property name="tagInfo">%ITagInfo</property>
- </annotation>
- <annotation spec="IFRAME">
- <property name="tagInfo">%IFRAMETagInfo</property>
- </annotation>
- <annotation spec="IMG">
- <property name="tagInfo">%IMGTagInfo</property>
- </annotation>
- <annotation spec="INPUT">
- <property name="tagInfo">%INPUTTagInfo</property>
- </annotation>
- <annotation spec="INS">
- <property name="tagInfo">%INSTagInfo</property>
- </annotation>
- <annotation spec="ISINDEX">
- <property name="tagInfo">%ISINDEXTagInfo</property>
- </annotation>
- <annotation spec="KBD">
- <property name="tagInfo">%KBDTagInfo</property>
- </annotation>
- <annotation spec="LABEL">
- <property name="tagInfo">%LABELTagInfo</property>
- </annotation>
- <annotation spec="LEGEND">
- <property name="tagInfo">%LEGENDTagInfo</property>
- </annotation>
- <annotation spec="LI">
- <property name="tagInfo">%LITagInfo</property>
- </annotation>
- <annotation spec="LINK">
- <property name="tagInfo">%LINKTagInfo</property>
- </annotation>
- <annotation spec="MAP">
- <property name="tagInfo">%MAPTagInfo</property>
- </annotation>
- <annotation spec="MARQUEE">
- <property name="tagInfo">%MARQUEETagInfo</property>
- </annotation>
- <annotation spec="MENU">
- <property name="tagInfo">%MENUTagInfo</property>
- </annotation>
- <annotation spec="META">
- <property name="tagInfo">%METATagInfo</property>
- </annotation>
- <annotation spec="NOBR">
- <property name="tagInfo">%NOBRTagInfo</property>
- </annotation>
- <annotation spec="NOFRAMES">
- <property name="tagInfo">%NOFRAMESTagInfo</property>
- </annotation>
- <annotation spec="NOSCRIPT">
- <property name="tagInfo">%NOSCRIPTTagInfo</property>
- </annotation>
- <annotation spec="OBJECT">
- <property name="tagInfo">%OBJECTTagInfo</property>
- </annotation>
- <annotation spec="OL">
- <property name="tagInfo">%OLTagInfo</property>
- </annotation>
- <annotation spec="OPTGROUP">
- <property name="tagInfo">%OPTGROUPTagInfo</property>
- </annotation>
- <annotation spec="OPTION">
- <property name="tagInfo">%OPTIONTagInfo</property>
- </annotation>
- <annotation spec="P">
- <property name="tagInfo">%PTagInfo</property>
- </annotation>
- <annotation spec="PARAM">
- <property name="tagInfo">%PARAMTagInfo</property>
- </annotation>
- <annotation spec="PRE">
- <property name="tagInfo">%PRETagInfo</property>
- </annotation>
- <annotation spec="Q">
- <property name="tagInfo">%QTagInfo</property>
- </annotation>
- <annotation spec="S">
- <property name="tagInfo">%STagInfo</property>
- </annotation>
- <annotation spec="SAMP">
- <property name="tagInfo">%SAMPTagInfo</property>
- </annotation>
- <annotation spec="SCRIPT">
- <property name="tagInfo">%SCRIPTTagInfo</property>
- </annotation>
- <annotation spec="SELECT">
- <property name="tagInfo">%SELECTTagInfo</property>
- </annotation>
- <annotation spec="SMALL">
- <property name="tagInfo">%SMALLTagInfo</property>
- </annotation>
- <annotation spec="SPAN">
- <property name="tagInfo">%SPANTagInfo</property>
- </annotation>
- <annotation spec="STRIKE">
- <property name="tagInfo">%STRIKETagInfo</property>
- </annotation>
- <annotation spec="STRONG">
- <property name="tagInfo">%STRONGTagInfo</property>
- </annotation>
- <annotation spec="STYLE">
- <property name="tagInfo">%STYLETagInfo</property>
- </annotation>
- <annotation spec="SUB">
- <property name="tagInfo">%SUBTagInfo</property>
- </annotation>
- <annotation spec="SUP">
- <property name="tagInfo">%SUPTagInfo</property>
- </annotation>
- <annotation spec="TABLE">
- <property name="tagInfo">%TABLETagInfo</property>
- </annotation>
- <annotation spec="TBODY">
- <property name="tagInfo">%TBODYTagInfo</property>
- </annotation>
- <annotation spec="TD">
- <property name="tagInfo">%TDTagInfo</property>
- </annotation>
- <annotation spec="TEXTAREA">
- <property name="tagInfo">%TEXTAREATagInfo</property>
- </annotation>
- <annotation spec="TFOOT">
- <property name="tagInfo">%TFOOTTagInfo</property>
- </annotation>
- <annotation spec="TH">
- <property name="tagInfo">%THTagInfo</property>
- </annotation>
- <annotation spec="THEAD">
- <property name="tagInfo">%THEADTagInfo</property>
- </annotation>
- <annotation spec="TITLE">
- <property name="tagInfo">%TITLETagInfo</property>
- </annotation>
- <annotation spec="TR">
- <property name="tagInfo">%TRTagInfo</property>
- </annotation>
- <annotation spec="TT">
- <property name="tagInfo">%TTTagInfo</property>
- </annotation>
- <annotation spec="U">
- <property name="tagInfo">%UTagInfo</property>
- </annotation>
- <annotation spec="UL">
- <property name="tagInfo">%ULTagInfo</property>
- </annotation>
- <annotation spec="VAR">
- <property name="tagInfo">%VARTagInfo</property>
- </annotation>
- <annotation spec="WBR">
- <property name="tagInfo">%WBRTagInfo</property>
- </annotation>
-</abstractGrammarAnnotations> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/plugin.properties b/bundles/org.eclipse.wst.html.core/plugin.properties
deleted file mode 100644
index c355a38112..0000000000
--- a/bundles/org.eclipse.wst.html.core/plugin.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source HTML Model
-Structured_HTML_Document_Factory_Extension.name=Structured HTML Document Factory Extension
-HTML_Content_Type_Extension_Element.name=HTML
diff --git a/bundles/org.eclipse.wst.html.core/plugin.xml b/bundles/org.eclipse.wst.html.core/plugin.xml
deleted file mode 100644
index 9d6fc2c4ee..0000000000
--- a/bundles/org.eclipse.wst.html.core/plugin.xml
+++ /dev/null
@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- default="no"
- class="org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML"
- associatedContentTypeId="org.eclipse.wst.html.core.htmlsource"
- id="org.eclipse.wst.html.core.internal.modelhandler">
- </modelHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.embeddedTypeHandler">
- <embeddedTypeHandler
- class="org.eclipse.wst.html.core.internal.modelhandler.EmbeddedHTML">
- </embeddedTypeHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.taskscanner">
- <scanner
- id="org.eclipse.wst.html.core.internal.tasks.HTMLFileTaskScanner"
- class="org.eclipse.wst.xml.core.internal.tasks.XMLFileTaskScanner"
- contentTypeIds="org.eclipse.wst.html.core.htmlsource" />
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.html.core.documentfactories"
- name="%Structured_HTML_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.wst.html.core.htmlsource"
- class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.commentElementHandler">
- <handler-custom
- commenttype="xml"
- class="org.eclipse.wst.html.core.internal.commentelement.handlers.CommentElementHandlerForSSI">
- <startwith prefix="#"></startwith>
- </handler-custom>
- </extension>
-
- <extension point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="html">
- </fileTypes>
- <fileTypes
- type="text"
- extension="htm">
- </fileTypes>
- <fileTypes
- type="text"
- extension="xhtml">
- </fileTypes>
- <fileTypes
- type="text"
- extension="htpl">
- </fileTypes>
- <fileTypes
- type="text"
- extension="wml">
- </fileTypes>
- <fileTypes
- type="text"
- extension="shtml">
- </fileTypes>
- <fileTypes
- type="text"
- extension="shtm">
- </fileTypes>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.formatProcessors">
- <processor
- class="org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl"
- contentTypeId="org.eclipse.wst.html.core.htmlsource">
- </processor>
- </extension>
-
- <!-- Extension point for taghelp documentation -->
- <extension point="org.eclipse.wst.xml.core.annotationFiles">
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.0 Strict//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.0 Transitional//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.0 Frameset//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML Basic 1.0//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//W3C//DTD XHTML 1.1//EN">
- </annotationFile>
- <annotationFile
- location="data/htmref.xml"
- publicId="-//WAPFORUM//DTD XHTML Mobile 1.0//EN">
- </annotationFile>
- </extension>
-
- <extension point="org.eclipse.core.runtime.contentTypes">
- <content-type
- file-extensions="html,htm,xhtml,htpl,wml,shtml,shtm"
- priority="high"
- name="%HTML_Content_Type_Extension_Element.name"
- id="htmlsource"
- base-type="org.eclipse.core.runtime.text">
- <!-- note: no default-charset for HTML, should use 'platform' -->
- <describer
- class="org.eclipse.wst.html.core.internal.contenttype.ContentDescriberForHTML" />
- </content-type>
- </extension>
-
-<!-- moved to where the dtd's are contributed
-
- <extension point="org.eclipse.wst.sse.core.documentTypes">
- <documentType
- elementName="html"
- displayName="XHTML 1.0 Strict"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.0 Strict//EN"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML 1.0 Transitional"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.0 Transitional//EN"
- defaultXHTML="true"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML 1.0 Frameset"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="true"
- publicID="-//W3C//DTD XHTML 1.0 Frameset//EN"
- systemID="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML Basic 1.0"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML Basic 1.0//EN"
- systemID="http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML 1.1"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//W3C//DTD XHTML 1.1//EN"
- systemID="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- </documentType>
- <documentType
- elementName="html"
- displayName="XHTML MP 1.0"
- namespaceURI="http://www.w3.org/1999/xhtml"
- isXHTML="true"
- hasFrameset="false"
- publicID="-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
- systemID="http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
- </documentType>
- <documentType
- elementName="wml"
- displayName="WML 1.3"
- namespaceURI=""
- isWML="true"
- hasFrameset="false"
- publicID="-//WAPFORUM//DTD WML 1.3//EN"
- defaultWML="true"
- systemID="http://www.wapforum.org/DTD/wml13.dtd">
- </documentType>
- </extension>
--->
- <!-- initialize html core preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceInitializer" />
- </extension>
-
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.java
deleted file mode 100644
index 7f612fb364..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLContentBuilder.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.wst.html.core.internal;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilderImpl;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class HTMLContentBuilder extends DOMContentBuilderImpl {
-
- private int fTagCase;
- private int fAttrCase;
-
- /**
- * DOMContentBuilder constructor comment.
- * @param document org.w3c.dom.Document
- */
- public HTMLContentBuilder(Document document) {
- super(document);
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
- fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- // Element caseSettings = HTMLPreferenceManager.getHTMLInstance().getElement(PreferenceNames.PREFERRED_CASE);
- // fTagCase = caseSettings.getAttribute(PreferenceNames.TAGNAME);
- // fAttrCase = caseSettings.getAttribute(PreferenceNames.ATTRIBUTENAME);
- }
-
- public String computeName(CMNode cmnode, Node parent) {
- String name = super.computeName(cmnode, parent);
- // don't change the case unless we're certain it is meaningless
- // if (cmnode instanceof HTMLCMNode && ((HTMLCMNode) cmnode).shouldIgnoreCase()) {
- if (shouldIgnoreCase(cmnode)) {
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- if (fTagCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fTagCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- if (fAttrCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fAttrCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- }
- return name;
-
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
deleted file mode 100644
index 931654c540..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCoreMessages.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by HTML Core
- *
- * @plannedfor 1.0
- */
-public class HTMLCoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.html.core.internal.HTMLCorePluginResources";//$NON-NLS-1$
-
- public static String No_error__UI_;
- public static String Undefined_attribute_name___ERROR_;
- public static String Undefined_attribute_value__ERROR_;
- public static String Multiple_values_specified__ERROR_;
- public static String Attribute_name___0___uses__ERROR_;
- public static String Invalid_attribute_name___0_ERROR_;
- public static String Invalid_attribute___0____ERROR_;
- public static String Invalid_location_of_tag____ERROR_;
- public static String Duplicate_tag___0____ERROR_;
- public static String No_start_tag____0_____ERROR_;
- public static String No_end_tag_____0_____ERROR_;
- public static String End_tag_____0____not_neede_ERROR_;
- public static String Unknown_tag___0____ERROR_;
- public static String Tag_name___0___uses_wrong__ERROR_;
- public static String Invalid_tag_name___0____ERROR_;
- public static String Invalid_JSP_directive___0__ERROR_;
- public static String Invalid_text_string___0____ERROR_;
- public static String Invalid_character_used_in__ERROR_;
- public static String Unknown_error__ERROR_;
- public static String Start_tag____0____not_clos_ERROR_;
- public static String End_tag_____0____not_close_ERROR_;
- public static String Attribute_value___0___uses_ERROR_;
- public static String Comment_not_closed__ERROR_;
- public static String DOCTYPE_declaration_not_cl_ERROR_;
- public static String Processing_instruction_not_ERROR_;
- public static String CDATA_section_not_closed__ERROR_;
- public static String _ERROR_Tag___0___should_be_an_empty_element_tag_1;
- public static String _ERROR_Attribute_value___0___not_closed__1;
- public static String HTMLContentPropertiesManager_Updating;
- public static String HTMLContentPropertiesManager_Problems_Updating;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, HTMLCoreMessages.class);
- }
-
- private HTMLCoreMessages() {
- // cannot create new instance
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
deleted file mode 100644
index 1299c4fbce..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePlugin.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentPropertiesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLCorePlugin extends Plugin {
- // The shared instance.
- private static HTMLCorePlugin plugin;
-
- /**
- * The constructor.
- */
- public HTMLCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static HTMLCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- // listen for resource changes to update content properties keys
- HTMLContentPropertiesManager.startup();
- }
-
- public void stop(BundleContext context) throws Exception {
- // stop listenning for resource changes to update content properties
- // keys
- HTMLContentPropertiesManager.shutdown();
-
- super.stop(context);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
deleted file mode 100644
index 3bc2fad69b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/HTMLCorePluginResources.properties
+++ /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
-###############################################################################
-No_error__UI_=No error.
-Undefined_attribute_name___ERROR_=Undefined attribute name ({0}).
-Undefined_attribute_value__ERROR_=Undefined attribute value ({0}).
-Multiple_values_specified__ERROR_=Multiple values specified for an attribute ({0}).
-Attribute_name___0___uses__ERROR_=Attribute name ({0}) uses wrong case character.
-Invalid_attribute_name___0_ERROR_=Invalid attribute name ({0}).
-Invalid_attribute___0____ERROR_=Invalid attribute ({0}).
-Invalid_location_of_tag____ERROR_=Invalid location of tag ({0}).
-Duplicate_tag___0____ERROR_=Duplicate tag ({0}).
-No_start_tag____0_____ERROR_=No start tag (<{0}>).
-No_end_tag_____0_____ERROR_=No end tag (</{0}>).
-End_tag_____0____not_neede_ERROR_=End tag (</{0}>) not needed.
-Unknown_tag___0____ERROR_=Unknown tag ({0}).
-Tag_name___0___uses_wrong__ERROR_=Tag name ({0}) uses wrong case character.
-Invalid_tag_name___0____ERROR_=Invalid tag name ({0}).
-Invalid_JSP_directive___0__ERROR_=Invalid JSP directive ({0}).
-Invalid_text_string___0____ERROR_=Invalid text string ({0}).
-Invalid_character_used_in__ERROR_=Invalid character used in text string ({0}).
-Unknown_error__ERROR_=Unknown error.
-Start_tag____0____not_clos_ERROR_=Start tag (<{0}>) not closed.
-End_tag_____0____not_close_ERROR_=End tag (</{0}>) not closed.
-Attribute_value___0___uses_ERROR_=Attribute value ({0}) uses wrong case character.
-Comment_not_closed__ERROR_=Comment not closed.
-DOCTYPE_declaration_not_cl_ERROR_=DOCTYPE declaration not closed.
-Processing_instruction_not_ERROR_=Processing instruction not closed.
-CDATA_section_not_closed__ERROR_=CDATA section not closed.
-# From here, the new messages are added for V5
-_ERROR_Tag___0___should_be_an_empty_element_tag_1=Tag ({0}) should be an empty-element tag.
-_ERROR_Attribute_value___0___not_closed__1=Attribute value ({0}) not closed.
-#
-HTMLContentPropertiesManager_Updating=Updating Web Content Settings
-HTMLContentPropertiesManager_Problems_Updating=Problem saving Web Content Settings for {0} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java
deleted file mode 100644
index f3ca08633f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/Logger.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal;
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if desired,
- * the console. This class should only be used by classes in this plugin. Other
- * plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.core"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- * @param level severity level of the message (OK, INFO, WARNING, ERROR, OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message text to add to the log
- * @param exception exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- * @param message text to print
- * @param category category of the message, to be compared with /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.java
deleted file mode 100644
index 37ff30a16f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/AbstractNodeCleanupHandler.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.core.internal.cleanup;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-abstract class AbstractNodeCleanupHandler implements IStructuredCleanupHandler {
-
- protected IStructuredCleanupPreferences fCleanupPreferences = null;
- protected IProgressMonitor fProgressMonitor = null;
-
- public void setCleanupPreferences(IStructuredCleanupPreferences cleanupPreferences) {
-
- fCleanupPreferences = cleanupPreferences;
- }
-
-
- public IStructuredCleanupPreferences getCleanupPreferences() {
- if (fCleanupPreferences == null) {
- fCleanupPreferences = new StructuredCleanupPreferences();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
- fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
- fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
- fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
- }
- }
-
- return fCleanupPreferences;
- }
-
-
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
-
- fProgressMonitor = progressMonitor;
- }
-
- static protected StructuredDocumentEvent replaceSource(IDOMModel model, Object requester, int offset, int length, String source) {
-
- StructuredDocumentEvent result = null;
- if (model == null)
- return result;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return result;
- if (source == null)
- source = new String();
- if (structuredDocument.containsReadOnly(offset, length))
- return result;
- if (requester == null) {
- requester = structuredDocument;
- }
- return structuredDocument.replaceText(requester, offset, length, source);
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
deleted file mode 100644
index ff8006ca84..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/CSSTextNodeCleanupHandler.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.cleanup;
-
-
-
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove
-
-public class CSSTextNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- public Node cleanup(Node node) {
- if (node == null)
- return node;
- IDOMModel model = ((IDOMNode) node).getModel();
- if (model == null)
- return node;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return node;
-
- String content = getCSSContent(node);
- if (content == null)
- return node;
-
- int offset = ((IDOMNode) node).getStartOffset();
- int length = ((IDOMNode) node).getEndOffset() - offset;
- replaceSource(model, this, offset, length, content);
- return (IDOMNode) model.getIndexedRegion(offset);
- }
-
- /**
- */
- private String getCSSContent(Node text) {
- ICSSModel model = getCSSModel(text);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
- if (adapter == null)
- return null;
- CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
- StringBuffer buffer = formatter.cleanup(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- /**
- */
- private ICSSModel getCSSModel(Node text) {
- if (text == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) text.getParentNode();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleSheetAdapter))
- return null;
- IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
- return styleAdapter.getModel();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
deleted file mode 100644
index 32d20db6ed..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java
+++ /dev/null
@@ -1,692 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.cleanup;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-public class ElementNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- /** Non-NLS strings */
- protected static final String START_TAG_OPEN = "<"; //$NON-NLS-1$
- protected static final String END_TAG_OPEN = "</"; //$NON-NLS-1$
- protected static final String TAG_CLOSE = ">"; //$NON-NLS-1$
- protected static final String EMPTY_TAG_CLOSE = "/>"; //$NON-NLS-1$
- protected static final String SINGLE_QUOTES = "''"; //$NON-NLS-1$
- protected static final String DOUBLE_QUOTES = "\"\""; //$NON-NLS-1$
- protected static final char SINGLE_QUOTE = '\''; //$NON-NLS-1$
- protected static final char DOUBLE_QUOTE = '\"'; //$NON-NLS-1$
-
- public Node cleanup(Node node) {
- IDOMNode renamedNode = (IDOMNode) cleanupChildren(node);
-
- // call quoteAttrValue() first so it will close any unclosed attr
- // quoteAttrValue() will return the new start tag if there is a
- // structure change
- renamedNode = quoteAttrValue(renamedNode);
-
- // insert tag close if missing
- // if node is not comment tag
- // and not implicit tag
- if (!((IDOMElement) renamedNode).isCommentTag() && (renamedNode.getStartStructuredDocumentRegion() != null)) {
- IDOMModel structuredModel = renamedNode.getModel();
-
- // save start offset before insertTagClose()
- // or else renamedNode.getStartOffset() will be zero if
- // renamedNode replaced by insertTagClose()
- int startTagStartOffset = renamedNode.getStartOffset();
-
- // for start tag
- IStructuredDocumentRegion startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
- insertTagClose(structuredModel, startTagStructuredDocumentRegion);
-
- // update renamedNode and startTagStructuredDocumentRegion after
- // insertTagClose()
- renamedNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset);
- startTagStructuredDocumentRegion = renamedNode.getStartStructuredDocumentRegion();
-
- // for end tag
- IStructuredDocumentRegion endTagStructuredDocumentRegion = renamedNode.getEndStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion != startTagStructuredDocumentRegion)
- insertTagClose(structuredModel, endTagStructuredDocumentRegion);
- }
-
- // call insertMissingTags() next, it will generate implicit tags if
- // there are any
- // insertMissingTags() will return the new missing start tag if one is
- // missing
- // applyTagNameCase() will return the renamed node.
- // The renamed/new node will be saved and returned to caller when all
- // cleanup is done.
- renamedNode = insertMissingTags(renamedNode);
- renamedNode = insertRequiredAttrs(renamedNode);
- renamedNode = applyTagNameCase(renamedNode);
- applyAttrNameCase(renamedNode);
- cleanupCSSAttrValue(renamedNode);
-
- return renamedNode;
- }
-
- /**
- * Checks if cleanup should modify case. Returns true case should be
- * preserved, false otherwise.
- *
- * @param element
- * @return true if element is case sensitive, false otherwise
- */
- private boolean shouldPreserveCase(IDOMElement element) {
- // case option can be applied to no namespace tags
- return !element.isGlobalTag();
- /*
- * ModelQueryAdapter mqadapter = (ModelQueryAdapter)
- * element.getAdapterFor(ModelQueryAdapter.class); ModelQuery mq =
- * null; CMNode nodedecl = null; if (mqadapter != null) mq =
- * mqadapter.getModelQuery(); if (mq != null) nodedecl =
- * mq.getCMNode(node); // if a Node isn't recognized as HTML or is and
- * cares about case, do not alter it // if (nodedecl == null ||
- * (nodedecl instanceof HTMLCMNode && ((HTMLCMNode)
- * nodedecl).shouldIgnoreCase())) if (!
- * nodedecl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)) return
- * false; return
- * ((Boolean)cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- */
- }
-
- /**
- * Checks if cleanup should force modifying element name to all lowercase.
- *
- * @param element
- * @return true if cleanup should lowercase element name, false otherwise
- */
- private boolean isXMLTag(IDOMElement element) {
- return element.isXMLTag();
- }
-
- protected void applyAttrNameCase(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return; // do nothing
-
- int attrNameCase = HTMLCorePreferenceNames.ASIS;
- if (!shouldPreserveCase(element)) {
- if (isXMLTag(element))
- attrNameCase = HTMLCorePreferenceNames.LOWER;
- else
- attrNameCase = getCleanupPreferences().getAttrNameCase();
- }
-
- NamedNodeMap attributes = node.getAttributes();
- int attributesLength = attributes.getLength();
-
- for (int i = 0; i < attributesLength; i++) {
- IDOMNode eachAttr = (IDOMNode) attributes.item(i);
- String oldAttrName = eachAttr.getNodeName();
- String newAttrName = oldAttrName;
- /*
- * 254961 - all HTML tag names and attribute names should be in
- * English even for HTML files in other languages like Japanese or
- * Turkish. English locale should be used to convert between
- * uppercase and lowercase (otherwise "link" would be converted to
- * Turkish "I Overdot Capital").
- */
- if (attrNameCase == HTMLCorePreferenceNames.LOWER)
- newAttrName = oldAttrName.toLowerCase(Locale.US);
- else if (attrNameCase == HTMLCorePreferenceNames.UPPER)
- newAttrName = oldAttrName.toUpperCase(Locale.US);
-
- if (newAttrName.compareTo(oldAttrName) != 0) {
- int attrNameStartOffset = eachAttr.getStartOffset();
- int attrNameLength = oldAttrName.length();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, attrNameStartOffset, attrNameLength, newAttrName);
- }
- }
- }
-
- protected IDOMNode applyTagNameCase(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- int tagNameCase = HTMLCorePreferenceNames.ASIS;
-
- if (!shouldPreserveCase(element)) {
- if (isXMLTag(element))
- tagNameCase = HTMLCorePreferenceNames.LOWER;
- else
- tagNameCase = getCleanupPreferences().getTagNameCase();
- }
-
- String oldTagName = node.getNodeName();
- String newTagName = oldTagName;
- IDOMNode newNode = node;
-
- /*
- * 254961 - all HTML tag names and attribute names should be in
- * English even for HTML files in other languages like Japanese or
- * Turkish. English locale should be used to convert between uppercase
- * and lowercase (otherwise "link" would be converted to Turkish "I
- * Overdot Capital").
- */
- if (tagNameCase == HTMLCorePreferenceNames.LOWER)
- newTagName = oldTagName.toLowerCase(Locale.US);
- else if (tagNameCase == HTMLCorePreferenceNames.UPPER)
- newTagName = oldTagName.toUpperCase(Locale.US);
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startTagStructuredDocumentRegion != null) {
- ITextRegionList regions = startTagStructuredDocumentRegion.getRegions();
- if (regions != null && regions.size() > 0) {
- ITextRegion startTagNameRegion = regions.get(1);
- int startTagNameStartOffset = startTagStructuredDocumentRegion.getStartOffset(startTagNameRegion);
- int startTagNameLength = startTagStructuredDocumentRegion.getTextEndOffset(startTagNameRegion) - startTagNameStartOffset;
-
- replaceSource(structuredModel, structuredDocument, startTagNameStartOffset, startTagNameLength, newTagName);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagNameStartOffset); // save
- // new
- // node
- }
- }
-
- IStructuredDocumentRegion endTagStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion != null) {
- ITextRegionList regions = endTagStructuredDocumentRegion.getRegions();
- if (regions != null && regions.size() > 0) {
- ITextRegion endTagNameRegion = regions.get(1);
- int endTagNameStartOffset = endTagStructuredDocumentRegion.getStartOffset(endTagNameRegion);
- int endTagNameLength = endTagStructuredDocumentRegion.getTextEndOffset(endTagNameRegion) - endTagNameStartOffset;
-
- if (startTagStructuredDocumentRegion != endTagStructuredDocumentRegion)
- replaceSource(structuredModel, structuredDocument, endTagNameStartOffset, endTagNameLength, newTagName);
- }
- }
-
- return newNode;
- }
-
- protected Node cleanupChildren(Node node) {
- Node parentNode = node;
-
- if (node != null) {
- Node childNode = node.getFirstChild();
- HTMLCleanupHandlerFactory factory = HTMLCleanupHandlerFactory.getInstance();
- while (childNode != null) {
- // cleanup this child node
- IStructuredCleanupHandler cleanupHandler = factory.createHandler(childNode, getCleanupPreferences());
- childNode = cleanupHandler.cleanup(childNode);
-
- // get new parent node
- parentNode = childNode.getParentNode();
-
- // get next child node
- childNode = childNode.getNextSibling();
- }
- }
-
- return parentNode;
- }
-
- /**
- */
- protected void cleanupCSSAttrValue(IDOMNode node) {
- if (node == null || node.getNodeType() != Node.ELEMENT_NODE)
- return;
- IDOMElement element = (IDOMElement) node;
- if (!element.isGlobalTag())
- return;
-
- Attr attr = element.getAttributeNode("style"); //$NON-NLS-1$
- if (attr == null)
- return;
- String value = getCSSValue(attr);
- if (value == null)
- return;
- String oldValue = ((IDOMNode) attr).getValueSource();
- if (oldValue != null && value.equals(oldValue))
- return;
- attr.setValue(value);
- }
-
- /**
- */
- private ICSSModel getCSSModel(Attr attr) {
- if (attr == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleDeclarationAdapter))
- return null;
- IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
- return styleAdapter.getModel();
- }
-
- /**
- */
- private String getCSSValue(Attr attr) {
- ICSSModel model = getCSSModel(attr);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
- if (adapter == null)
- return null;
- CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
- StringBuffer buffer = formatter.cleanup(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- private boolean isEmptyElement(IDOMElement element) {
- Document document = element.getOwnerDocument();
- if (document == null)
- // undefined tag, return default
- return false;
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null)
- // undefined tag, return default
- return false;
-
- CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
- if (decl == null)
- // undefined tag, return default
- return false;
-
- return (decl.getContentType() == CMElementDeclaration.EMPTY);
- }
-
- protected IDOMNode insertEndTag(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
-
- int startTagStartOffset = node.getStartOffset();
- IDOMModel structuredModel = node.getModel();
- IDOMNode newNode = null;
-
- if (element.isCommentTag()) {
- // do nothing
- }
- else if (isEmptyElement(element)) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- ITextRegionList regions = startStructuredDocumentRegion.getRegions();
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- replaceSource(structuredModel, structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), lastRegion.getLength(), EMPTY_TAG_CLOSE);
-
- if (regions.size() > 1) {
- ITextRegion regionBeforeTagClose = regions.get(regions.size() - 1 - 1);
-
- // insert a space separator before tag close if the previous
- // region does not have extra spaces
- if (regionBeforeTagClose.getTextLength() == regionBeforeTagClose.getLength())
- replaceSource(structuredModel, structuredDocument, startStructuredDocumentRegion.getStartOffset(lastRegion), 0, " "); //$NON-NLS-1$
- }
- }
- else {
- String tagName = node.getNodeName();
- String endTag = END_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
-
- IDOMNode lastChild = (IDOMNode) node.getLastChild();
- int endTagStartOffset = 0;
- if (lastChild != null)
- // if this node has children, insert the end tag after the
- // last child
- endTagStartOffset = lastChild.getEndOffset();
- else
- // if this node does not has children, insert the end tag
- // after the start tag
- endTagStartOffset = node.getEndOffset();
-
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, endTagStartOffset, 0, endTag);
- }
-
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
-
- return newNode;
- }
-
- protected IDOMNode insertMissingTags(IDOMNode node) {
- boolean insertMissingTags = getCleanupPreferences().getInsertMissingTags();
- IDOMNode newNode = node;
-
- if (insertMissingTags) {
- IStructuredDocumentRegion startTagStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startTagStructuredDocumentRegion == null) {
- // implicit start tag; generate tag for it
- newNode = insertStartTag(node);
- startTagStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
- }
-
- IStructuredDocumentRegion endTagStructuredDocumentRegion = newNode.getEndStructuredDocumentRegion();
-
- ITextRegionList regionList = startTagStructuredDocumentRegion.getRegions();
- if (startTagStructuredDocumentRegion != null && regionList != null && regionList.get(regionList.size() - 1).getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
-
- }
- else {
- if (startTagStructuredDocumentRegion == null) {
- // start tag missing
- if (isStartTagRequired(newNode))
- newNode = insertStartTag(newNode);
- }
- else if (endTagStructuredDocumentRegion == null) {
- // end tag missing
- if (isEndTagRequired(newNode))
- newNode = insertEndTag(newNode);
- }
- }
- }
-
- return newNode;
- }
-
- protected IDOMNode insertStartTag(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- IDOMNode newNode = null;
-
- String tagName = node.getNodeName();
- String startTag = START_TAG_OPEN.concat(tagName).concat(TAG_CLOSE);
- int startTagStartOffset = node.getStartOffset();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, startTagStartOffset, 0, startTag);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
-
- return newNode;
- }
-
- protected void insertTagClose(IDOMModel structuredModel, IStructuredDocumentRegion flatNode) {
- if ((flatNode != null) && (flatNode.getRegions() != null)) {
- ITextRegionList regionList = flatNode.getRegions();
- ITextRegion lastRegion = regionList.get(regionList.size() - 1);
- if (lastRegion != null) {
- String regionType = lastRegion.getType();
- if ((regionType != DOMRegionContext.XML_EMPTY_TAG_CLOSE) && (regionType != DOMRegionContext.XML_TAG_CLOSE)) {
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
-
- // insert ">" after lastRegion of flatNode
- // as in "<a</a>" if flatNode is for start tag, or in
- // "<a></a" if flatNode is for end tag
- replaceSource(structuredModel, structuredDocument, flatNode.getTextEndOffset(lastRegion), 0, ">"); //$NON-NLS-1$
- }
- }
- }
- }
-
- protected boolean isEndTagRequired(IDOMNode node) {
- if (node == null)
- return false;
- return node.isContainer();
- }
-
- /**
- * The end tags of HTML EMPTY content type, such as IMG, and HTML
- * undefined tags are parsed separately from the start tags. So inserting
- * the missing start tag is useless and even harmful.
- */
- protected boolean isStartTagRequired(IDOMNode node) {
- if (node == null)
- return false;
- return node.isContainer();
- }
-
- protected boolean isXMLType(IDOMModel structuredModel) {
- boolean result = false;
-
- if (structuredModel != null && structuredModel != null) {
- IDOMDocument document = structuredModel.getDocument();
-
- if (document != null)
- result = document.isXMLType();
- }
-
- return result;
- }
-
- protected IDOMNode quoteAttrValue(IDOMNode node) {
- IDOMElement element = (IDOMElement) node;
- if (element.isCommentTag())
- return node; // do nothing
-
- boolean quoteAttrValues = getCleanupPreferences().getQuoteAttrValues();
- IDOMNode newNode = node;
-
- if (quoteAttrValues) {
- NamedNodeMap attributes = newNode.getAttributes();
- int attributesLength = attributes.getLength();
- ISourceGenerator generator = node.getModel().getGenerator();
-
- for (int i = 0; i < attributesLength; i++) {
- attributes = newNode.getAttributes();
- attributesLength = attributes.getLength();
- IDOMAttr eachAttr = (IDOMAttr) attributes.item(i);
- // ITextRegion oldAttrValueRegion = eachAttr.getValueRegion();
- String oldAttrValue = eachAttr.getValueRegionText();
- if (oldAttrValue == null) {
- IDOMModel structuredModel = node.getModel();
- if (isXMLType(structuredModel)) {
- // TODO: Kit, please check. Is there any way to not
- // rely on getting regions from attributes?
- String newAttrValue = "=\"" + eachAttr.getNameRegionText() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
-
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, eachAttr.getNameRegionEndOffset(), 0, newAttrValue);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(node.getStartOffset()); // save
- // new
- // node
- }
- }
- else {
-
- char quote = StringUtils.isQuoted(oldAttrValue) ? oldAttrValue.charAt(0) : DOUBLE_QUOTE;
- String newAttrValue = generator.generateAttrValue(eachAttr, quote);
-
- // There is a problem in
- // StructuredDocumentRegionUtil.getAttrValue(ITextRegion)
- // when the region is instanceof ContextRegion.
- // Workaround for now...
- if (oldAttrValue.length() == 1) {
- char firstChar = oldAttrValue.charAt(0);
- if (firstChar == SINGLE_QUOTE)
- newAttrValue = SINGLE_QUOTES;
- else if (firstChar == DOUBLE_QUOTE)
- newAttrValue = DOUBLE_QUOTES;
- }
-
- if (newAttrValue != null) {
- if (newAttrValue.compareTo(oldAttrValue) != 0) {
- int attrValueStartOffset = eachAttr.getValueRegionStartOffset();
- int attrValueLength = oldAttrValue.length();
- int startTagStartOffset = node.getStartOffset();
-
- IDOMModel structuredModel = node.getModel();
- IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();
- replaceSource(structuredModel, structuredDocument, attrValueStartOffset, attrValueLength, newAttrValue);
- newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
- // new
- // node
- }
- }
- }
- }
- }
-
- return newNode;
- }
-
- private IDOMNode insertRequiredAttrs(IDOMNode node) {
- boolean insertRequiredAttrs = getCleanupPreferences().getInsertRequiredAttrs();
- IDOMNode newNode = node;
-
- if (insertRequiredAttrs) {
- List requiredAttrs = getRequiredAttrs(newNode);
- if (requiredAttrs.size() > 0) {
- NamedNodeMap currentAttrs = node.getAttributes();
- List insertAttrs = new ArrayList();
- if (currentAttrs.getLength() == 0)
- insertAttrs.addAll(requiredAttrs);
- else {
- for (int i = 0; i < requiredAttrs.size(); i++) {
- String requiredAttrName = ((CMAttributeDeclaration) requiredAttrs.get(i)).getAttrName();
- boolean found = false;
- for (int j = 0; j < currentAttrs.getLength(); j++) {
- String currentAttrName = currentAttrs.item(j).getNodeName();
- if (requiredAttrName.compareToIgnoreCase(currentAttrName) == 0) {
- found = true;
- break;
- }
- }
- if (!found)
- insertAttrs.add(requiredAttrs.get(i));
- }
- }
- if (insertAttrs.size() > 0) {
- IStructuredDocumentRegion startStructuredDocumentRegion = newNode.getStartStructuredDocumentRegion();
- int index = startStructuredDocumentRegion.getEndOffset();
- ITextRegion lastRegion = startStructuredDocumentRegion.getLastRegion();
- if (lastRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) {
- index--;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- else if (lastRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- index = index - 2;
- lastRegion = startStructuredDocumentRegion.getRegionAtCharacterOffset(index - 1);
- }
- MultiTextEdit multiTextEdit = new MultiTextEdit();
- try {
- for (int i = insertAttrs.size() - 1; i >= 0; i--) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) insertAttrs.get(i);
- String requiredAttributeName = attrDecl.getAttrName();
- String defaultValue = attrDecl.getDefaultValue();
- if (defaultValue == null)
- defaultValue = ""; //$NON-NLS-1$
- String nameAndDefaultValue = " "; //$NON-NLS-1$
- if (i == 0 && lastRegion.getLength() > lastRegion.getTextLength())
- nameAndDefaultValue = ""; //$NON-NLS-1$
- nameAndDefaultValue += requiredAttributeName + "=\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- multiTextEdit.addChild(new InsertEdit(index, nameAndDefaultValue));
- // BUG3381: MultiTextEdit applies all child
- // TextEdit's basing on offsets
- // in the document before the first TextEdit, not
- // after each
- // child TextEdit. Therefore, do not need to
- // advance the index.
- // index += nameAndDefaultValue.length();
- }
- multiTextEdit.apply(newNode.getStructuredDocument());
- }
- catch (BadLocationException e) {
- // log or now, unless we find reason not to
- Logger.log(Logger.INFO, e.getMessage());
- }
- }
- }
- }
-
- return newNode;
- }
-
-
- protected ModelQuery getModelQuery(Node node) {
- ModelQuery result = null;
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- result = ModelQueryUtil.getModelQuery((Document) node);
- }
- else {
- result = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- }
- return result;
- }
-
- protected List getRequiredAttrs(Node node) {
- List result = new ArrayList();
-
- ModelQuery modelQuery = getModelQuery(node);
- if (modelQuery != null) {
- CMElementDeclaration elementDecl = modelQuery.getCMElementDeclaration((Element) node);
- if (elementDecl != null) {
- CMNamedNodeMap attrMap = elementDecl.getAttributes();
- Iterator it = attrMap.iterator();
- CMAttributeDeclaration attr = null;
- while (it.hasNext()) {
- attr = (CMAttributeDeclaration) it.next();
- if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) {
- result.add(attr);
- }
- }
- }
- }
-
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java
deleted file mode 100644
index 21ea68fc3a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.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.wst.html.core.internal.cleanup;
-
-
-
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-class HTMLCleanupHandlerFactory {
-
-
-
- private static HTMLCleanupHandlerFactory fInstance = null;
-
- static synchronized HTMLCleanupHandlerFactory getInstance() {
- if (fInstance == null) {
- fInstance = new HTMLCleanupHandlerFactory();
- }
- return fInstance;
- }
-
- private HTMLCleanupHandlerFactory() {
- super();
- }
-
- IStructuredCleanupHandler createHandler(Node node, IStructuredCleanupPreferences cleanupPreferences) {
- short nodeType = node.getNodeType();
- IStructuredCleanupHandler handler = null;
- switch (nodeType) {
- case Node.ELEMENT_NODE : {
- if (isJSPTag(node))
- handler = new JSPElementNodeCleanupHandler();
- else
- handler = new ElementNodeCleanupHandler();
- break;
- }
- case Node.TEXT_NODE : {
- if (isParentStyleTag(node))
- handler = new CSSTextNodeCleanupHandler();
- else
- handler = new NodeCleanupHandler();
- break;
- }
- default : {
- handler = new NodeCleanupHandler();
- }
- }
-
- handler.setCleanupPreferences(cleanupPreferences);
-
- return handler;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on "nestedContext".
- */
-
- private boolean isJSPTag(Node node) {
-
- final String JSP_CLOSE = "JSP_CLOSE"; //$NON-NLS-1$
- // final String JSP_COMMENT_CLOSE = "JSP_COMMENT_CLOSE"; //$NON-NLS-1$
-
- // final String JSP_COMMENT_OPEN = "JSP_COMMENT_OPEN"; //$NON-NLS-1$
- // final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
-
- final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
- final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_CLOSE = "JSP_DIRECTIVE_CLOSE"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
-
- final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
- final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
-
- // final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
-
- final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
-
- boolean result = false;
-
- if (node instanceof IDOMNode) {
- IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
- // in some cases, the nodes exists, but hasn't been associated
- // with
- // a flatnode yet (the screen updates can be initiated on a
- // different thread,
- // so the request for a flatnode can come in before the node is
- // fully formed.
- // if the flatnode is null, we'll just allow the defaults to
- // apply.
- if (flatNode != null) {
- String flatNodeType = flatNode.getType();
- // should not be null, but just to be sure
- if (flatNodeType != null) {
- if ((flatNodeType.equals(JSP_CONTENT)) || (flatNodeType.equals(JSP_EXPRESSION_OPEN)) || (flatNodeType.equals(JSP_SCRIPTLET_OPEN)) || (flatNodeType.equals(JSP_DECLARATION_OPEN)) || (flatNodeType.equals(JSP_DIRECTIVE_CLOSE)) || (flatNodeType.equals(JSP_DIRECTIVE_NAME)) || (flatNodeType.equals(JSP_DIRECTIVE_OPEN)) || (flatNodeType.equals(JSP_CLOSE))) {
- result = true;
- }
- }
- }
- }
-
- return result;
- }
-
- private boolean isParentStyleTag(Node node) {
- if (node == null)
- return false;
- if (node.getNodeType() != Node.TEXT_NODE)
- return false;
- if (!(node instanceof IDOMNode))
- return false;
- IStructuredDocumentRegion flatNode = ((IDOMNode) node).getFirstStructuredDocumentRegion();
- if (flatNode == null)
- return false;
- if (flatNode.getType() != DOMRegionContext.BLOCK_TEXT)
- return false;
-
- // check if the parent is STYLE element
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
- String name = parent.getNodeName();
- if (name == null)
- return false;
- if (!name.equalsIgnoreCase("STYLE"))//$NON-NLS-1$
- return false;
- return true;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java
deleted file mode 100644
index 5b765c4f54..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupProcessorImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.sse.core.internal.cleanup.AbstractStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.cleanup.StructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.w3c.dom.Node;
-
-public class HTMLCleanupProcessorImpl extends AbstractStructuredCleanupProcessor {
- private IStructuredCleanupPreferences fCleanupPreferences = null;
-
- protected String getContentType() {
- return ContentTypeIdForHTML.ContentTypeID_HTML;
- }
-
- protected IStructuredCleanupHandler getCleanupHandler(Node node) {
- return HTMLCleanupHandlerFactory.getInstance().createHandler(node, getCleanupPreferences());
- }
-
- public IStructuredCleanupPreferences getCleanupPreferences() {
- if (fCleanupPreferences == null) {
- fCleanupPreferences = new StructuredCleanupPreferences();
-
- Preferences preferences = getModelPreferences();
- if (preferences != null) {
- fCleanupPreferences.setTagNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE));
- fCleanupPreferences.setAttrNameCase(preferences.getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE));
- fCleanupPreferences.setCompressEmptyElementTags(preferences.getBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS));
- fCleanupPreferences.setInsertRequiredAttrs(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCleanupPreferences.setInsertMissingTags(preferences.getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCleanupPreferences.setQuoteAttrValues(preferences.getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCleanupPreferences.setFormatSource(preferences.getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
- fCleanupPreferences.setConvertEOLCodes(preferences.getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
- fCleanupPreferences.setEOLCode(preferences.getString(HTMLCorePreferenceNames.CLEANUP_EOL_CODE));
- }
- }
-
- return fCleanupPreferences;
- }
-
- protected IStructuredFormatProcessor getFormatProcessor() {
- return new HTMLFormatProcessorImpl();
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected void refreshCleanupPreferences() {
- fCleanupPreferences = null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.java
deleted file mode 100644
index 4b0a78381d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/JSPElementNodeCleanupHandler.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.core.internal.cleanup;
-
-
-
-import org.w3c.dom.Node;
-
-public class JSPElementNodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- public Node cleanup(Node node) {
- return node;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.java
deleted file mode 100644
index 9bb6109690..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/NodeCleanupHandler.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.core.internal.cleanup;
-
-
-
-import org.w3c.dom.Node;
-
-public class NodeCleanupHandler extends AbstractNodeCleanupHandler {
-
- public Node cleanup(Node node) {
- return node;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.java
deleted file mode 100644
index ac88325fc0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/commentelement/handlers/CommentElementHandlerForSSI.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.wst.html.core.internal.commentelement.handlers;
-
-
-
-import org.eclipse.wst.xml.core.internal.commentelement.CommentElementHandler;
-import org.eclipse.wst.xml.core.internal.commentelement.util.CommentElementFactory;
-import org.eclipse.wst.xml.core.internal.commentelement.util.TagScanner;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.ISourceGenerator;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class CommentElementHandlerForSSI implements CommentElementHandler {
-
- public Element createElement(Document document, String data, boolean isJSPTag) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null) {
- return null;
- }
- CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
- if (cm == null) {
- return null;
- }
- CMNamedNodeMap map = cm.getElements();
- if (map == null) {
- return null;
- }
-
- TagScanner scanner = new TagScanner(data, 1);
- String name = scanner.nextName();
- if (name == null) {
- return null;
- }
- StringBuffer buffer = new StringBuffer(name.length() + 4);
- buffer.append(SSI_PREFIX);
- buffer.append(':');
- buffer.append(name);
- String tagName = buffer.toString();
- // check if valid (defined) SSI tag or not
- if (map.getNamedItem(tagName) == null) {
- return null;
- }
-
- CommentElementFactory factory = new CommentElementFactory(document, isJSPTag, this);
- Element element = factory.create(tagName, CommentElementFactory.IS_START);
-
- // set attributes
- String attrName = scanner.nextName();
- while (attrName != null) {
- String attrValue = scanner.nextValue();
- Attr attr = document.createAttribute(attrName);
- if (attr != null) {
- if (attrValue != null)
- attr.setValue(attrValue);
- element.setAttributeNode(attr);
- }
- attrName = scanner.nextName();
- }
- return element;
- }
-
- public String generateStartTagContent(IDOMElement element) {
- ISourceGenerator generator = element.getModel().getGenerator();
- StringBuffer buffer = new StringBuffer();
-
- buffer.append('#');
- buffer.append(element.getLocalName());
-
- NamedNodeMap attributes = element.getAttributes();
- int length = attributes.getLength();
- for (int i = 0; i < length; i++) {
- Attr attr = (Attr) attributes.item(i);
- if (attr == null) {
- continue;
- }
- buffer.append(' ');
- String attrName = generator.generateAttrName(attr);
- if (attrName != null) {
- buffer.append(attrName);
- }
- String attrValue = generator.generateAttrValue(attr);
- if (attrValue != null) {
- // attr name only for HTML boolean and JSP
- buffer.append('=');
- buffer.append(attrValue);
- }
- }
-
- return buffer.toString();
- }
-
- public String generateEndTagContent(IDOMElement element) {
- return null; // always empty
- }
-
- public boolean isEmpty() {
- return true;
- }
-
- public boolean isCommentElement(IDOMElement element) {
- if (element == null) {
- return false;
- }
- Document document = element.getOwnerDocument();
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null) {
- return false;
- }
- CMDocument cm = modelQuery.getCorrespondingCMDocument(document);
- if (cm == null) {
- return false;
- }
- CMNamedNodeMap map = cm.getElements();
- if (map == null) {
- return false;
- }
- String prefix = element.getPrefix();
- if (prefix == null || !prefix.equals(SSI_PREFIX)) {
- return false;
- }
- String tagName = element.getTagName();
- if (tagName.length() <= 4) {
- return false;
- }
- if (map.getNamedItem(tagName) == null) {
- return false;
- }
- else {
- return true;
- }
- }
-
- private static final String SSI_PREFIX = "ssi";//$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
deleted file mode 100644
index f4e63408bc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ /dev/null
@@ -1,1285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for attribute declarations.
- */
-final class AttributeCollection extends CMNamedNodeMapImpl implements HTML40Namespace {
-
- /** bodycolors. */
- private static final String[] BODYCOLORS = {ATTR_NAME_BGCOLOR, ATTR_NAME_TEXT, ATTR_NAME_LINK, ATTR_NAME_VLINK, HTML40Namespace.ATTR_NAME_ALINK};
- /** coreattrs. */
- private static final String[] CORE = {ATTR_NAME_ID, ATTR_NAME_CLASS, ATTR_NAME_STYLE, ATTR_NAME_TITLE};
- /** events. */
- private static final String[] EVENTS = {ATTR_NAME_ONCLICK, ATTR_NAME_ONDBLCLICK, ATTR_NAME_ONMOUSEDOWN, ATTR_NAME_ONMOUSEUP, ATTR_NAME_ONMOUSEOVER, ATTR_NAME_ONMOUSEMOVE, ATTR_NAME_ONMOUSEOUT, ATTR_NAME_ONKEYPRESS, ATTR_NAME_ONKEYDOWN, ATTR_NAME_ONKEYUP, ATTR_NAME_ONHELP};
- /** i18n. lang, dir */
- private static final String[] I18N = {ATTR_NAME_LANG, ATTR_NAME_DIR};
- /** cellhaligh. */
- private static final String[] CELLHALIGN = {ATTR_NAME_CHAR, ATTR_NAME_CHAROFF};
-
- /**
- * constructor.
- */
- public AttributeCollection() {
- super();
- }
-
- /**
- * Create an attribute declaration.
- *
- * @param attrName
- * java.lang.String
- */
- private HTMLAttrDeclImpl create(String attrName) {
- HTMLAttrDeclImpl attr = null;
- HTMLCMDataTypeImpl atype = null;
-
- if (attrName.equalsIgnoreCase(ATTR_NAME_ABBR)) {
- // (abbr %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ABBR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCEPT)) {
- // (accept %ContentTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCEPT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCEPT_CHARSET)) {
- // (accept-charset %Charsets;; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSETS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCEPT_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACTION)) {
- // (action %URI #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACTION, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ARCHIVE)) {
- // (archive CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ARCHIVE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ACCESSKEY)) {
- // (accesskey %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACCESSKEY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ALINK)) {
- // (alink %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALINK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ALT)) {
- // (alt %Text; #REQUIRED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOSTART)) {
- // (autostart (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOSTART, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOPLAY)) {
- // (autoplay (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOPLAY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AUTOSIZE)) {
- // (autosize (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AUTOSIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_AXIS)) {
- // (axis CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_AXIS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BACKGROUND)) {
- // (background %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BACKGROUND, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BEHAVIOR)) {
- // (behavior (scroll|slide|alternate) scroll)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_SCROLL, ATTR_VALUE_SLIDE, ATTR_VALUE_ALTERNATE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_SCROLL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BEHAVIOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BGCOLOR)) {
- // (bgcolor %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BGCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDER)) {
- // (border %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CELLSPACING)) {
- // (cellspacing %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLSPACING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CELLPADDING)) {
- // (cellpadding %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CELLPADDING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CGI)) {
- // (cgi %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CGI, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHAR)) {
- // (char %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHAROFF)) {
- // (charoff %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHAROFF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHARSET)) {
- // (charset %Charset; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARSET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHARSET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CITE)) {
- // (cite %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CITE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLASS)) {
- // (class CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLASS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLASSID)) {
- // (classid %URI #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLASSID, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CMD)) {
- // (cmd CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CMD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHECKED)) {
- // (checked (checked) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_CHECKED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLEAR)) {
- // (clear (left | all | right | none) none)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_ALL, ATTR_VALUE_RIGHT, ATTR_VALUE_NONE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
-
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLEAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CODE)) {
- // (code CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CODE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CODEBASE)) {
- // (codebase %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CODEBASE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CODETYPE)) {
- // (codetype %CotentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CODETYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLOR)) {
- // (color %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COMPACT)) {
- // (compact (compact) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_COMPACT};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COMPACT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLS)) {
- // (cols NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLSPAN)) {
- // (colspan NUMBER 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLSPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTENT)) {
- // (content CDATA #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CONTROLLER)) {
- // (controller (true|false) true)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_TRUE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CONTROLLER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COORDS)) {
- // (coords %Coords; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COORDS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COORDS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DATA)) {
- // (data %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATA, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DATETIME)) {
- // (datetime %Datetime; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.DATETIME);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATETIME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DATAPAGESIZE)) {
- // (datapagesize CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DATAPAGESIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DECLARE)) {
- // (declare (declare) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_DECLARE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DECLARE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DEFER)) {
- // (defer (defer) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_DEFER};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DEFER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DIR)) {
- // (dir (ltr|rtl) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LTR, ATTR_VALUE_RTL};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DIRECTION)) {
- // (direction (left|right|up|down) left)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT, ATTR_VALUE_UP, ATTR_VALUE_DOWN};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTION, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DIRECTKEY)) {
- // (directkey %Character; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CHARACTER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DIRECTKEY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_DISABLED)) {
- // (disabled (disabled) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // boolean attribute must have the same value as its name.
- String[] values = {ATTR_NAME_DISABLED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_DISABLED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ENCTYPE)) {
- // (enctype %ContentType; "application/x-www-form-urlencoded")
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ERRMSG)) {
- // (errmsg CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ERRMSG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_EVENT)) {
- // (event CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_EVENT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FACE)) {
- // (face CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FILE)) {
- // (file %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FILE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FOR)) {
- // (for %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAME)) {
- // (frame %TFrame; #IMPLIED)
- // %TFrame; is
- // (void|above|below|hsides|lhs|rhs|vsides|box|border).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_VOID, ATTR_VALUE_ABOVE, ATTR_VALUE_BELOW, ATTR_VALUE_HSIDES, ATTR_VALUE_LHS, ATTR_VALUE_RHS, ATTR_VALUE_VSIDES, ATTR_VALUE_BOX, ATTR_VALUE_BORDER};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMEBORDER)) {
- // (frameborder (1|0) 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_1, ATTR_VALUE_0};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
- // <<D215684
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAMESPACING)) {
- // (framespacing CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMESPACING, atype, CMAttributeDeclaration.OPTIONAL);
- // D215684
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HEADERS)) {
- // (HEADERS IDREFS; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.IDREFS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEADERS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HEIGHT)) {
- // (height %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HIDDEN)) {
- // (hidden CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HIDDEN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HREF)) {
- // (href %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HREF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HREFLANG)) {
- // (hreflang %LanguageCode; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LANGUAGE_CODE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HREFLANG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HSPACE)) {
- // (hspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HTTP_EQUIV)) {
- // (http-equiv NAME #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HTTP_EQUIV, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ID)) {
- // (id ID #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ID);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ID, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ISMAP)) {
- // (ismap (ismap) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_ISMAP};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ISMAP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ISTYLE)) {
- // (istyle CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ISTYLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LABEL)) {
- // (label %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LABEL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LANG)) {
- // (lang %LanguageCode; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LANGUAGE_CODE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LANG, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LANGUAGE)) {
- // (language %CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LANGUAGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LINK)) {
- // (link %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LINK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LONGDESC)) {
- // (longdesc %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LONGDESC, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LOOP)) {
- // (loop CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MACRO)) {
- // (macro CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MACRO, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAPFILE)) {
- // (mapfile %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAPFILE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MARGINWIDTH)) {
- // (marginwidth %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINWIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MARGINHEIGHT)) {
- // (marginheight %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MARGINHEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAXLENGTH)) {
- // (maxlength NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAYSCRIPT)) {
- // (mayscript (mayscript) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_MAYSCRIPT};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAYSCRIPT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MEDIA)) {
- // (media %MediaDesc; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MEDIA_DESC);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MEDIA, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_METHOD)) {
- // (method (GET|POST) GET)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_GET, ATTR_VALUE_POST};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_METHOD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MULTIPLE)) {
- // (multiple (multiple) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_MULTIPLE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NAME)) {
- // (name CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOHREF)) {
- // (nohref (nohref) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOHREF};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOHREF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NORESIZE)) {
- // (noresize (noresize) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NORESIZE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NORESIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOSHADE)) {
- // (noshade (noshade) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOSHADE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOSHADE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOWRAP)) {
- // (nowrap (nowrap) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOWRAP};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOWRAP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_OBJECT)) {
- // (object CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_OBJECT};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_OBJECT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONBLUR)) {
- // (onblur %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONBLUR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCLICK)) {
- // (onclick %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCLICK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONCHANGE)) {
- // (onchange %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONCHANGE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONDBLCLICK)) {
- // (ondblclick %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONDBLCLICK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
- // (onfocus %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONHELP)) {
- // (onhelp %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONHELP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYPRESS)) {
- // (onkeypress %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYPRESS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYDOWN)) {
- // (onkeydown %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYDOWN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONKEYUP)) {
- // (onkyeup %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONKEYUP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONLOAD)) {
- // (onload %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONLOAD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEDOWN)) {
- // (onmousedown %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEDOWN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEUP)) {
- // (onmouseup %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEUP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEOVER)) {
- // (onmouseover %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEOVER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEMOVE)) {
- // (onmousemove %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEMOVE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONMOUSEOUT)) {
- // (onmouseout %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONMOUSEOUT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONRESET)) {
- // (onreset %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONRESET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSELECT)) {
- // (onselect %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSELECT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONSUBMIT)) {
- // (onsubmit %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONSUBMIT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ONUNLOAD)) {
- // (onunload %Script; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ONUNLOAD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PALETTE)) {
- // (palette CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PALETTE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PANEL)) {
- // (panel CDATA; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PANEL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PLAYCOUNT)) {
- // (playcount NUMBER; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PLAYCOUNT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PROFILE)) {
- // (profile %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PROFILE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_PROMPT)) {
- // (prompt %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_PROMPT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_READONLY)) {
- // (readonly (readonly) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_READONLY};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_READONLY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_REPEAT)) {
- // (repeat CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REPEAT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_REL)) {
- // (rel %LinkTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_REV)) {
- // (rev %LinkTypes; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LINK_TYPES);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_REV, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWS)) {
- // (rows NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWSPAN)) {
- // (rowspan NUMBER 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWSPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_RULES)) {
- // (rules %TRules; #IMPLIED)
- // %TRules; is (none | groups | rows | cols | all).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_NONE, ATTR_VALUE_GROUPS, ATTR_VALUE_ROWS, ATTR_VALUE_COLS, ATTR_VALUE_ALL};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_RULES, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCALE)) {
- // (scale CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCALE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCHEME)) {
- // (scheme CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCHEME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SELECTED)) {
- // (selected (selected) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_SELECTED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SELECTED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCOPE)) {
- // (SCOPE %Scope; #IMPLIED)
- // %Scope; is (row|col|rowgroup|colgroup)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_ROW, ATTR_VALUE_COL, ATTR_VALUE_ROWGROUP, ATTR_VALUE_COLGROUP};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCOPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLAMOUNT)) {
- // (scrollamount NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLAMOUNT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLDELAY)) {
- // (scrolldelay NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLDELAY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SCROLLING)) {
- // (scrolling (yes|no|auto) auto)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_YES, ATTR_VALUE_NO, ATTR_VALUE_AUTO};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_AUTO);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SCROLLING, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SHAPE)) {
- // (shape %Shape; rect): %Shape; is (rect|circle|poly|default).
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_RECT, ATTR_VALUE_CIRCLE, ATTR_VALUE_POLY, ATTR_VALUE_DEFAULT};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_RECT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SHAPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SHOWCONTROLS)) {
- // (showcontrols (true|false) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SHOWCONTROLS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZE)) {
- // (size %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZEFMT)) {
- // (sizefmt CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZEFMT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SPAN)) {
- // (span NUMBER 1)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SPAN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
- // (src %URI; #IMPLIED)
- // NOTE: "src" attributes are defined in several elements.
- // The definition of IMG is different from others.
- // So, it should be locally defined.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_START)) {
- // (start NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_START, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_STANDBY)) {
- // (standby %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_STANDBY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_STYLE)) {
- // (style %StyleSheet; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.STYLE_SHEET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_STYLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SUMMARY)) {
- // (summary %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SUMMARY, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TABINDEX)) {
- // (tabindex NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TABINDEX, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TARGET)) {
- // (target %FrameTarget; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.FRAME_TARGET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TARGET, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXT)) {
- // (text %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXTFOCUS)) {
- // (textfocus CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXTFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TITLE)) {
- // (title %Text; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TITLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TIMEFMT)) {
- // (timefmt CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TIMEFMT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TRUESPEED)) {
- // (truespeed (truespeed) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_TRUESPEED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TRUESPEED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TYPE)) {
- // (type %CotentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_USEMAP)) {
- // (usemap %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_USEMAP, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALIGN)) {
- // (valign (top|middle|bottom|baseline) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_BASELINE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALIGN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUE)) {
- // (value CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUETYPE)) {
- // (valuetype (DATA|REF|OBJECT) DATA)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_DATA, ATTR_VALUE_REF, ATTR_VALUE_OBJECT};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_DATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUETYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VAR)) {
- // (var CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VERSION)) {
- // (version CDATA #FIXED '%HTML.Version;)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VIRTUAL)) {
- // (virtual %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VIRTUAL, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VLINK)) {
- // (vlink %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VLINK, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VOLUME)) {
- // (volume CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VOLUME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_WIDTH)) {
- // (width %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VSPACE)) {
- // (vspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- // <<D205514
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TOPMARGIN)) {
- // (topmargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TOPMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BOTTOMMARGIN)) {
- // (bottommargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BOTTOMMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_LEFTMARGIN)) {
- // (leftmargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_LEFTMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_RIGHTMARGIN)) {
- // (rightmargin, CDATA, #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_RIGHTMARGIN, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDERCOLOR)) {
- // (bordercolor, %Color; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDERCOLOR, atype, CMAttributeDeclaration.OPTIONAL);
- // D205514
-
- }
- else {
- // unknown attribute; maybe error.
- // should warn.
- attr = null;
- }
-
- return attr;
- }
-
- /**
- * Get align attribute which has %CAlign; as values.. At this time
- * (4/19/2001), it is identical to %LAlign;.
- *
- */
- public static final HTMLAttrDeclImpl createAlignForCaption() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get align attribute which has %IAlign; as values..
- */
- public static final HTMLAttrDeclImpl createAlignForImage() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get align attribute which has %LAlign; as values..
- */
- public static final HTMLAttrDeclImpl createAlignForLegend() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Create an attribute declaration for <code>align</code> in several
- * elements, like <code>P</code>, <code>DIV</code>. The values are
- * different from attributes those have the same name in other elements (<code>IMG</code>
- * and <code>TABLE</code>). So, it can't treat as global attributes.
- * <strong>NOTE: These attribute declaration has no owner CMDocument
- * instance.</strong>
- */
- public static final HTMLAttrDeclImpl createAlignForParagraph() {
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values: left|center|right|justify
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT, ATTR_VALUE_JUSTIFY};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get %attrs; declarations. %attrs; consists of %coreattrs;, %i18n, and
- * %events;.
- */
- public void getAttrs(CMNamedNodeMapImpl declarations) {
- // %coreattrs;
- Iterator names = Arrays.asList(CORE).iterator();
- getDeclarations(declarations, names);
- // %i18n;
- names = Arrays.asList(I18N).iterator();
- getDeclarations(declarations, names);
- // %events;
- names = Arrays.asList(EVENTS).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %bodycolors; declarations.
- */
- public void getBodycolors(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(BODYCOLORS).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %cellhalign; declarations. %cellhaligh; consists of: - (align
- * (left|center|right|justify|char) #IMPLIED) - (char %Character;
- * #IMPLIED) - (charoff %Length; #IMPLIED)
- */
- public void getCellhalign(CMNamedNodeMapImpl declarations) {
- // (align (left|center|right|justify|char) #IMPLIED) should be defined
- // locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT, ATTR_VALUE_JUSTIFY, ATTR_VALUE_CHAR};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- declarations.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- Iterator names = Arrays.asList(CELLHALIGN).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %cellvalign; declarations. %cellhaligh; is: - (valign
- * (top|middle|bottom|baseline) #IMPLIED)
- */
- public void getCellvalign(CMNamedNodeMapImpl declarations) {
- HTMLAttributeDeclaration dec = getDeclaration(HTML40Namespace.ATTR_NAME_VALIGN);
- if (dec != null)
- declarations.putNamedItem(HTML40Namespace.ATTR_NAME_VALIGN, dec);
- }
-
- /**
- * Get %coreattrs; declarations.
- */
- public void getCore(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(CORE).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get a global attribute declaration.
- *
- * @param attrName
- * java.lang.String
- */
- public HTMLAttributeDeclaration getDeclaration(String attrName) {
- CMNode cmnode = getNamedItem(attrName);
- if (cmnode != null)
- return (HTMLAttributeDeclaration) cmnode; // already exists.
-
- HTMLAttrDeclImpl dec = create(attrName);
- if (dec != null)
- putNamedItem(attrName, dec);
-
- return dec;
- }
-
- /**
- * Get declarations which are specified by names.
- *
- * @param names
- * java.util.Iterator
- */
- public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
- while (names.hasNext()) {
- String attrName = (String) names.next();
- HTMLAttributeDeclaration dec = getDeclaration(attrName);
- if (dec != null)
- declarations.putNamedItem(attrName, dec);
- }
- }
-
- /**
- * Get %events; declarations.
- */
- public void getEvents(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(EVENTS).iterator();
- getDeclarations(declarations, names);
- }
-
- /**
- * Get %i18n; declarations.
- */
- public void getI18n(CMNamedNodeMapImpl declarations) {
- Iterator names = Arrays.asList(I18N).iterator();
- getDeclarations(declarations, names);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.java
deleted file mode 100644
index dac7c81524..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMContentImpl.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.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-
-
-
-/**
- * Implementation of CMContent for HTML CM.
- */
-abstract class CMContentImpl extends CMNodeImpl implements CMContent {
-
- public static final int UNBOUNDED = -1;
- /** -1: it's UNBOUNDED. */
- private int maxOccur = UNBOUNDED;
- /** 0: it's OPTIONAL, 1, it's REQUIRED. */
- private int minOccur = 0;
-
- /**
- * The primary consturctor.
- * Use this one for usual cases.<br>
- */
- public CMContentImpl(String name, int min, int max) {
- super(name);
- minOccur = min;
- maxOccur = max;
- }
-
- /**
- * 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;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.java
deleted file mode 100644
index a8ab34c9c1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMGroupImpl.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- */
-class CMGroupImpl extends CMContentImpl implements CMGroup {
-
- private int operator = CMGroup.SEQUENCE;
- private CMNodeListImpl children = null;
-
- /**
- * CMGroupImpl constructor comment.
- */
- public CMGroupImpl(int op, int minOccur, int maxOccur) {
- super(null, minOccur, maxOccur);
- switch (op) {
- case CMGroup.ALL :
- case CMGroup.CHOICE :
- case CMGroup.SEQUENCE :
- operator = op;
- break;
- default :
- // should warn.
- break;
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendChild(CMNode child) {
- if (child == null)
- return null;
- if (children == null)
- children = new CMNodeListImpl();
- return children.appendNode(child);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList
- */
- public CMNodeList getChildNodes() {
- return children;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.GROUP;
- }
-
- /**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
- public int getOperator() {
- return operator;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.java
deleted file mode 100644
index 91f34f2f33..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamedNodeMapImpl.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.core.internal.contentmodel;
-
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * An implementation of the CMNamedNodeMap interface. This class is intented
- * to be used as a container of attribute declarations. If someone wants to
- * use this class for other purpose, he must pay attention to the fact that
- * this class is tolerant of the key name case. That is, this class does not
- * distinguish "name", "NAME", and "Name" as a key name.
- */
-class CMNamedNodeMapImpl implements CMNamedNodeMap {
-
- private Hashtable items = null;
-
- /**
- */
- public CMNamedNodeMapImpl() {
- super();
- items = new Hashtable();
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- return items.size();
- }
-
- /**
- * getNamedItem method
- *
- * @return CMNode <code>null</code> for unknown keys.
- * @param name
- * java.lang.String
- */
- public CMNode getNamedItem(String name) {
- String cookedName = makeCanonicalForm(name);
- if (!items.containsKey(cookedName))
- return null;
- return (CMNode) items.get(cookedName);
- }
-
- /**
- * item method
- *
- * @return CMNode
- * @param index
- * int
- */
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- CMNode node = (CMNode) iter.next();
- if (--index < 0)
- return node;
- }
- return null;
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator iterator() {
- return items.values().iterator();
- }
-
- /**
- * @return java.lang.String
- * @param rawForm
- * java.lang.String
- */
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
-
- /**
- * @param key
- * java.lang.String
- * @param item
- * java.lang.String
- */
- void putNamedItem(String name, CMNode item) {
- String cookedName = makeCanonicalForm(name);
- if (items.containsKey(cookedName))
- return; // already registered.
- items.put(cookedName, item);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.java
deleted file mode 100644
index 20f4c283a7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNamespaceImpl.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMNamespace implementation.
- */
-class CMNamespaceImpl extends CMNodeImpl implements CMNamespace {
-
- private java.lang.String prefix = null;
-
- /**
- * CMNamespaceImpl constructor comment.
- */
- public CMNamespaceImpl(String uri, String pfx) {
- super(uri);
- prefix = pfx;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- *
- */
- public int getNodeType() {
- return CMNode.NAME_SPACE;
- }
-
- /**
- * getPrefix method
- * @return java.lang.String
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * getURI method
- * @return java.lang.String
- */
- public String getURI() {
- return getNodeName();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java
deleted file mode 100644
index 263d75a6c6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeImpl.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-abstract class CMNodeImpl implements CMNode {
-
- private java.lang.String name = null;
-
- /**
- * CMNodeImpl constructor comment.
- */
- public CMNodeImpl(String nm) {
- super();
- name = nm;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return name;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return new Boolean(false);
- return null;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return true;
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java
deleted file mode 100644
index ddcdb1c054..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CMNodeListImpl.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- * Analog of dom.NodeList for CM.
- * So, the implementation is very similar to
- * NodeListImpl<br>
- */
-class CMNodeListImpl implements CMNodeList {
-
- private java.util.Vector nodes = null;
-
- /**
- * CMNodeListImpl constructor comment.
- */
- public CMNodeListImpl() {
- super();
- nodes = new java.util.Vector();
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param node org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendNode(CMNode node) {
- nodes.addElement(node);
- return 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.elementAt(index);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.java
deleted file mode 100644
index 0ab6652beb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinition.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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * This class is intended to represent a complex type definition
- * in XML Schema.<br>
- */
-abstract class ComplexTypeDefinition {
-
- protected CMGroupImpl content = null;
- protected ElementCollection collection = null;
- protected String primaryCandidateName = null;
-
- /**
- * ComplexTypeDefinition constructor comment.
- */
- public ComplexTypeDefinition(ElementCollection elementCollection) {
- super();
- collection = elementCollection;
- createContent();
- }
-
- /**
- * Create an actual content model.
- * This method should be called once and only once in the constructor.<br>
- */
- protected abstract void createContent();
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMGroup
- */
- public CMGroup getContent() {
- return content;
- }
-
- /**
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- /* NOTE: Do we need LOGICAL type?
- * -- 3/7/2001
- */
- public abstract int getContentType();
-
- /**
- * Get content hint.
- */
- public HTMLElementDeclaration getPrimaryCandidate() {
- if (primaryCandidateName == null)
- return null;
- return (HTMLElementDeclaration) collection.getNamedItem(primaryCandidateName);
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public abstract String getTypeName();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
deleted file mode 100644
index 60fdef1465..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ComplexTypeDefinitionFactory.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * Factory of ComplexTypeDefinition.
- */
-final class ComplexTypeDefinitionFactory {
-
- private static ComplexTypeDefinitionFactory instance = null;
- private java.util.Hashtable definitions = null;
- // constants for complex type name
- /** for ADDRESS. */
- public final static String CTYPE_ADDRESS = "CTYPE_ADDRESS";//$NON-NLS-1$
- /** CDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_CDATA = "CTYPE_CDATA";//$NON-NLS-1$
- /** col group content. COL* */
- public final static String CTYPE_COLUMN_GROUP = "CTYPE_COLUMN_GROUP";//$NON-NLS-1$
- /** for DL. */
- public final static String CTYPE_DEFINITION_LIST = "CTYPE_DEFINITION_LIST";//$NON-NLS-1$
- /** for EMBED. */
- public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
- /** empty content. No ComplexTypeDefinition instance should be created. */
- public final static String CTYPE_EMPTY = "CTYPE_EMPTY";//$NON-NLS-1$
- /** for FIELDSET. */
- public final static String CTYPE_FIELDSET = "CTYPE_FIELDSET";//$NON-NLS-1$
- /** for FRAMESET. */
- public final static String CTYPE_FRAMESET = "CTYPE_FRAMESET";//$NON-NLS-1$
- /** flow content. (%flow;)* */
- public final static String CTYPE_FLOW_CONTAINER = "CTYPE_FLOW_CONTAINER";//$NON-NLS-1$
- /** html content. HEAD, (FRAMESET|BODY) */
- public final static String CTYPE_HTML = "CTYPE_HTML";//$NON-NLS-1$
- /** head content. TITLE & ISINDEX? & BASE? */
- public final static String CTYPE_HEAD = "CTYPE_HEAD";//$NON-NLS-1$
- /** inline content. (%inline;)* */
- public final static String CTYPE_INLINE_CONTAINER = "CTYPE_INLINE_CONTAINER";//$NON-NLS-1$
- /** list item container. (LI)+ */
- public final static String CTYPE_LI_CONTAINER = "CTYPE_LI_CONTAINER";//$NON-NLS-1$
- /** for MAP. */
- public final static String CTYPE_MAP = "CTYPE_MAP";//$NON-NLS-1$
- /** noframes content. */
- public final static String CTYPE_NOFRAMES_CONTENT = "CTYPE_NOFRAMES_CONTENT";//$NON-NLS-1$
- /** for OPTGROUP. */
- public final static String CTYPE_OPTION_CONTAINER = "CTYPE_OPTION_CONTAINER";//$NON-NLS-1$
- /** param container. For OBJECT/APPLET. */
- public final static String CTYPE_PARAM_CONTAINER = "CTYPE_PARAM_CONTAINER";//$NON-NLS-1$
- /** PCDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_PCDATA = "CTYPE_PCDATA";//$NON-NLS-1$
- /** for SELECT. */
- public final static String CTYPE_SELECT = "CTYPE_SELECT";//$NON-NLS-1$
- /** table content. CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+ */
- public final static String CTYPE_TABLE = "CTYPE_TABLE";//$NON-NLS-1$
- /** table cell contaier. (TH|TD)+ */
- public final static String CTYPE_TCELL_CONTAINER = "CTYPE_TCELL_CONTAINER";//$NON-NLS-1$
- /** table record container. (TR)+ */
- public final static String CTYPE_TR_CONTAINER = "CTYPE_TR_CONTAINER";//$NON-NLS-1$
-
- /**
- * ComplexTypeDefinitionFactory constructor comment.
- */
- private ComplexTypeDefinitionFactory() {
- super();
- definitions = new java.util.Hashtable();
- }
-
- /**
- * Factory method for ComplexTypeDefinition.
- * Each instance created in this method must be registered into
- * the map with its name.
- * @param definitionName java.lang.String
- * @param elementCollection ElementCollection
- */
- public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
- if (definitions.containsKey(definitionName)) {
- return (ComplexTypeDefinition) definitions.get(definitionName);
- }
-
- ComplexTypeDefinition def = null;
- if (definitionName == CTYPE_ADDRESS) {
- def = new CtdAddress(elementCollection);
-
- }
- else if (definitionName == CTYPE_COLUMN_GROUP) {
- def = new CtdColumnGroup(elementCollection);
-
- }
- else if (definitionName == CTYPE_DEFINITION_LIST) {
- def = new CtdDl(elementCollection);
-
- }
- else if (definitionName == CTYPE_EMBED) {
- def = new CtdEmbed(elementCollection);
-
- }
- else if (definitionName == CTYPE_FIELDSET) {
- def = new CtdFieldset(elementCollection);
-
- }
- else if (definitionName == CTYPE_FLOW_CONTAINER) {
- def = new CtdFlowContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_FRAMESET) {
- def = new CtdFrameset(elementCollection);
-
- }
- else if (definitionName == CTYPE_HEAD) {
- def = new CtdHead(elementCollection);
-
- }
- else if (definitionName == CTYPE_HTML) {
- def = new CtdHtml(elementCollection);
-
- }
- else if (definitionName == CTYPE_INLINE_CONTAINER) {
- def = new CtdInlineContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_LI_CONTAINER) {
- def = new CtdLiContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_MAP) {
- def = new CtdMap(elementCollection);
-
- }
- else if (definitionName == CTYPE_NOFRAMES_CONTENT) {
- def = new CtdNoframesContent(elementCollection);
-
- }
- else if (definitionName == CTYPE_OPTION_CONTAINER) {
- def = new CtdOptionContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_PARAM_CONTAINER) {
- def = new CtdParamContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_SELECT) {
- def = new CtdSelect(elementCollection);
-
- }
- else if (definitionName == CTYPE_TABLE) {
- def = new CtdTable(elementCollection);
-
- }
- else if (definitionName == CTYPE_TCELL_CONTAINER) {
- def = new CtdTableCellContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_TR_CONTAINER) {
- def = new CtdTrContainer(elementCollection);
-
- }
- else {
- def = null;
- }
- if (def == null)
- return null; // fail to create.
- definitions.put(definitionName, def);
- return def;
- }
-
- /**
- * For singleton.
- */
- public synchronized static ComplexTypeDefinitionFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new ComplexTypeDefinitionFactory();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.java
deleted file mode 100644
index f6e8dddabd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdAddress.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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for ADDRESS.
- */
-final class CtdAddress extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdAddress(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * ((%inline) | P)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )*
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- // (%inline)
- CMGroupImpl inlines = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (inlines == null)
- return;
- collection.getInline(inlines);
- content.appendChild(inlines);
- // P
- CMNode p = collection.getNamedItem(HTML40Namespace.ElementName.P);
- if (p != null)
- content.appendChild(p);
- }
-
- /**
- * ((%inline) | P)*.
- * Because %inline; contains #PCDATA, the type is MIXED.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java
deleted file mode 100644
index d617708299..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdColumnGroup.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * COL group.
- * (COL)*
- */
-final class CtdColumnGroup extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdColumnGroup(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (COL)*
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )*
- content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- // COL
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (COL)*
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_COLUMN_GROUP;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java
deleted file mode 100644
index 9e4a3e6899..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdDl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for DL.
- */
-final class CtdDl extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdDl(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.DT;
- }
-
- /**
- * (DT | DD)+
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // DT
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.DT);
- if (dec != null)
- content.appendChild(dec);
- // DD
- dec = collection.getNamedItem(HTML40Namespace.ElementName.DD);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (DT | DD)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java
deleted file mode 100644
index 86e9186adf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdEmbed.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for EMBED.
- */
-final class CtdEmbed extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdEmbed(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.NOEMBED;
- }
-
- /**
- * (NOEMBED).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // NOEMBED
- CMNode noembed = collection.getNamedItem(HTML40Namespace.ElementName.NOEMBED);
- if (noembed != null)
- content.appendChild(noembed);
- }
-
- /**
- * (NOEMBED).
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_EMBED;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java
deleted file mode 100644
index bc9ed04f91..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFieldset.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for FIELDSET.
- */
-final class CtdFieldset extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdFieldset(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.LEGEND;
- }
-
- /**
- * (#PCDATA, LEGEND, (%flow;)*)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( , , )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // #PCDATA
- // ...??
-
- // LEGEND
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.LEGEND);
- if (dec != null)
- content.appendChild(dec);
- // (%flow;)*
- CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (flows == null)
- return;
- collection.getFlow(flows);
- content.appendChild(flows);
- }
-
- /**
- * (#PCDATA, LEGEND, (%flow;)*)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FIELDSET;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.java
deleted file mode 100644
index b131398627..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFlowContainer.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for containers of <code>%flow;</code>.
- */
-final class CtdFlowContainer extends ComplexTypeDefinition {
-
- /**
- */
- public CtdFlowContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%flow;)*
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getFlow(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java
deleted file mode 100644
index 7bd107655c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdFrameset.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for FRAMESET.
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- */
-final class CtdFrameset extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdFrameset(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.FRAME;
- }
-
- /**
- * ((FRAMESET | FRAME)+ & NOFRAMES?).
- * --> ((FRAMESET | FRAME)+ & (NOFRAMES)?)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( & )
- content = new CMGroupImpl(CMGroup.ALL, 1, 1);
-
- // ( | )+
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- if (group == null)
- return;
- content.appendChild(group);
-
- // FRAMESET
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAMESET);
- if (dec != null)
- group.appendChild(dec);
- // FRAME
- dec = collection.getNamedItem(HTML40Namespace.ElementName.FRAME);
- if (dec != null)
- group.appendChild(dec);
-
- // ( )?
- group = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (group == null)
- return;
- content.appendChild(group);
-
- // NOFRAMES
- dec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
- if (dec != null)
- group.appendChild(dec);
- }
-
- /**
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FRAMESET;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java
deleted file mode 100644
index 8a6817780f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHead.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for the head content.
- * Content Model: (TITLE & ISINDEX? & BASE?)
- */
-final class CtdHead extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHead(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TITLE;
- }
-
- /**
- * for HEAD.
- * To avoid using inclusion, the content model comes from the XHTML 1.0.
- *
- * (%head.misc;, ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc;, (title, %head.misc;))))
- * And %head.misc; is:
- * (script|style|meta|link|object|isindex)*
- *
- * 0: (%head.misc, A)
- * A: (B | C)
- * B: (title, %head.misc;, D)
- * C: (base, %head.misc;, E)
- * D: (base, %head.misc;)?
- * E: (title, %head.misc;)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // At 1st, create %head.misc; content.
- // %head.misc;
- // ( | )*
- CMGroupImpl misc = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (misc == null)
- return;
- String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.ISINDEX};
- collection.getDeclarations(misc, Arrays.asList(names).iterator());
- // 2nd, get a title
- CMNode title = collection.getNamedItem(HTML40Namespace.ElementName.TITLE);
- // 3rd, get a base
- CMNode base = collection.getNamedItem(HTML40Namespace.ElementName.BASE);
- if (title == null || base == null)
- return;
-
- // Top level content is a sequence of %head.misc; and A.
- // 0: (%head.misc;, A)
- // create a sequence
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
- // append %head.misc;
- content.appendChild(misc);
- // create A and append it to the top level.
- {
- // A is a choice of B and C.
- // A: (B | C)
- // create a choice
- CMGroupImpl gA = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (gA == null)
- return;
- // append A to the top level.
- content.appendChild(gA);
-
- // create B and append it to A
- {
- // B is a sequence of title, %head.misc;, and D.
- // B: (title, %head.misc;, D)
- // create a sequence
- CMGroupImpl gB = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gB == null)
- return;
- // append B to A.
- gA.appendChild(gB);
-
- // append title to B
- gB.appendChild(title);
- // append %head.misc; to B
- gB.appendChild(misc);
- // create D and append it to B.
- {
- // D is a sequence of base, %head.misc;.
- // D: (base, %head.misc;)?
- // create a sequence
- CMGroupImpl gD = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (gD == null)
- return;
- // append D to B.
- gB.appendChild(gD);
-
- // append base to D
- gD.appendChild(base);
- // append %head.misc; to D.
- gD.appendChild(misc);
- }
- }
- // create C and append it to A
- {
- // C is a sequence of base, %head.misc;, and E
- // C: (base, %head.misc;, E)
- // create a sequence
- CMGroupImpl gC = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gC == null)
- return;
- // append C to A.
- gA.appendChild(gC);
-
- // append base to C
- gC.appendChild(base);
- // append %head.misc; to C
- gC.appendChild(misc);
-
- // create E and append it to C.
- {
- // E is a sequence of title and %head.misc;.
- // E: (title, %head.misc;)
- // create a sequence
- CMGroupImpl gE = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gE == null)
- return;
- // append E to C.
- gC.appendChild(gE);
-
- // append title to E
- gE.appendChild(title);
- // append %head.misc; to E.
- gE.appendChild(misc);
- }
- }
- }
- }
-
- /**
- * Element content.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HEAD;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
deleted file mode 100644
index 2cceaadd5d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdHtml.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for <code>HTML</code>.<br>
- * Content Model:
- * HEAD, (FRAMESET|BODY)<br>
- */
-final class CtdHtml extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHtml(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.HEAD;
- }
-
- /**
- * (%html.content;).
- * %html.content; is HEAD, (FRAMESET | BODY).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
-
- // HEAD
- CMNode edec = collection.getNamedItem(HTML40Namespace.ElementName.HEAD);
- if (edec != null)
- content.appendChild(edec);
-
- // ( | )
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- content.appendChild(group);
-
- // FRAMESET, BODY
- String[] names = {HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.BODY};
- collection.getDeclarations(group, Arrays.asList(names).iterator());
-
- // since BODY start and end are omissable
- // adding valid children of BODY here under HTML
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97342
- edec = collection.getNamedItem(HTML40Namespace.ElementName.MAP);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.PRE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BDO);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.INPUT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.P);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.NOSCRIPT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.I);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BUTTON);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.LABEL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.U);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H6);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.CENTER);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BASEFONT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.S);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BLOCKQUOTE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H3);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.UL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.B);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SELECT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.Q);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.STRIKE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SCRIPT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ABBR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BIG);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H1);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.IMG);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ACRONYM);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DEL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.TEXTAREA);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H2);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.FONT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.OBJECT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.KBD);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.IFRAME);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.HR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H4);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DIR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SAMP);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.INS);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.H5);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SUP);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.A);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DFN);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ISINDEX);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.VAR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.FIELDSET);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.TABLE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.BR);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.TT);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.APPLET);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.OL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SMALL);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.CITE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.FORM);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.DIV);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.CODE);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SPAN);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.SUB);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.EM);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.MENU);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.ADDRESS);
- if (edec != null)
- content.appendChild(edec);
-
- edec = collection.getNamedItem(HTML40Namespace.ElementName.STRONG);
- if (edec != null)
- content.appendChild(edec);
- }
-
- /**
- * Element content.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HTML;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.java
deleted file mode 100644
index ad52c8b04d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdInlineContainer.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for (%inline;)*.
- */
-final class CtdInlineContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdInlineContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%inline)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getInline(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java
deleted file mode 100644
index aae68af49b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdLiContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * List item container.
- * (LI)+
- */
-final class CtdLiContainer extends ComplexTypeDefinition {
-
- /**
- * @param elemenCollection ElementCollection
- */
- public CtdLiContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.LI;
- }
-
- /**
- * (LI)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // (LI)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- CMNode li = collection.getNamedItem(HTML40Namespace.ElementName.LI);
- if (li != null)
- content.appendChild(li);
- }
-
- /**
- * ELEMENT content.<br>
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.java
deleted file mode 100644
index 83f9b72af8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdMap.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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for MAP.
- */
-final class CtdMap extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdMap(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.AREA;
- }
-
- /**
- * ((%block;) | AREA)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // (%block;)
- CMGroupImpl blocks = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (blocks == null)
- return;
- collection.getBlock(blocks);
- content.appendChild(blocks);
- // AREA
- CMNode area = collection.getNamedItem(HTML40Namespace.ElementName.AREA);
- if (area != null)
- content.appendChild(area);
- }
-
- /**
- * ((%block;) | AREA)+.
- * Because %block; consists of elements only, the type is ELEMENT.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_MAP;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java
deleted file mode 100644
index f7ac09bf79..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdNoframesContent.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for NOFRAMES.
- */
-final class CtdNoframesContent extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdNoframesContent(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.BODY;
- }
-
- /**
- * (BODY).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- // BODY
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.BODY);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (BODY)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_NOFRAMES_CONTENT;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.java
deleted file mode 100644
index a772f17371..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdOptionContainer.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * OPTION container.
- * (OPTION)+
- */
-final class CtdOptionContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdOptionContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.OPTION;
- }
-
- /**
- * (OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTION)+
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.java
deleted file mode 100644
index a82afb84ad..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdParamContainer.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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * PARAM container. For OBJECT and APPLET.
- */
-final class CtdParamContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdParamContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (PARAM | %flow;)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )*
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- // PARAM
- CMNode param = collection.getNamedItem(HTML40Namespace.ElementName.PARAM);
- if (param != null)
- content.appendChild(param);
- // %flow;
- CMGroupImpl flows = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (flows == null)
- return;
- collection.getInline(flows);
- content.appendChild(flows);
- }
-
- /**
- * (PARAM | %flow;)*.
- * Because %flow; contains #PCDATA, the type is MIXED.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java
deleted file mode 100644
index b7f6c09e32..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdSelect.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for SELECT.
- */
-final class CtdSelect extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdSelect(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.OPTION;
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // OPTGROUP
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTGROUP);
- if (dec != null)
- content.appendChild(dec);
- // OPTION
- dec = collection.getNamedItem(HTML40Namespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_SELECT;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java
deleted file mode 100644
index d056c8e7aa..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTable.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for TABLE.
- * (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+, TR+)
- */
-final class CtdTable extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdTable(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TBODY;
- }
-
- /**
- * (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)
- * --> ((CAPTION)?, ((COL)* | (COLGROUP)*), (THEAD)?, (TFOOT)?, (TBODY)+, (TR)+)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( , , , ,)
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
-
- // (CAPTION)?
- // ( )?
- CMGroupImpl wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- // CAPTION
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.CAPTION);
- if (dec != null)
- wrap.appendChild(dec);
-
- // ((COL)* | (COLGROUP)*)
- // ( | )
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (group == null)
- return;
- content.appendChild(group);
- // (COL)*
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- group.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.COL);
- if (dec != null)
- wrap.appendChild(dec);
- // (COLGROUP)*
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- group.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.COLGROUP);
- if (dec != null)
- wrap.appendChild(dec);
-
- // (THEAD)?
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.THEAD);
- if (dec != null)
- wrap.appendChild(dec);
-
- // (TFOOT)?
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TFOOT);
- if (dec != null)
- wrap.appendChild(dec);
-
- // (TBODY)+
- // TBODY has optional start and end tags
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TBODY);
- if (dec != null)
- wrap.appendChild(dec);
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=96101
- // TBODY start and end tag are optional, so TR should be allowed here
- // (TR)+
- wrap = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- if (wrap == null)
- return;
- content.appendChild(wrap);
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TR);
- if (dec != null)
- wrap.appendChild(dec);
- }
-
- /**
- * ((FRAMESET | FRAME)+ & NOFRAMES?)
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_TABLE;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java
deleted file mode 100644
index 40ddbc5a73..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTableCellContainer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Table cell container.
- * (TH | TD)+
- */
-final class CtdTableCellContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdTableCellContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TD;
- }
-
- /**
- * (TH | TD)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // TH
- CMNode dec = collection.getNamedItem(HTML40Namespace.ElementName.TH);
- if (dec != null)
- content.appendChild(dec);
- // TD
- dec = collection.getNamedItem(HTML40Namespace.ElementName.TD);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (TH | TD)+
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_TCELL_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java
deleted file mode 100644
index 53adfc6ad3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/CtdTrContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Table record container.
- * (TR)+
- */
-final class CtdTrContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdTrContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = HTML40Namespace.ElementName.TR;
- }
-
- /**
- * (TR)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // (TR)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- CMNode tr = collection.getNamedItem(HTML40Namespace.ElementName.TR);
- if (tr != null)
- content.appendChild(tr);
- }
-
- /**
- * ELEMENT content.<br>
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_TR_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java
deleted file mode 100644
index d464233d77..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/DeclCollection.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class DeclCollection implements CMNamedNodeMap {
-
-
- protected class DualMap {
- public DualMap() {
- super();
- }
-
- public DualMap(Object[] objects) {
- super();
- initialize(objects);
- }
-
- public int size() {
- return table.length;
- }
-
- public Object getValue(int key) {
- if (!isValidIndex(key))
- return null;
- return table[key];
- }
-
- public int getKey(Object value) {
- Integer keyObj = (Integer) map.get(value);
- if (keyObj == null)
- return ID_UNKNOWN;
- return keyObj.intValue();
- }
-
- protected void initialize(Object[] objects) {
- if (objects == null)
- return;
- table = objects;
- map = new HashMap();
- for (int key = 0; key < objects.length; key++) {
- Object value = table[key];
- map.put(value, new Integer(key));
- }
- }
-
- private Object[] table = null;
- private HashMap map = null;
-
- private boolean isValidIndex(int index) {
- return index >= 0 && index < table.length;
- }
- }
-
- protected class TolerantStringDualMap extends DualMap {
- public TolerantStringDualMap(String[] names) {
- super();
- Object[] objects = new Object[names.length];
- for (int i = 0; i < names.length; i++) {
- objects[i] = makeCanonicalForm(names[i]);
- }
- initialize(objects);
- }
-
- public int getKey(Object value) {
- try {
- String name = (String) value;
- return super.getKey(makeCanonicalForm(name));
- }
- catch (ClassCastException e) {
- return ID_UNKNOWN;
- }
- }
-
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
- }
-
- private class DeclIterator implements Iterator {
- public DeclIterator() {
- maxid = fDecls.length - 1;
- }
-
- public boolean hasNext() {
- return id < maxid;
- }
-
- public Object next() {
- if (!hasNext())
- return null;
- return item(++id);
- }
-
- public void remove() { /* nothing should be done. */
- }
-
- private int id = -1;
- private int maxid = -1;
- }
-
- CMNode[] fDecls = null;
- protected final static boolean STRICT_CASE = false;
- protected final static boolean TOLERANT_CASE = true;
- protected final static int ID_UNKNOWN = -1;
- private DualMap fMap = null;
-
- /**
- */
- public DeclCollection(String[] names, boolean tolerant) {
- super();
- fDecls = new CMNode[names.length];
- if (tolerant) {
- fMap = new TolerantStringDualMap(names);
- }
- else {
- fMap = new DualMap(names);
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param id int
- */
- protected abstract CMNode create(String name);
-
- /**
- */
- public CMNamedNodeMap getDeclarations(String[] names) {
- CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- CMNode node = getNamedItem(name);
- if (node == null)
- continue;
- map.putNamedItem(name, node);
- }
- return map;
- }
-
- /**
- * @param names java.util.Iterator
- */
- public void getDeclarations(CMGroupImpl group, Iterator names) {
- while (names.hasNext()) {
- String entityName = (String) names.next();
- CMNode dec = getNamedItem(entityName);
- if (dec != null)
- group.appendChild(dec);
- }
- }
-
- /**
- * Map name to id.
- * @return int
- * @param name java.lang.String
- */
- protected int getID(String name) {
- return fMap.getKey(name);
- }
-
- /**
- * getLength method
- * @return int
- */
- public int getLength() {
- return fDecls.length;
- }
-
- /**
- * @return java.lang.String
- * @param id int
- */
- protected String getName(int id) {
- return (String) fMap.getValue(id);
- }
-
- /**
- * getNamedItem method
- * @return CMNode
- * @param name java.lang.String
- */
- public CMNode getNamedItem(String name) {
- int id = getID(name);
- if (!isValidID(id))
- return null;
- return item(id);
- }
-
- /**
- * @return boolean
- * @param id int
- */
- private boolean isValidID(int id) {
- return id >= 0 && id < fDecls.length;
- }
-
- /**
- * item method
- * @return CMNode
- * @param index int
- */
- public CMNode item(int index) {
- if (!isValidID(index))
- return null;
- CMNode decl = fDecls[index];
- if (decl != null)
- return decl; // already exist.
-
- decl = create(getName(index));
- fDecls[index] = decl;
- return decl;
- }
-
- /**
- */
- public Iterator iterator() {
- return new DeclIterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
deleted file mode 100644
index 680bd391f3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ElementCollection.java
+++ /dev/null
@@ -1,881 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
-
-
- // Element IDs
- private static class Ids {
- public static final int ID_A = 0;
- public static final int ID_ABBR = 1;
- public static final int ID_ACRONYM = 2;
- public static final int ID_ADDRESS = 3;
- public static final int ID_APPLET = 4;
- public static final int ID_AREA = 5;
- public static final int ID_B = 6;
- public static final int ID_BASE = 7;
- public static final int ID_BASEFONT = 8;
- public static final int ID_BDO = 9;
- public static final int ID_BIG = 10;
- public static final int ID_BLINK = 11;
- public static final int ID_BLOCKQUOTE = 12;
- public static final int ID_BODY = 13;
- public static final int ID_BR = 14;
- public static final int ID_BUTTON = 15;
- public static final int ID_CAPTION = 16;
- public static final int ID_CENTER = 17;
- public static final int ID_CITE = 18;
- public static final int ID_CODE = 19;
- public static final int ID_COL = 20;
- public static final int ID_COLGROUP = 21;
- public static final int ID_DD = 22;
- public static final int ID_DEL = 23;
- public static final int ID_DFN = 24;
- public static final int ID_DIR = 25;
- public static final int ID_DIV = 26;
- public static final int ID_DL = 27;
- public static final int ID_DT = 28;
- public static final int ID_EM = 29;
- public static final int ID_EMBED = 30;
- public static final int ID_FIELDSET = 31;
- public static final int ID_FONT = 32;
- public static final int ID_FORM = 33;
- public static final int ID_FRAME = 34;
- public static final int ID_FRAMESET = 35;
- public static final int ID_H1 = 36;
- public static final int ID_H2 = 37;
- public static final int ID_H3 = 38;
- public static final int ID_H4 = 39;
- public static final int ID_H5 = 40;
- public static final int ID_H6 = 41;
- public static final int ID_HEAD = 42;
- public static final int ID_HR = 43;
- public static final int ID_HTML = 44;
- public static final int ID_I = 45;
- public static final int ID_IFRAME = 46;
- public static final int ID_IMG = 47;
- public static final int ID_INPUT = 48;
- public static final int ID_INS = 49;
- public static final int ID_ISINDEX = 50;
- public static final int ID_KBD = 51;
- public static final int ID_LABEL = 52;
- public static final int ID_LEGEND = 53;
- public static final int ID_LI = 54;
- public static final int ID_LINK = 55;
- public static final int ID_MAP = 56;
- public static final int ID_MENU = 57;
- public static final int ID_META = 58;
- public static final int ID_NOEMBED = 59;
- public static final int ID_NOFRAMES = 60;
- public static final int ID_NOSCRIPT = 61;
- public static final int ID_OBJECT = 62;
- public static final int ID_OL = 63;
- public static final int ID_OPTGROUP = 64;
- public static final int ID_OPTION = 65;
- public static final int ID_P = 66;
- public static final int ID_PARAM = 67;
- public static final int ID_PRE = 68;
- public static final int ID_Q = 69;
- public static final int ID_S = 70;
- public static final int ID_SAMP = 71;
- public static final int ID_SCRIPT = 72;
- public static final int ID_SELECT = 73;
- public static final int ID_SMALL = 74;
- public static final int ID_SPAN = 75;
- public static final int ID_STRIKE = 76;
- public static final int ID_STRONG = 77;
- public static final int ID_STYLE = 78;
- public static final int ID_SUB = 79;
- public static final int ID_SUP = 80;
- public static final int ID_TABLE = 81;
- public static final int ID_TBODY = 82;
- public static final int ID_TD = 83;
- public static final int ID_TEXTAREA = 84;
- public static final int ID_TFOOT = 85;
- public static final int ID_TH = 86;
- public static final int ID_THEAD = 87;
- public static final int ID_TITLE = 88;
- public static final int ID_TR = 89;
- public static final int ID_TT = 90;
- public static final int ID_U = 91;
- public static final int ID_UL = 92;
- public static final int ID_VAR = 93;
- public static final int ID_MARQUEE = 94;
- public static final int ID_SSI_CONFIG = 95;
- public static final int ID_SSI_ECHO = 96;
- public static final int ID_SSI_EXEC = 97;
- public static final int ID_SSI_FSIZE = 98;
- public static final int ID_SSI_FLASTMOD = 99;
- public static final int ID_SSI_INCLUDE = 100;
- public static final int ID_SSI_PRINTENV = 101;
- public static final int ID_SSI_SET = 102;
- // <<D205513
- public static final int ID_BGSOUND = 103;
- public static final int ID_NOBR = 104;
- public static final int ID_WBR = 105;
-
- // D205513
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- /** %fontstyle;. TT | I | B | U | S | STRIKE | BIG | SMALL | BLINK */
- private static final String[] FONTSTYLE = {TT, I, B, U, S, STRIKE, BIG, SMALL, BLINK};
- /** %formctl;. INPUT | SELECT | TEXTAREA | LABEL | BUTTON */
- private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA, LABEL, BUTTON};
- /** %phrase;.
- * EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM
- */
- private static final String[] PHRASE = {EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, ACRONYM};
- /** %special;.
- * A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
- * MAP | Q | SUB | SUP | SPAN | BDO | IFRAME | EMBED | MARQUEE |
- * D2W | SUBMIT
- * WBR | NOBR | BGSOUND
- */
- private static final String[] SPECIAL = {A, IMG, APPLET, OBJECT, FONT, BASEFONT, BR, WBR, // D205513
- SCRIPT, MAP, Q, SUB, SUP, SPAN, BDO, IFRAME, EMBED, BGSOUND, // D205513
- MARQUEE, NOBR // D205513
- };
- /** %heading;. H[1-6] */
- private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
- /** %list;. UL | OL | DIR | MENU */
- private static final String[] LIST = {UL, OL, DIR, MENU};
- /** %preformatted;. PRE */
- private static final String[] PREFORMATTED = {PRE};
- private AttributeCollection attributeCollection = null;
- private static String[] fNames = null;
-
- static {
- fNames = new String[Ids.getNumOfIds()];
- fNames[Ids.ID_A] = A;
- fNames[Ids.ID_ABBR] = ABBR;
- fNames[Ids.ID_ACRONYM] = ACRONYM;
- fNames[Ids.ID_ADDRESS] = ADDRESS;
- fNames[Ids.ID_APPLET] = APPLET;
- fNames[Ids.ID_AREA] = AREA;
- fNames[Ids.ID_B] = B;
- fNames[Ids.ID_BASE] = BASE;
- fNames[Ids.ID_BASEFONT] = BASEFONT;
- fNames[Ids.ID_BDO] = BDO;
- fNames[Ids.ID_BIG] = BIG;
- fNames[Ids.ID_BLINK] = BLINK;
- fNames[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
- fNames[Ids.ID_BODY] = BODY;
- fNames[Ids.ID_BR] = BR;
- fNames[Ids.ID_BUTTON] = BUTTON;
- fNames[Ids.ID_CAPTION] = CAPTION;
- fNames[Ids.ID_CENTER] = CENTER;
- fNames[Ids.ID_CITE] = CITE;
- fNames[Ids.ID_CODE] = CODE;
- fNames[Ids.ID_COL] = COL;
- fNames[Ids.ID_COLGROUP] = COLGROUP;
- fNames[Ids.ID_DD] = DD;
- fNames[Ids.ID_DEL] = DEL;
- fNames[Ids.ID_DFN] = DFN;
- fNames[Ids.ID_DIR] = DIR;
- fNames[Ids.ID_DIV] = DIV;
- fNames[Ids.ID_DL] = DL;
- fNames[Ids.ID_DT] = DT;
- fNames[Ids.ID_EM] = EM;
- fNames[Ids.ID_EMBED] = EMBED;
- fNames[Ids.ID_FIELDSET] = FIELDSET;
- fNames[Ids.ID_FONT] = FONT;
- fNames[Ids.ID_FORM] = FORM;
- fNames[Ids.ID_FRAME] = FRAME;
- fNames[Ids.ID_FRAMESET] = FRAMESET;
- fNames[Ids.ID_H1] = H1;
- fNames[Ids.ID_H2] = H2;
- fNames[Ids.ID_H3] = H3;
- fNames[Ids.ID_H4] = H4;
- fNames[Ids.ID_H5] = H5;
- fNames[Ids.ID_H6] = H6;
- fNames[Ids.ID_HEAD] = HEAD;
- fNames[Ids.ID_HR] = HR;
- fNames[Ids.ID_HTML] = HTML;
- fNames[Ids.ID_I] = I;
- fNames[Ids.ID_IFRAME] = IFRAME;
- fNames[Ids.ID_IMG] = IMG;
- fNames[Ids.ID_INPUT] = INPUT;
- fNames[Ids.ID_INS] = INS;
- fNames[Ids.ID_ISINDEX] = ISINDEX;
- fNames[Ids.ID_KBD] = KBD;
- fNames[Ids.ID_LABEL] = LABEL;
- fNames[Ids.ID_LEGEND] = LEGEND;
- fNames[Ids.ID_LI] = LI;
- fNames[Ids.ID_LINK] = LINK;
- fNames[Ids.ID_MAP] = MAP;
- fNames[Ids.ID_MENU] = MENU;
- fNames[Ids.ID_META] = META;
- fNames[Ids.ID_NOEMBED] = NOEMBED;
- fNames[Ids.ID_NOFRAMES] = NOFRAMES;
- fNames[Ids.ID_NOSCRIPT] = NOSCRIPT;
- fNames[Ids.ID_OBJECT] = OBJECT;
- fNames[Ids.ID_OL] = OL;
- fNames[Ids.ID_OPTGROUP] = OPTGROUP;
- fNames[Ids.ID_OPTION] = OPTION;
- fNames[Ids.ID_P] = P;
- fNames[Ids.ID_PARAM] = PARAM;
- fNames[Ids.ID_PRE] = PRE;
- fNames[Ids.ID_Q] = Q;
- fNames[Ids.ID_S] = S;
- fNames[Ids.ID_SAMP] = SAMP;
- fNames[Ids.ID_SCRIPT] = SCRIPT;
- fNames[Ids.ID_SELECT] = SELECT;
- fNames[Ids.ID_SMALL] = SMALL;
- fNames[Ids.ID_SPAN] = SPAN;
- fNames[Ids.ID_STRIKE] = STRIKE;
- fNames[Ids.ID_STRONG] = STRONG;
- fNames[Ids.ID_STYLE] = STYLE;
- fNames[Ids.ID_SUB] = SUB;
- fNames[Ids.ID_SUP] = SUP;
- fNames[Ids.ID_TABLE] = TABLE;
- fNames[Ids.ID_TBODY] = TBODY;
- fNames[Ids.ID_TD] = TD;
- fNames[Ids.ID_TEXTAREA] = TEXTAREA;
- fNames[Ids.ID_TFOOT] = TFOOT;
- fNames[Ids.ID_TH] = TH;
- fNames[Ids.ID_THEAD] = THEAD;
- fNames[Ids.ID_TITLE] = TITLE;
- fNames[Ids.ID_TR] = TR;
- fNames[Ids.ID_TT] = TT;
- fNames[Ids.ID_U] = U;
- fNames[Ids.ID_UL] = UL;
- fNames[Ids.ID_VAR] = VAR;
- fNames[Ids.ID_MARQUEE] = MARQUEE;
- fNames[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
- fNames[Ids.ID_SSI_ECHO] = SSI_ECHO;
- fNames[Ids.ID_SSI_EXEC] = SSI_EXEC;
- fNames[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
- fNames[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
- fNames[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
- fNames[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
- fNames[Ids.ID_SSI_SET] = SSI_SET;
- fNames[Ids.ID_BGSOUND] = BGSOUND;
- fNames[Ids.ID_NOBR] = NOBR;
- fNames[Ids.ID_WBR] = WBR;
- }
-
- /**
- */
- public ElementCollection(AttributeCollection collection) {
- super(fNames, TOLERANT_CASE);
- attributeCollection = collection;
- }
-
- /**
- * Actually creates HTMLElementDeclaration instance.
- * @return HTMLElementDeclaration
- */
- protected CMNode create(String elementName) {
- HTMLElemDeclImpl edec = null;
-
- if (elementName.equalsIgnoreCase(A)) {
- edec = new HedA(this);
- }
- else if (elementName.equalsIgnoreCase(ABBR)) {
- edec = new HedPhrase(ABBR, this);
-
- }
- else if (elementName.equalsIgnoreCase(ACRONYM)) {
- edec = new HedPhrase(ACRONYM, this);
-
- }
- else if (elementName.equalsIgnoreCase(ADDRESS)) {
- edec = new HedADDRESS(this);
-
- }
- else if (elementName.equalsIgnoreCase(APPLET)) {
- edec = new HedAPPLET(this);
-
- }
- else if (elementName.equalsIgnoreCase(AREA)) {
- edec = new HedAREA(this);
-
- }
- else if (elementName.equalsIgnoreCase(B)) {
- edec = new HedFontStyle(B, this);
-
- }
- else if (elementName.equalsIgnoreCase(BASE)) {
- edec = new HedBASE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BASEFONT)) {
- edec = new HedBASEFONT(this);
-
- }
- else if (elementName.equalsIgnoreCase(BDO)) {
- edec = new HedBDO(this);
-
- }
- else if (elementName.equalsIgnoreCase(BIG)) {
- edec = new HedFontStyle(BIG, this);
-
- }
- else if (elementName.equalsIgnoreCase(BLINK)) {
- edec = new HedFontStyle(BLINK, this);
-
- }
- else if (elementName.equalsIgnoreCase(BLOCKQUOTE)) {
- edec = new HedBLOCKQUOTE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BODY)) {
- edec = new HedBODY(this);
-
- }
- else if (elementName.equalsIgnoreCase(BR)) {
- edec = new HedBR(this);
-
- }
- else if (elementName.equalsIgnoreCase(BUTTON)) {
- edec = new HedBUTTON(this);
-
- }
- else if (elementName.equalsIgnoreCase(CAPTION)) {
- edec = new HedCAPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(CENTER)) {
- edec = new HedCENTER(this);
-
- }
- else if (elementName.equalsIgnoreCase(CITE)) {
- edec = new HedPhrase(CITE, this);
-
- }
- else if (elementName.equalsIgnoreCase(CODE)) {
- edec = new HedPhrase(CODE, this);
-
- }
- else if (elementName.equalsIgnoreCase(COL)) {
- edec = new HedCOL(this);
-
- }
- else if (elementName.equalsIgnoreCase(COLGROUP)) {
- edec = new HedCOLGROUP(this);
-
- }
- else if (elementName.equalsIgnoreCase(DD)) {
- edec = new HedDD(this);
-
- }
- else if (elementName.equalsIgnoreCase(DEL)) {
- edec = new HedMarkChanges(DEL, this);
-
- }
- else if (elementName.equalsIgnoreCase(DFN)) {
- edec = new HedPhrase(DFN, this);
-
- }
- else if (elementName.equalsIgnoreCase(DIR)) {
- edec = new HedMENU(DIR, this);
-
- }
- else if (elementName.equalsIgnoreCase(DIV)) {
- edec = new HedDIV(this);
-
- }
- else if (elementName.equalsIgnoreCase(DL)) {
- edec = new HedDL(this);
-
- }
- else if (elementName.equalsIgnoreCase(DT)) {
- edec = new HedDT(this);
-
- }
- else if (elementName.equalsIgnoreCase(EM)) {
- edec = new HedPhrase(EM, this);
-
- }
- else if (elementName.equalsIgnoreCase(EMBED)) {
- edec = new HedEMBED(this);
-
- }
- else if (elementName.equalsIgnoreCase(FIELDSET)) {
- edec = new HedFIELDSET(this);
-
- }
- else if (elementName.equalsIgnoreCase(FONT)) {
- edec = new HedFONT(this);
-
- }
- else if (elementName.equalsIgnoreCase(FORM)) {
- edec = new HedFORM(this);
-
- }
- else if (elementName.equalsIgnoreCase(FRAME)) {
- edec = new HedFRAME(this);
-
- }
- else if (elementName.equalsIgnoreCase(FRAMESET)) {
- edec = new HedFRAMESET(this);
-
- }
- else if (elementName.equalsIgnoreCase(H1)) {
- edec = new HedHeading(H1, this);
-
- }
- else if (elementName.equalsIgnoreCase(H2)) {
- edec = new HedHeading(H2, this);
-
- }
- else if (elementName.equalsIgnoreCase(H3)) {
- edec = new HedHeading(H3, this);
-
- }
- else if (elementName.equalsIgnoreCase(H4)) {
- edec = new HedHeading(H4, this);
-
- }
- else if (elementName.equalsIgnoreCase(H5)) {
- edec = new HedHeading(H5, this);
-
- }
- else if (elementName.equalsIgnoreCase(H6)) {
- edec = new HedHeading(H6, this);
-
- }
- else if (elementName.equalsIgnoreCase(HEAD)) {
- edec = new HedHEAD(this);
-
- }
- else if (elementName.equalsIgnoreCase(HR)) {
- edec = new HedHR(this);
-
- }
- else if (elementName.equalsIgnoreCase(HTML)) {
- edec = new HedHTML(this);
-
- }
- else if (elementName.equalsIgnoreCase(I)) {
- edec = new HedFontStyle(I, this);
-
- }
- else if (elementName.equalsIgnoreCase(IFRAME)) {
- edec = new HedIFRAME(this);
-
- }
- else if (elementName.equalsIgnoreCase(IMG)) {
- edec = new HedIMG(this);
-
- }
- else if (elementName.equalsIgnoreCase(INPUT)) {
- edec = new HedINPUT(this);
-
- }
- else if (elementName.equalsIgnoreCase(INS)) {
- edec = new HedMarkChanges(INS, this);
-
- }
- else if (elementName.equalsIgnoreCase(ISINDEX)) {
- edec = new HedISINDEX(this);
-
- }
- else if (elementName.equalsIgnoreCase(KBD)) {
- edec = new HedPhrase(KBD, this);
-
- }
- else if (elementName.equalsIgnoreCase(LABEL)) {
- edec = new HedLABEL(this);
-
- }
- else if (elementName.equalsIgnoreCase(LEGEND)) {
- edec = new HedLEGEND(this);
-
- }
- else if (elementName.equalsIgnoreCase(LI)) {
- edec = new HedLI(this);
-
- }
- else if (elementName.equalsIgnoreCase(LINK)) {
- edec = new HedLINK(this);
-
- }
- else if (elementName.equalsIgnoreCase(MAP)) {
- edec = new HedMAP(this);
-
- }
- else if (elementName.equalsIgnoreCase(MARQUEE)) {
- edec = new HedMARQUEE(this);
-
- }
- else if (elementName.equalsIgnoreCase(MENU)) {
- edec = new HedMENU(MENU, this);
-
- }
- else if (elementName.equalsIgnoreCase(META)) {
- edec = new HedMETA(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOEMBED)) {
- edec = new HedNOEMBED(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOFRAMES)) {
- edec = new HedNOFRAMES(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOSCRIPT)) {
- edec = new HedNOSCRIPT(this);
-
- }
- else if (elementName.equalsIgnoreCase(OBJECT)) {
- edec = new HedOBJECT(this);
-
- }
- else if (elementName.equalsIgnoreCase(OL)) {
- edec = new HedOL(this);
-
- }
- else if (elementName.equalsIgnoreCase(OPTGROUP)) {
- edec = new HedOPTGROUP(this);
-
- }
- else if (elementName.equalsIgnoreCase(OPTION)) {
- edec = new HedOPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(P)) {
- edec = new HedP(this);
-
- }
- else if (elementName.equalsIgnoreCase(PARAM)) {
- edec = new HedPARAM(this);
-
- }
- else if (elementName.equalsIgnoreCase(PRE)) {
- edec = new HedPRE(this);
-
- }
- else if (elementName.equalsIgnoreCase(Q)) {
- edec = new HedQ(this);
-
- }
- else if (elementName.equalsIgnoreCase(S)) {
- edec = new HedFontStyle(S, this);
-
- }
- else if (elementName.equalsIgnoreCase(SAMP)) {
- edec = new HedPhrase(SAMP, this);
-
- }
- else if (elementName.equalsIgnoreCase(SCRIPT)) {
- edec = new HedSCRIPT(this);
-
- }
- else if (elementName.equalsIgnoreCase(SELECT)) {
- edec = new HedSELECT(this);
-
- }
- else if (elementName.equalsIgnoreCase(SMALL)) {
- edec = new HedFontStyle(SMALL, this);
-
- }
- else if (elementName.equalsIgnoreCase(SPAN)) {
- edec = new HedSPAN(this);
-
- }
- else if (elementName.equalsIgnoreCase(STRIKE)) {
- edec = new HedFontStyle(STRIKE, this);
-
- }
- else if (elementName.equalsIgnoreCase(STRONG)) {
- edec = new HedPhrase(STRONG, this);
-
- }
- else if (elementName.equalsIgnoreCase(STYLE)) {
- edec = new HedSTYLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(SUB)) {
- edec = new HedScripts(SUB, this);
-
- }
- else if (elementName.equalsIgnoreCase(SUP)) {
- edec = new HedScripts(SUP, this);
-
- }
- else if (elementName.equalsIgnoreCase(TABLE)) {
- edec = new HedTABLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(TBODY)) {
- edec = new HedTableBody(TBODY, this);
-
- }
- else if (elementName.equalsIgnoreCase(TD)) {
- edec = new HedTableCell(TD, this);
-
- }
- else if (elementName.equalsIgnoreCase(TEXTAREA)) {
- edec = new HedTEXTAREA(this);
-
- }
- else if (elementName.equalsIgnoreCase(TFOOT)) {
- edec = new HedTableBody(TFOOT, this);
-
- }
- else if (elementName.equalsIgnoreCase(TH)) {
- edec = new HedTableCell(TH, this);
-
- }
- else if (elementName.equalsIgnoreCase(THEAD)) {
- edec = new HedTableBody(THEAD, this);
-
- }
- else if (elementName.equalsIgnoreCase(TITLE)) {
- edec = new HedTITLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(TR)) {
- edec = new HedTR(this);
-
- }
- else if (elementName.equalsIgnoreCase(TT)) {
- edec = new HedFontStyle(TT, this);
-
- }
- else if (elementName.equalsIgnoreCase(U)) {
- edec = new HedFontStyle(U, this);
-
- }
- else if (elementName.equalsIgnoreCase(UL)) {
- edec = new HedUL(this);
-
- }
- else if (elementName.equalsIgnoreCase(VAR)) {
- edec = new HedPhrase(VAR, this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_CONFIG)) {
- edec = new HedSSIConfig(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_ECHO)) {
- edec = new HedSSIEcho(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_EXEC)) {
- edec = new HedSSIExec(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FSIZE)) {
- edec = new HedSSIFsize(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FLASTMOD)) {
- edec = new HedSSIFlastmod(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_INCLUDE)) {
- edec = new HedSSIInclude(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_PRINTENV)) {
- edec = new HedSSIPrintenv(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_SET)) {
- edec = new HedSSISet(this);
-
- }
- else if (elementName.equalsIgnoreCase(BGSOUND)) {
- edec = new HedBGSOUND(this);
-
- }
- else if (elementName.equalsIgnoreCase(NOBR)) {
- edec = new HedNOBR(this);
-
- }
- else if (elementName.equalsIgnoreCase(WBR)) {
- edec = new HedWBR(this);
-
- } // unknown
- else {
- // NOTE: We don't define the UNKNOWN element declaration.
- // <code>null</code> for a declaration is a sign of
- // the target element is unknown.
- // -- 3/9/2001
- edec = null;
- }
- return edec;
- }
-
- public AttributeCollection getAttributeCollection() {
- return attributeCollection;
- }
-
- public final Collection getNamesOfBlock() {
- // P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR,
- // TABLE, FIELDSET, ADDRESS
- String[] blockMisc = {P, DL, DIV, CENTER, NOSCRIPT, NOFRAMES, BLOCKQUOTE, FORM, ISINDEX, HR, TABLE, FIELDSET, ADDRESS};
- Vector names = new Vector(Arrays.asList(blockMisc));
- // %heading;
- names.addAll(Arrays.asList(HEADING));
- // %list;
- names.addAll(Arrays.asList(LIST));
- // %preformatted;
- names.addAll(Arrays.asList(PREFORMATTED));
-
- return names;
- }
-
- /**
- * %block;.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getBlock(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, getNamesOfBlock().iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public final void getFlow(CMGroupImpl group) {
- if (group == null)
- return;
- getBlock(group);
- getInline(group);
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFontstyle(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FONTSTYLE).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFormctrl(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FORMCTL).iterator());
- }
-
- /**
- * %heading;.
- * @param group CMGroupImpl Return values.
- */
- public final void getHeading(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(HEADING).iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public final void getInline(CMGroupImpl group) {
- if (group == null)
- return;
- getFontstyle(group);
- getPhrase(group);
- getSpecial(group);
- getFormctrl(group);
- }
-
- /**
- * %list;.
- * @param group CMGroupImpl Return values.
- */
- public final void getList(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(LIST).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getPhrase(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(PHRASE).iterator());
- }
-
- /**
- * %preformatted;
- * @param group CMGroupImpl Return values.
- */
- public final void getPreformatted(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getSpecial(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(SPECIAL).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java
deleted file mode 100644
index 350594fb14..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/EntityCollection.java
+++ /dev/null
@@ -1,837 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for entity declarations.
- */
-final class EntityCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.EntityName {
-
-
- private static class Ids {
- public static final int ID_AACUTE_L = 0;
- public static final int ID_AACUTE_U = 1;
- public static final int ID_ACIRC_L = 2;
- public static final int ID_ACIRC_U = 3;
- public static final int ID_ACUTE = 4;
- public static final int ID_AELIG_L = 5;
- public static final int ID_AELIG_U = 6;
- public static final int ID_AGRAVE_L = 7;
- public static final int ID_AGRAVE_U = 8;
- public static final int ID_ALEFSYM = 9;
- public static final int ID_ALPHA_L = 10;
- public static final int ID_ALPHA_U = 11;
- public static final int ID_AMP = 12;
- public static final int ID_AND = 13;
- public static final int ID_ANG = 14;
- public static final int ID_ARING_L = 15;
- public static final int ID_ARING_U = 16;
- public static final int ID_ASYMP = 17;
- public static final int ID_ATILDE_L = 18;
- public static final int ID_ATILDE_U = 19;
- public static final int ID_AUML_L = 20;
- public static final int ID_AUML_U = 21;
- public static final int ID_BDQUO = 22;
- public static final int ID_BETA_L = 23;
- public static final int ID_BETA_U = 24;
- public static final int ID_BRVBAR = 25;
- public static final int ID_BULL = 26;
- public static final int ID_CAP = 27;
- public static final int ID_CCEDIL_L = 28;
- public static final int ID_CCEDIL_U = 29;
- public static final int ID_CEDIL = 30;
- public static final int ID_CENT = 31;
- public static final int ID_CHI_L = 32;
- public static final int ID_CHI_U = 33;
- public static final int ID_CIRC = 34;
- public static final int ID_CLUBS = 35;
- public static final int ID_CONG = 36;
- public static final int ID_COPY = 37;
- public static final int ID_CRARR = 38;
- public static final int ID_CUP = 39;
- public static final int ID_CURREN = 40;
- public static final int ID_DAGGER_L = 41;
- public static final int ID_DAGGER_U = 42;
- public static final int ID_DARR_L = 43;
- public static final int ID_DARR_U = 44;
- public static final int ID_DEG = 45;
- public static final int ID_DELTA_L = 46;
- public static final int ID_DELTA_U = 47;
- public static final int ID_DIAMS = 48;
- public static final int ID_DIVIDE = 49;
- public static final int ID_EACUTE_L = 50;
- public static final int ID_EACUTE_U = 51;
- public static final int ID_ECIRC_L = 52;
- public static final int ID_ECIRC_U = 53;
- public static final int ID_EGRAVE_L = 54;
- public static final int ID_EGRAVE_U = 55;
- public static final int ID_EMPTY = 56;
- public static final int ID_EMSP = 57;
- public static final int ID_ENSP = 58;
- public static final int ID_EPSILON_L = 59;
- public static final int ID_EPSILON_U = 60;
- public static final int ID_EQUIV = 61;
- public static final int ID_ETA_L = 62;
- public static final int ID_ETA_U = 63;
- public static final int ID_ETH_L = 64;
- public static final int ID_ETH_U = 65;
- public static final int ID_EUML_L = 66;
- public static final int ID_EUML_U = 67;
- public static final int ID_EURO = 68;
- public static final int ID_EXIST = 69;
- public static final int ID_FNOF = 70;
- public static final int ID_FORALL = 71;
- public static final int ID_FRAC12 = 72;
- public static final int ID_FRAC14 = 73;
- public static final int ID_FRAC34 = 74;
- public static final int ID_FRASL = 75;
- public static final int ID_GAMMA_L = 76;
- public static final int ID_GAMMA_U = 77;
- public static final int ID_GE = 78;
- public static final int ID_GT = 79;
- public static final int ID_HARR_L = 80;
- public static final int ID_HARR_U = 81;
- public static final int ID_HEARTS = 82;
- public static final int ID_HELLIP = 83;
- public static final int ID_IACUTE_L = 84;
- public static final int ID_IACUTE_U = 85;
- public static final int ID_ICIRC_L = 86;
- public static final int ID_ICIRC_U = 87;
- public static final int ID_IEXCL = 88;
- public static final int ID_IGRAVE_L = 89;
- public static final int ID_IGRAVE_U = 90;
- public static final int ID_IMAGE = 91;
- public static final int ID_INFIN = 92;
- public static final int ID_INT = 93;
- public static final int ID_IOTA_L = 94;
- public static final int ID_IOTA_U = 95;
- public static final int ID_IQUEST = 96;
- public static final int ID_ISIN = 97;
- public static final int ID_IUML_L = 98;
- public static final int ID_IUML_U = 99;
- public static final int ID_KAPPA_L = 100;
- public static final int ID_KAPPA_U = 101;
- public static final int ID_LAMBDA_L = 102;
- public static final int ID_LAMBDA_U = 103;
- public static final int ID_LANG = 104;
- public static final int ID_LAQUO = 105;
- public static final int ID_LARR_L = 106;
- public static final int ID_LARR_U = 107;
- public static final int ID_LCEIL = 108;
- public static final int ID_LDQUO = 109;
- public static final int ID_LE = 110;
- public static final int ID_LFLOOR = 111;
- public static final int ID_LOWAST = 112;
- public static final int ID_LOZ = 113;
- public static final int ID_LRM = 114;
- public static final int ID_LSAQUO = 115;
- public static final int ID_LSQUO = 116;
- public static final int ID_LT = 117;
- public static final int ID_MACR = 118;
- public static final int ID_MDASH = 119;
- public static final int ID_MICRO = 120;
- public static final int ID_MIDDOT = 121;
- public static final int ID_MINUS = 122;
- public static final int ID_MU_L = 123;
- public static final int ID_MU_U = 124;
- public static final int ID_NABLA = 125;
- public static final int ID_NBSP = 126;
- public static final int ID_NDASH = 127;
- public static final int ID_NE = 128;
- public static final int ID_NI = 129;
- public static final int ID_NOT = 130;
- public static final int ID_NOTIN = 131;
- public static final int ID_NSUB = 132;
- public static final int ID_NTILDE_L = 133;
- public static final int ID_NTILDE_U = 134;
- public static final int ID_NU_L = 135;
- public static final int ID_NU_U = 136;
- public static final int ID_OACUTE_L = 137;
- public static final int ID_OACUTE_U = 138;
- public static final int ID_OCIRC_L = 139;
- public static final int ID_OCIRC_U = 140;
- public static final int ID_OELIG_L = 141;
- public static final int ID_OELIG_U = 142;
- public static final int ID_OGRAVE_L = 143;
- public static final int ID_OGRAVE_U = 144;
- public static final int ID_OLINE = 145;
- public static final int ID_OMEGA_L = 146;
- public static final int ID_OMEGA_U = 147;
- public static final int ID_OMICRON_L = 148;
- public static final int ID_OMICRON_U = 149;
- public static final int ID_OPLUS = 150;
- public static final int ID_OR = 151;
- public static final int ID_ORDF = 152;
- public static final int ID_ORDM = 153;
- public static final int ID_OSLASH_L = 154;
- public static final int ID_OSLASH_U = 155;
- public static final int ID_OTILDE_L = 156;
- public static final int ID_OTILDE_U = 157;
- public static final int ID_OTIMES = 158;
- public static final int ID_OUML_L = 159;
- public static final int ID_OUML_U = 160;
- public static final int ID_PARA = 161;
- public static final int ID_PART = 162;
- public static final int ID_PERMIL = 163;
- public static final int ID_PERP = 164;
- public static final int ID_PHI_L = 165;
- public static final int ID_PHI_U = 166;
- public static final int ID_PIV = 167;
- public static final int ID_PI_L = 168;
- public static final int ID_PI_U = 169;
- public static final int ID_PLUSMN = 170;
- public static final int ID_POUND = 171;
- public static final int ID_PRIME_L = 172;
- public static final int ID_PRIME_U = 173;
- public static final int ID_PROD = 174;
- public static final int ID_PROP = 175;
- public static final int ID_PSI_L = 176;
- public static final int ID_PSI_U = 177;
- public static final int ID_QUOT = 178;
- public static final int ID_RADIC = 179;
- public static final int ID_RANG = 180;
- public static final int ID_RAQUO = 181;
- public static final int ID_RARR_L = 182;
- public static final int ID_RARR_U = 183;
- public static final int ID_RCEIL = 184;
- public static final int ID_RDQUO = 185;
- public static final int ID_REAL = 186;
- public static final int ID_REG = 187;
- public static final int ID_RFLOOR = 188;
- public static final int ID_RHO_L = 189;
- public static final int ID_RHO_U = 190;
- public static final int ID_RLM = 191;
- public static final int ID_RSAQUO = 192;
- public static final int ID_RSQUO = 193;
- public static final int ID_SBQUO = 194;
- public static final int ID_SCARON_L = 195;
- public static final int ID_SCARON_U = 196;
- public static final int ID_SDOT = 197;
- public static final int ID_SECT = 198;
- public static final int ID_SHY = 199;
- public static final int ID_SIGMAF = 200;
- public static final int ID_SIGMA_L = 201;
- public static final int ID_SIGMA_U = 202;
- public static final int ID_SIM = 203;
- public static final int ID_SPADES = 204;
- public static final int ID_SUB = 205;
- public static final int ID_SUBE = 206;
- public static final int ID_SUM = 207;
- public static final int ID_SUP = 208;
- public static final int ID_SUP1 = 209;
- public static final int ID_SUP2 = 210;
- public static final int ID_SUP3 = 211;
- public static final int ID_SUPE = 212;
- public static final int ID_SZLIG = 213;
- public static final int ID_TAU_L = 214;
- public static final int ID_TAU_U = 215;
- public static final int ID_THERE4 = 216;
- public static final int ID_THETASYM = 217;
- public static final int ID_THETA_L = 218;
- public static final int ID_THETA_U = 219;
- public static final int ID_THINSP = 220;
- public static final int ID_THORN_L = 221;
- public static final int ID_THORN_U = 222;
- public static final int ID_TILDE = 223;
- public static final int ID_TIMES = 224;
- public static final int ID_TRADE = 225;
- public static final int ID_UACUTE_L = 226;
- public static final int ID_UACUTE_U = 227;
- public static final int ID_UARR_L = 228;
- public static final int ID_UARR_U = 229;
- public static final int ID_UCIRC_L = 230;
- public static final int ID_UCIRC_U = 231;
- public static final int ID_UGRAVE_L = 232;
- public static final int ID_UGRAVE_U = 233;
- public static final int ID_UML = 234;
- public static final int ID_UPSIH = 235;
- public static final int ID_UPSILON_L = 236;
- public static final int ID_UPSILON_U = 237;
- public static final int ID_UUML_L = 238;
- public static final int ID_UUML_U = 239;
- public static final int ID_WEIERP = 240;
- public static final int ID_XI_L = 241;
- public static final int ID_XI_U = 242;
- public static final int ID_YACUTE_L = 243;
- public static final int ID_YACUTE_U = 244;
- public static final int ID_YEN = 245;
- public static final int ID_YUML_L = 246;
- public static final int ID_YUML_U = 247;
- public static final int ID_ZETA_L = 248;
- public static final int ID_ZETA_U = 249;
- public static final int ID_ZWJ = 250;
- public static final int ID_ZWNJ = 251;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 252.
- // -- 5/24/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_AACUTE_L] = AACUTE_L;
- names[Ids.ID_AACUTE_U] = AACUTE_U;
- names[Ids.ID_ACIRC_L] = ACIRC_L;
- names[Ids.ID_ACIRC_U] = ACIRC_U;
- names[Ids.ID_ACUTE] = ACUTE;
- names[Ids.ID_AELIG_L] = AELIG_L;
- names[Ids.ID_AELIG_U] = AELIG_U;
- names[Ids.ID_AGRAVE_L] = AGRAVE_L;
- names[Ids.ID_AGRAVE_U] = AGRAVE_U;
- names[Ids.ID_ALEFSYM] = ALEFSYM;
- names[Ids.ID_ALPHA_L] = ALPHA_L;
- names[Ids.ID_ALPHA_U] = ALPHA_U;
- names[Ids.ID_AMP] = AMP;
- names[Ids.ID_AND] = AND;
- names[Ids.ID_ANG] = ANG;
- names[Ids.ID_ARING_L] = ARING_L;
- names[Ids.ID_ARING_U] = ARING_U;
- names[Ids.ID_ASYMP] = ASYMP;
- names[Ids.ID_ATILDE_L] = ATILDE_L;
- names[Ids.ID_ATILDE_U] = ATILDE_U;
- names[Ids.ID_AUML_L] = AUML_L;
- names[Ids.ID_AUML_U] = AUML_U;
- names[Ids.ID_BDQUO] = BDQUO;
- names[Ids.ID_BETA_L] = BETA_L;
- names[Ids.ID_BETA_U] = BETA_U;
- names[Ids.ID_BRVBAR] = BRVBAR;
- names[Ids.ID_BULL] = BULL;
- names[Ids.ID_CAP] = CAP;
- names[Ids.ID_CCEDIL_L] = CCEDIL_L;
- names[Ids.ID_CCEDIL_U] = CCEDIL_U;
- names[Ids.ID_CEDIL] = CEDIL;
- names[Ids.ID_CENT] = CENT;
- names[Ids.ID_CHI_L] = CHI_L;
- names[Ids.ID_CHI_U] = CHI_U;
- names[Ids.ID_CIRC] = CIRC;
- names[Ids.ID_CLUBS] = CLUBS;
- names[Ids.ID_CONG] = CONG;
- names[Ids.ID_COPY] = COPY;
- names[Ids.ID_CRARR] = CRARR;
- names[Ids.ID_CUP] = CUP;
- names[Ids.ID_CURREN] = CURREN;
- names[Ids.ID_DAGGER_L] = DAGGER_L;
- names[Ids.ID_DAGGER_U] = DAGGER_U;
- names[Ids.ID_DARR_L] = DARR_L;
- names[Ids.ID_DARR_U] = DARR_U;
- names[Ids.ID_DEG] = DEG;
- names[Ids.ID_DELTA_L] = DELTA_L;
- names[Ids.ID_DELTA_U] = DELTA_U;
- names[Ids.ID_DIAMS] = DIAMS;
- names[Ids.ID_DIVIDE] = DIVIDE;
- names[Ids.ID_EACUTE_L] = EACUTE_L;
- names[Ids.ID_EACUTE_U] = EACUTE_U;
- names[Ids.ID_ECIRC_L] = ECIRC_L;
- names[Ids.ID_ECIRC_U] = ECIRC_U;
- names[Ids.ID_EGRAVE_L] = EGRAVE_L;
- names[Ids.ID_EGRAVE_U] = EGRAVE_U;
- names[Ids.ID_EMPTY] = EMPTY;
- names[Ids.ID_EMSP] = EMSP;
- names[Ids.ID_ENSP] = ENSP;
- names[Ids.ID_EPSILON_L] = EPSILON_L;
- names[Ids.ID_EPSILON_U] = EPSILON_U;
- names[Ids.ID_EQUIV] = EQUIV;
- names[Ids.ID_ETA_L] = ETA_L;
- names[Ids.ID_ETA_U] = ETA_U;
- names[Ids.ID_ETH_L] = ETH_L;
- names[Ids.ID_ETH_U] = ETH_U;
- names[Ids.ID_EUML_L] = EUML_L;
- names[Ids.ID_EUML_U] = EUML_U;
- names[Ids.ID_EURO] = EURO;
- names[Ids.ID_EXIST] = EXIST;
- names[Ids.ID_FNOF] = FNOF;
- names[Ids.ID_FORALL] = FORALL;
- names[Ids.ID_FRAC12] = FRAC12;
- names[Ids.ID_FRAC14] = FRAC14;
- names[Ids.ID_FRAC34] = FRAC34;
- names[Ids.ID_FRASL] = FRASL;
- names[Ids.ID_GAMMA_L] = GAMMA_L;
- names[Ids.ID_GAMMA_U] = GAMMA_U;
- names[Ids.ID_GE] = GE;
- names[Ids.ID_GT] = GT;
- names[Ids.ID_HARR_L] = HARR_L;
- names[Ids.ID_HARR_U] = HARR_U;
- names[Ids.ID_HEARTS] = HEARTS;
- names[Ids.ID_HELLIP] = HELLIP;
- names[Ids.ID_IACUTE_L] = IACUTE_L;
- names[Ids.ID_IACUTE_U] = IACUTE_U;
- names[Ids.ID_ICIRC_L] = ICIRC_L;
- names[Ids.ID_ICIRC_U] = ICIRC_U;
- names[Ids.ID_IEXCL] = IEXCL;
- names[Ids.ID_IGRAVE_L] = IGRAVE_L;
- names[Ids.ID_IGRAVE_U] = IGRAVE_U;
- names[Ids.ID_IMAGE] = IMAGE;
- names[Ids.ID_INFIN] = INFIN;
- names[Ids.ID_INT] = INT;
- names[Ids.ID_IOTA_L] = IOTA_L;
- names[Ids.ID_IOTA_U] = IOTA_U;
- names[Ids.ID_IQUEST] = IQUEST;
- names[Ids.ID_ISIN] = ISIN;
- names[Ids.ID_IUML_L] = IUML_L;
- names[Ids.ID_IUML_U] = IUML_U;
- names[Ids.ID_KAPPA_L] = KAPPA_L;
- names[Ids.ID_KAPPA_U] = KAPPA_U;
- names[Ids.ID_LAMBDA_L] = LAMBDA_L;
- names[Ids.ID_LAMBDA_U] = LAMBDA_U;
- names[Ids.ID_LANG] = LANG;
- names[Ids.ID_LAQUO] = LAQUO;
- names[Ids.ID_LARR_L] = LARR_L;
- names[Ids.ID_LARR_U] = LARR_U;
- names[Ids.ID_LCEIL] = LCEIL;
- names[Ids.ID_LDQUO] = LDQUO;
- names[Ids.ID_LE] = LE;
- names[Ids.ID_LFLOOR] = LFLOOR;
- names[Ids.ID_LOWAST] = LOWAST;
- names[Ids.ID_LOZ] = LOZ;
- names[Ids.ID_LRM] = LRM;
- names[Ids.ID_LSAQUO] = LSAQUO;
- names[Ids.ID_LSQUO] = LSQUO;
- names[Ids.ID_LT] = LT;
- names[Ids.ID_MACR] = MACR;
- names[Ids.ID_MDASH] = MDASH;
- names[Ids.ID_MICRO] = MICRO;
- names[Ids.ID_MIDDOT] = MIDDOT;
- names[Ids.ID_MINUS] = MINUS;
- names[Ids.ID_MU_L] = MU_L;
- names[Ids.ID_MU_U] = MU_U;
- names[Ids.ID_NABLA] = NABLA;
- names[Ids.ID_NBSP] = NBSP;
- names[Ids.ID_NDASH] = NDASH;
- names[Ids.ID_NE] = NE;
- names[Ids.ID_NI] = NI;
- names[Ids.ID_NOT] = NOT;
- names[Ids.ID_NOTIN] = NOTIN;
- names[Ids.ID_NSUB] = NSUB;
- names[Ids.ID_NTILDE_L] = NTILDE_L;
- names[Ids.ID_NTILDE_U] = NTILDE_U;
- names[Ids.ID_NU_L] = NU_L;
- names[Ids.ID_NU_U] = NU_U;
- names[Ids.ID_OACUTE_L] = OACUTE_L;
- names[Ids.ID_OACUTE_U] = OACUTE_U;
- names[Ids.ID_OCIRC_L] = OCIRC_L;
- names[Ids.ID_OCIRC_U] = OCIRC_U;
- names[Ids.ID_OELIG_L] = OELIG_L;
- names[Ids.ID_OELIG_U] = OELIG_U;
- names[Ids.ID_OGRAVE_L] = OGRAVE_L;
- names[Ids.ID_OGRAVE_U] = OGRAVE_U;
- names[Ids.ID_OLINE] = OLINE;
- names[Ids.ID_OMEGA_L] = OMEGA_L;
- names[Ids.ID_OMEGA_U] = OMEGA_U;
- names[Ids.ID_OMICRON_L] = OMICRON_L;
- names[Ids.ID_OMICRON_U] = OMICRON_U;
- names[Ids.ID_OPLUS] = OPLUS;
- names[Ids.ID_OR] = OR;
- names[Ids.ID_ORDF] = ORDF;
- names[Ids.ID_ORDM] = ORDM;
- names[Ids.ID_OSLASH_L] = OSLASH_L;
- names[Ids.ID_OSLASH_U] = OSLASH_U;
- names[Ids.ID_OTILDE_L] = OTILDE_L;
- names[Ids.ID_OTILDE_U] = OTILDE_U;
- names[Ids.ID_OTIMES] = OTIMES;
- names[Ids.ID_OUML_L] = OUML_L;
- names[Ids.ID_OUML_U] = OUML_U;
- names[Ids.ID_PARA] = PARA;
- names[Ids.ID_PART] = PART;
- names[Ids.ID_PERMIL] = PERMIL;
- names[Ids.ID_PERP] = PERP;
- names[Ids.ID_PHI_L] = PHI_L;
- names[Ids.ID_PHI_U] = PHI_U;
- names[Ids.ID_PIV] = PIV;
- names[Ids.ID_PI_L] = PI_L;
- names[Ids.ID_PI_U] = PI_U;
- names[Ids.ID_PLUSMN] = PLUSMN;
- names[Ids.ID_POUND] = POUND;
- names[Ids.ID_PRIME_L] = PRIME_L;
- names[Ids.ID_PRIME_U] = PRIME_U;
- names[Ids.ID_PROD] = PROD;
- names[Ids.ID_PROP] = PROP;
- names[Ids.ID_PSI_L] = PSI_L;
- names[Ids.ID_PSI_U] = PSI_U;
- names[Ids.ID_QUOT] = QUOT;
- names[Ids.ID_RADIC] = RADIC;
- names[Ids.ID_RANG] = RANG;
- names[Ids.ID_RAQUO] = RAQUO;
- names[Ids.ID_RARR_L] = RARR_L;
- names[Ids.ID_RARR_U] = RARR_U;
- names[Ids.ID_RCEIL] = RCEIL;
- names[Ids.ID_RDQUO] = RDQUO;
- names[Ids.ID_REAL] = REAL;
- names[Ids.ID_REG] = REG;
- names[Ids.ID_RFLOOR] = RFLOOR;
- names[Ids.ID_RHO_L] = RHO_L;
- names[Ids.ID_RHO_U] = RHO_U;
- names[Ids.ID_RLM] = RLM;
- names[Ids.ID_RSAQUO] = RSAQUO;
- names[Ids.ID_RSQUO] = RSQUO;
- names[Ids.ID_SBQUO] = SBQUO;
- names[Ids.ID_SCARON_L] = SCARON_L;
- names[Ids.ID_SCARON_U] = SCARON_U;
- names[Ids.ID_SDOT] = SDOT;
- names[Ids.ID_SECT] = SECT;
- names[Ids.ID_SHY] = SHY;
- names[Ids.ID_SIGMAF] = SIGMAF;
- names[Ids.ID_SIGMA_L] = SIGMA_L;
- names[Ids.ID_SIGMA_U] = SIGMA_U;
- names[Ids.ID_SIM] = SIM;
- names[Ids.ID_SPADES] = SPADES;
- names[Ids.ID_SUB] = SUB;
- names[Ids.ID_SUBE] = SUBE;
- names[Ids.ID_SUM] = SUM;
- names[Ids.ID_SUP] = SUP;
- names[Ids.ID_SUP1] = SUP1;
- names[Ids.ID_SUP2] = SUP2;
- names[Ids.ID_SUP3] = SUP3;
- names[Ids.ID_SUPE] = SUPE;
- names[Ids.ID_SZLIG] = SZLIG;
- names[Ids.ID_TAU_L] = TAU_L;
- names[Ids.ID_TAU_U] = TAU_U;
- names[Ids.ID_THERE4] = THERE4;
- names[Ids.ID_THETASYM] = THETASYM;
- names[Ids.ID_THETA_L] = THETA_L;
- names[Ids.ID_THETA_U] = THETA_U;
- names[Ids.ID_THINSP] = THINSP;
- names[Ids.ID_THORN_L] = THORN_L;
- names[Ids.ID_THORN_U] = THORN_U;
- names[Ids.ID_TILDE] = TILDE;
- names[Ids.ID_TIMES] = TIMES;
- names[Ids.ID_TRADE] = TRADE;
- names[Ids.ID_UACUTE_L] = UACUTE_L;
- names[Ids.ID_UACUTE_U] = UACUTE_U;
- names[Ids.ID_UARR_L] = UARR_L;
- names[Ids.ID_UARR_U] = UARR_U;
- names[Ids.ID_UCIRC_L] = UCIRC_L;
- names[Ids.ID_UCIRC_U] = UCIRC_U;
- names[Ids.ID_UGRAVE_L] = UGRAVE_L;
- names[Ids.ID_UGRAVE_U] = UGRAVE_U;
- names[Ids.ID_UML] = UML;
- names[Ids.ID_UPSIH] = UPSIH;
- names[Ids.ID_UPSILON_L] = UPSILON_L;
- names[Ids.ID_UPSILON_U] = UPSILON_U;
- names[Ids.ID_UUML_L] = UUML_L;
- names[Ids.ID_UUML_U] = UUML_U;
- names[Ids.ID_WEIERP] = WEIERP;
- names[Ids.ID_XI_L] = XI_L;
- names[Ids.ID_XI_U] = XI_U;
- names[Ids.ID_YACUTE_L] = YACUTE_L;
- names[Ids.ID_YACUTE_U] = YACUTE_U;
- names[Ids.ID_YEN] = YEN;
- names[Ids.ID_YUML_L] = YUML_L;
- names[Ids.ID_YUML_U] = YUML_U;
- names[Ids.ID_ZETA_L] = ZETA_L;
- names[Ids.ID_ZETA_U] = ZETA_U;
- names[Ids.ID_ZWJ] = ZWJ;
- names[Ids.ID_ZWNJ] = ZWNJ;
- }
- private static char[] values = null;
-
- static {
- values = new char[Ids.getNumOfIds()];
- values[Ids.ID_AACUTE_L] = 225;
- values[Ids.ID_AACUTE_U] = 193;
- values[Ids.ID_ACIRC_L] = 226;
- values[Ids.ID_ACIRC_U] = 194;
- values[Ids.ID_ACUTE] = 180;
- values[Ids.ID_AELIG_L] = 230;
- values[Ids.ID_AELIG_U] = 198;
- values[Ids.ID_AGRAVE_L] = 224;
- values[Ids.ID_AGRAVE_U] = 192;
- values[Ids.ID_ALEFSYM] = 8501;
- values[Ids.ID_ALPHA_L] = 945;
- values[Ids.ID_ALPHA_U] = 913;
- values[Ids.ID_AMP] = 38;
- values[Ids.ID_AND] = 8743;
- values[Ids.ID_ANG] = 8736;
- values[Ids.ID_ARING_L] = 229;
- values[Ids.ID_ARING_U] = 197;
- values[Ids.ID_ASYMP] = 8776;
- values[Ids.ID_ATILDE_L] = 227;
- values[Ids.ID_ATILDE_U] = 195;
- values[Ids.ID_AUML_L] = 228;
- values[Ids.ID_AUML_U] = 196;
- values[Ids.ID_BDQUO] = 8222;
- values[Ids.ID_BETA_L] = 946;
- values[Ids.ID_BETA_U] = 914;
- values[Ids.ID_BRVBAR] = 166;
- values[Ids.ID_BULL] = 8226;
- values[Ids.ID_CAP] = 8745;
- values[Ids.ID_CCEDIL_L] = 231;
- values[Ids.ID_CCEDIL_U] = 199;
- values[Ids.ID_CEDIL] = 184;
- values[Ids.ID_CENT] = 162;
- values[Ids.ID_CHI_L] = 967;
- values[Ids.ID_CHI_U] = 935;
- values[Ids.ID_CIRC] = 710;
- values[Ids.ID_CLUBS] = 9827;
- values[Ids.ID_CONG] = 8773;
- values[Ids.ID_COPY] = 169;
- values[Ids.ID_CRARR] = 8629;
- values[Ids.ID_CUP] = 8746;
- values[Ids.ID_CURREN] = 164;
- values[Ids.ID_DAGGER_L] = 8224;
- values[Ids.ID_DAGGER_U] = 8225;
- values[Ids.ID_DARR_L] = 8595;
- values[Ids.ID_DARR_U] = 8659;
- values[Ids.ID_DEG] = 176;
- values[Ids.ID_DELTA_L] = 948;
- values[Ids.ID_DELTA_U] = 916;
- values[Ids.ID_DIAMS] = 9830;
- values[Ids.ID_DIVIDE] = 247;
- values[Ids.ID_EACUTE_L] = 233;
- values[Ids.ID_EACUTE_U] = 201;
- values[Ids.ID_ECIRC_L] = 234;
- values[Ids.ID_ECIRC_U] = 202;
- values[Ids.ID_EGRAVE_L] = 232;
- values[Ids.ID_EGRAVE_U] = 200;
- values[Ids.ID_EMPTY] = 8709;
- values[Ids.ID_EMSP] = 8195;
- values[Ids.ID_ENSP] = 8194;
- values[Ids.ID_EPSILON_L] = 949;
- values[Ids.ID_EPSILON_U] = 917;
- values[Ids.ID_EQUIV] = 8801;
- values[Ids.ID_ETA_L] = 951;
- values[Ids.ID_ETA_U] = 919;
- values[Ids.ID_ETH_L] = 240;
- values[Ids.ID_ETH_U] = 208;
- values[Ids.ID_EUML_L] = 235;
- values[Ids.ID_EUML_U] = 203;
- values[Ids.ID_EURO] = 8364;
- values[Ids.ID_EXIST] = 8707;
- values[Ids.ID_FNOF] = 402;
- values[Ids.ID_FORALL] = 8704;
- values[Ids.ID_FRAC12] = 189;
- values[Ids.ID_FRAC14] = 188;
- values[Ids.ID_FRAC34] = 190;
- values[Ids.ID_FRASL] = 8260;
- values[Ids.ID_GAMMA_L] = 947;
- values[Ids.ID_GAMMA_U] = 915;
- values[Ids.ID_GE] = 8805;
- values[Ids.ID_GT] = 62;
- values[Ids.ID_HARR_L] = 8596;
- values[Ids.ID_HARR_U] = 8660;
- values[Ids.ID_HEARTS] = 9829;
- values[Ids.ID_HELLIP] = 8230;
- values[Ids.ID_IACUTE_L] = 237;
- values[Ids.ID_IACUTE_U] = 205;
- values[Ids.ID_ICIRC_L] = 238;
- values[Ids.ID_ICIRC_U] = 206;
- values[Ids.ID_IEXCL] = 161;
- values[Ids.ID_IGRAVE_L] = 236;
- values[Ids.ID_IGRAVE_U] = 204;
- values[Ids.ID_IMAGE] = 8465;
- values[Ids.ID_INFIN] = 8734;
- values[Ids.ID_INT] = 8747;
- values[Ids.ID_IOTA_L] = 953;
- values[Ids.ID_IOTA_U] = 921;
- values[Ids.ID_IQUEST] = 191;
- values[Ids.ID_ISIN] = 8712;
- values[Ids.ID_IUML_L] = 239;
- values[Ids.ID_IUML_U] = 207;
- values[Ids.ID_KAPPA_L] = 954;
- values[Ids.ID_KAPPA_U] = 922;
- values[Ids.ID_LAMBDA_L] = 955;
- values[Ids.ID_LAMBDA_U] = 923;
- values[Ids.ID_LANG] = 9001;
- values[Ids.ID_LAQUO] = 171;
- values[Ids.ID_LARR_L] = 8592;
- values[Ids.ID_LARR_U] = 8656;
- values[Ids.ID_LCEIL] = 8968;
- values[Ids.ID_LDQUO] = 8220;
- values[Ids.ID_LE] = 8804;
- values[Ids.ID_LFLOOR] = 8970;
- values[Ids.ID_LOWAST] = 8727;
- values[Ids.ID_LOZ] = 9674;
- values[Ids.ID_LRM] = 8206;
- values[Ids.ID_LSAQUO] = 8249;
- values[Ids.ID_LSQUO] = 8216;
- values[Ids.ID_LT] = 60;
- values[Ids.ID_MACR] = 175;
- values[Ids.ID_MDASH] = 8212;
- values[Ids.ID_MICRO] = 181;
- values[Ids.ID_MIDDOT] = 183;
- values[Ids.ID_MINUS] = 8722;
- values[Ids.ID_MU_L] = 956;
- values[Ids.ID_MU_U] = 924;
- values[Ids.ID_NABLA] = 8711;
- values[Ids.ID_NBSP] = 160;
- values[Ids.ID_NDASH] = 8211;
- values[Ids.ID_NE] = 8800;
- values[Ids.ID_NI] = 8715;
- values[Ids.ID_NOT] = 172;
- values[Ids.ID_NOTIN] = 8713;
- values[Ids.ID_NSUB] = 8836;
- values[Ids.ID_NTILDE_L] = 241;
- values[Ids.ID_NTILDE_U] = 209;
- values[Ids.ID_NU_L] = 957;
- values[Ids.ID_NU_U] = 925;
- values[Ids.ID_OACUTE_L] = 243;
- values[Ids.ID_OACUTE_U] = 211;
- values[Ids.ID_OCIRC_L] = 244;
- values[Ids.ID_OCIRC_U] = 212;
- values[Ids.ID_OELIG_L] = 339;
- values[Ids.ID_OELIG_U] = 338;
- values[Ids.ID_OGRAVE_L] = 242;
- values[Ids.ID_OGRAVE_U] = 210;
- values[Ids.ID_OLINE] = 8254;
- values[Ids.ID_OMEGA_L] = 969;
- values[Ids.ID_OMEGA_U] = 937;
- values[Ids.ID_OMICRON_L] = 959;
- values[Ids.ID_OMICRON_U] = 927;
- values[Ids.ID_OPLUS] = 8853;
- values[Ids.ID_OR] = 8744;
- values[Ids.ID_ORDF] = 170;
- values[Ids.ID_ORDM] = 186;
- values[Ids.ID_OSLASH_L] = 248;
- values[Ids.ID_OSLASH_U] = 216;
- values[Ids.ID_OTILDE_L] = 245;
- values[Ids.ID_OTILDE_U] = 213;
- values[Ids.ID_OTIMES] = 8855;
- values[Ids.ID_OUML_L] = 246;
- values[Ids.ID_OUML_U] = 214;
- values[Ids.ID_PARA] = 182;
- values[Ids.ID_PART] = 8706;
- values[Ids.ID_PERMIL] = 8240;
- values[Ids.ID_PERP] = 8869;
- values[Ids.ID_PHI_L] = 966;
- values[Ids.ID_PHI_U] = 934;
- values[Ids.ID_PIV] = 982;
- values[Ids.ID_PI_L] = 960;
- values[Ids.ID_PI_U] = 928;
- values[Ids.ID_PLUSMN] = 177;
- values[Ids.ID_POUND] = 163;
- values[Ids.ID_PRIME_L] = 8242;
- values[Ids.ID_PRIME_U] = 8243;
- values[Ids.ID_PROD] = 8719;
- values[Ids.ID_PROP] = 8733;
- values[Ids.ID_PSI_L] = 968;
- values[Ids.ID_PSI_U] = 936;
- values[Ids.ID_QUOT] = 34;
- values[Ids.ID_RADIC] = 8730;
- values[Ids.ID_RANG] = 9002;
- values[Ids.ID_RAQUO] = 187;
- values[Ids.ID_RARR_L] = 8594;
- values[Ids.ID_RARR_U] = 8658;
- values[Ids.ID_RCEIL] = 8969;
- values[Ids.ID_RDQUO] = 8221;
- values[Ids.ID_REAL] = 8476;
- values[Ids.ID_REG] = 174;
- values[Ids.ID_RFLOOR] = 8971;
- values[Ids.ID_RHO_L] = 961;
- values[Ids.ID_RHO_U] = 929;
- values[Ids.ID_RLM] = 8207;
- values[Ids.ID_RSAQUO] = 8250;
- values[Ids.ID_RSQUO] = 8217;
- values[Ids.ID_SBQUO] = 8218;
- values[Ids.ID_SCARON_L] = 353;
- values[Ids.ID_SCARON_U] = 352;
- values[Ids.ID_SDOT] = 8901;
- values[Ids.ID_SECT] = 167;
- values[Ids.ID_SHY] = 173;
- values[Ids.ID_SIGMAF] = 962;
- values[Ids.ID_SIGMA_L] = 963;
- values[Ids.ID_SIGMA_U] = 931;
- values[Ids.ID_SIM] = 8764;
- values[Ids.ID_SPADES] = 9824;
- values[Ids.ID_SUB] = 8834;
- values[Ids.ID_SUBE] = 8838;
- values[Ids.ID_SUM] = 8721;
- values[Ids.ID_SUP] = 8835;
- values[Ids.ID_SUP1] = 185;
- values[Ids.ID_SUP2] = 178;
- values[Ids.ID_SUP3] = 179;
- values[Ids.ID_SUPE] = 8839;
- values[Ids.ID_SZLIG] = 223;
- values[Ids.ID_TAU_L] = 964;
- values[Ids.ID_TAU_U] = 932;
- values[Ids.ID_THERE4] = 8756;
- values[Ids.ID_THETASYM] = 977;
- values[Ids.ID_THETA_L] = 952;
- values[Ids.ID_THETA_U] = 920;
- values[Ids.ID_THINSP] = 8201;
- values[Ids.ID_THORN_L] = 254;
- values[Ids.ID_THORN_U] = 222;
- values[Ids.ID_TILDE] = 732;
- values[Ids.ID_TIMES] = 215;
- values[Ids.ID_TRADE] = 8482;
- values[Ids.ID_UACUTE_L] = 250;
- values[Ids.ID_UACUTE_U] = 218;
- values[Ids.ID_UARR_L] = 8593;
- values[Ids.ID_UARR_U] = 8657;
- values[Ids.ID_UCIRC_L] = 251;
- values[Ids.ID_UCIRC_U] = 219;
- values[Ids.ID_UGRAVE_L] = 249;
- values[Ids.ID_UGRAVE_U] = 217;
- values[Ids.ID_UML] = 168;
- values[Ids.ID_UPSIH] = 978;
- values[Ids.ID_UPSILON_L] = 965;
- values[Ids.ID_UPSILON_U] = 933;
- values[Ids.ID_UUML_L] = 252;
- values[Ids.ID_UUML_U] = 220;
- values[Ids.ID_WEIERP] = 8472;
- values[Ids.ID_XI_L] = 958;
- values[Ids.ID_XI_U] = 926;
- values[Ids.ID_YACUTE_L] = 253;
- values[Ids.ID_YACUTE_U] = 221;
- values[Ids.ID_YEN] = 165;
- values[Ids.ID_YUML_L] = 255;
- values[Ids.ID_YUML_U] = 376;
- values[Ids.ID_ZETA_L] = 950;
- values[Ids.ID_ZETA_U] = 918;
- values[Ids.ID_ZWJ] = 8205;
- values[Ids.ID_ZWNJ] = 8204;
- }
-
- /**
- */
- public EntityCollection() {
- super(names, STRICT_CASE);
- }
-
- /**
- * Create an entity declaration.
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param attrName java.lang.String
- */
- protected CMNode create(String entityName) {
- int id = getID(entityName);
- if (id == ID_UNKNOWN)
- return null;
-
- String value = String.valueOf(values[id]);
- HTMLEntityDeclImpl dec = new HTMLEntityDeclImpl(entityName, value);
-
- return dec;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.java
deleted file mode 100644
index daef5ce3be..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HCMDocImpl.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMDocument implementation for the HTML.
- */
-class HCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespaceImpl namespace = null;
- private ElementCollection elements = null;
- private EntityCollection entities = null;
- private AttributeCollection attributes = null;
-
- /**
- */
- public HCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName);
- namespace = targetNamespace;
- attributes = new AttributeCollection();
- elements = new ElementCollection(attributes);
- entities = new EntityCollection();
- }
-
- AttributeCollection getAttributes() {
- return attributes;
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getEntities() {
- return entities;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- if (entities == null)
- return null;
- return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
deleted file mode 100644
index c03b2ec51d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttrDeclImpl.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation class of {@link <code>HTMLAttributeDeclaration</code>} interface.<br>
- */
-class HTMLAttrDeclImpl extends CMNodeImpl implements HTMLAttributeDeclaration {
-
- private HTMLCMDataTypeImpl type = null;
- private int usage = 0;
-
- /**
- */
- public HTMLAttrDeclImpl(String attrName, HTMLCMDataTypeImpl valueType, int valueUsage) {
- super(attrName);
- this.type = valueType;
-
- switch (valueUsage) {
- case OPTIONAL :
- case REQUIRED :
- case FIXED :
- case PROHIBITED :
- this.usage = valueUsage;
- break;
- default :
- // should warn...
- this.usage = OPTIONAL; // fall back
- break;
- }
- }
-
- /**
- * getAttrName method
- * @return java.lang.String
- */
- public String getAttrName() {
- return getNodeName();
- }
-
- /**
- * getAttrType method
- * @return CMDataType
- */
- public CMDataType getAttrType() {
- return type;
- }
-
- /**
- * @deprecated by superinterface
- */
- public String getDefaultValue() {
- if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
- return null;
- return type.getImpliedValue();
- }
-
- /**
- * @deprecated by superinterface
- */
- public Enumeration getEnumAttr() {
- Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
- return v.elements();
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- /**
- * @return int
- */
- public int getUsage() {
- return usage;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- else if (propertyName.equals(HTMLCMProperties.IS_SCRIPTABLE)) {
- return getAttrType().getDataTypeName() == HTMLCMDataType.SCRIPT ? new Boolean(true) : new Boolean(false);
- }
- return super.getProperty(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.java
deleted file mode 100644
index 1bff6f675a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLAttributeDeclaration.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.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMAttributeDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- */
-public interface HTMLAttributeDeclaration extends CMAttributeDeclaration {
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.java
deleted file mode 100644
index 34361dd96b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataType.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.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * HTML extension for data types.
- */
-public interface HTMLCMDataType extends CMDataType {
-
- /** Boolean; it should be defined in CMDataType. */
- public static final String BOOLEAN = "BOOLEAN"; //$NON-NLS-1$
- public static final String COLOR = "COLOR"; //$NON-NLS-1$
- public static final String EVENT = "EVENT"; //$NON-NLS-1$
- public static final String IDREFS = "IDREFS"; //$NON-NLS-1$
- /** Name; it should be defined in CMDataType. */
- public static final String NAME = "NAME"; //$NON-NLS-1$
- // Following types are just aliases.
- /** %Character; == CDATA */
- public static final String CHARACTER = CMDataType.CDATA;
- /** %Charset; == CDATA */
- public static final String CHARSET = CMDataType.CDATA;
- /** %Charsets; == CDATA */
- public static final String CHARSETS = CMDataType.CDATA;
- /** %ContentType; == CDATA */
- public static final String CONTENT_TYPE = CMDataType.CDATA;
- /** %Coords; == CDATA */
- public static final String COORDS = CMDataType.CDATA;
- /** %Datetime; == CDATA */
- public static final String DATETIME = CMDataType.CDATA;
- /** %FrameTarget; == CDATA */
- public static final String FRAME_TARGET = CMDataType.CDATA;
- /** %LanguageCode; == NAME */
- public static final String LANGUAGE_CODE = NAME;
- /** %Length; == CDATA */
- public static final String LENGTH = CMDataType.CDATA;
- /** %LinkTypes; == CDATA */
- public static final String LINK_TYPES = CMDataType.CDATA;
- /** %LIStyle; == CDATA */
- public static final String LI_STYLE = CMDataType.CDATA;
- /** %MediaDesc; == CDATA */
- public static final String MEDIA_DESC = CMDataType.CDATA;
- /** %MultiLength; == CDATA */
- public static final String MULTI_LENGTH = CMDataType.CDATA;
- /** %OLStyle; == CDATA */
- public static final String OL_STYLE = CMDataType.CDATA;
- /** %Pixles; == CDATA */
- public static final String PIXELS = CMDataType.CDATA;
- /** %Script; == EVENT */
- public static final String SCRIPT = EVENT;
- /** %StyleSheet; == EVENT */
- public static final String STYLE_SHEET = CMDataType.CDATA;
- /** %Text; == CDATA */
- public static final String TEXT = CMDataType.CDATA;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.java
deleted file mode 100644
index fe6e6881b7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDataTypeImpl.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.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLCMDataTypeImpl extends CMNodeImpl implements HTMLCMDataType {
-
- private int impliedValueKind = IMPLIED_VALUE_NONE;
- private String impliedValue = null;
- private final static String[] emptyArray = new String[0];
- private String[] enumValues = emptyArray;
- private String instanceValue = null;
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName) {
- super(typeName);
- }
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName, String instanceValue) {
- super(typeName);
- this.instanceValue = instanceValue;
- }
-
- /**
- * 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 instanceValue;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDataType
- */
- public String getDataTypeName() {
- return getNodeName();
- }
-
- /**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
- public String[] getEnumeratedValues() {
- return enumValues;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * Returns the implied value or null if none exists.
- */
- public String getImpliedValue() {
- return impliedValue;
- }
-
- /**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */
- public int getImpliedValueKind() {
- return impliedValueKind;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DATA_TYPE;
- }
-
- /**
- */
- void setEnumValues(String[] values) {
- enumValues = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- enumValues[i] = values[i];
- }
- }
-
- /**
- * package scope.
- */
- void setImpliedValue(int kind, String value) {
- switch (kind) {
- case IMPLIED_VALUE_FIXED :
- case IMPLIED_VALUE_DEFAULT :
- impliedValueKind = kind;
- impliedValue = value;
- break;
- case IMPLIED_VALUE_NONE :
- default :
- impliedValueKind = IMPLIED_VALUE_NONE;
- impliedValue = null; // maybe a null string?
- break;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.java
deleted file mode 100644
index 1af5fa2418..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocument.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.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-
-
-
-/**
- * HTML extension for CMDocument.
- * This interface provides some short hand methods to get declarations
- * by a name.
- */
-public interface HTMLCMDocument extends CMDocument {
-
- /**
- * A short hand method to get a element declaration for a HTML element.<br>
- * @param elementName java.lang.String
- */
- HTMLElementDeclaration getElementDeclaration(String elementName);
-
- /**
- * A short hand method to get a entity declaration of HTML documents.<br>
- * @param entityName java.lang.String
- */
- HTMLEntityDeclaration getEntityDeclaration(String entityName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.java
deleted file mode 100644
index 18e901eb5b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMDocumentFactory.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.contentmodel.chtml.CHCMDocImpl;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * INodeAdapter factory for HTML and JSP documents.
- */
-public final class HTMLCMDocumentFactory {
-
- private static Hashtable cmdocs = new Hashtable();
-
- static {
- CMNamespaceImpl h40ns = new CMNamespaceImpl(HTML40Namespace.HTML40_URI, HTML40Namespace.HTML40_TAG_PREFIX);
- CMNamespaceImpl j11ns = new CMNamespaceImpl(JSP11Namespace.JSP11_URI, JSP11Namespace.JSP_TAG_PREFIX);
-
- HCMDocImpl html40doc = new HCMDocImpl(CMDocType.HTML_DOC_TYPE, h40ns);
- CHCMDocImpl chtmldoc = new CHCMDocImpl(CMDocType.CHTML_DOC_TYPE, h40ns);
- JCMDocImpl jsp11doc = new JCMDocImpl(CMDocType.JSP11_DOC_TYPE, j11ns);
-
- cmdocs.put(CMDocType.HTML_DOC_TYPE, html40doc);
- cmdocs.put(CMDocType.CHTML_DOC_TYPE, chtmldoc);
- cmdocs.put(CMDocType.JSP11_DOC_TYPE, jsp11doc);
- }
-
- /**
- * HTMLCMAdapterFactory constructor.
- */
- private HTMLCMDocumentFactory() {
- super();
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- * @param cmtype java.lang.String
- */
- public static CMDocument getCMDocument(String cmtype) {
- Object obj = cmdocs.get(cmtype);
- if (obj == null)
- return null;
-
- return (CMDocument) obj;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.java
deleted file mode 100644
index 8538731aef..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLCMNode.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.core.internal.contentmodel;
-
-
-/**
- * In HTML Documents, name and value of an attribute/element/entity
- * should be treated ignoring theirs case. However, in XML documents,
- * they should be distinguished with sensitiveness of their case.
- * CMNode is basically designed to represent DTDs or Schemas for XML
- * documents. So, it doesn't have interfaces to retrieve such information.
- * However, declarations in the HTML CM should provide such information.
- * This intermediate interface is intended to provide whether ignore cases
- * or not.<br>
- */
-interface HTMLCMNode extends org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
- /**
- * Returns <code>true</code>, if declaration is for HTML attribute/element/entity.
- * Otherwise, returns <code>false</code>.
- * @return boolean
- */
- boolean shouldIgnoreCase();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
deleted file mode 100644
index 893c7d871c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElemDeclImpl.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Base class for all Hed???? classes.
- */
-abstract class HTMLElemDeclImpl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-
- // DTD
- protected CMNamedNodeMapImpl attributes = null;
- protected String typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- /** Never access this field directly. Instead, use getComplexTypeDefinition method. */
- private ComplexTypeDefinition typeDefinition = null;
- protected CMGroupImpl inclusion = null;
- protected CMGroupImpl exclusion = null;
- // advanced information
- protected CMNamedNodeMap prohibitedAncestors = null;
- protected int correctionType = CORRECT_NONE;
- protected int formatType = FORMAT_HTML;
- protected int layoutType = LAYOUT_NONE;
- protected int omitType = OMIT_NONE;
- protected boolean keepSpaces = false;
- protected boolean indentChild = false;
- protected ElementCollection elementCollection = null;
- protected AttributeCollection attributeCollection = null;
- protected final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- };
-
- /**
- * HTMLElemDeclImpl constructor.
- * In the HTML DTD, an element declaration has no specification
- * for its occurrence. Occurrence is specifed in content model, like
- * <code>(LI)+</code>. To avoid confusion (and complexity),
- * occurrence of an element declaration is always 1 (it means, min = 1 and
- * max = 1). Instead, occurrence of CMGroup represents actual occurrence
- * of the content.
- * <br>
- * @param name java.lang.String
- */
- public HTMLElemDeclImpl(String elementName, ElementCollection collection) {
- super(elementName, 1, 1);
- elementCollection = collection;
- attributeCollection = collection.getAttributeCollection();
- }
-
- /**
- */
- protected abstract void createAttributeDeclarations();
-
- private ComplexTypeDefinition createComplexTypeDefinition() {
- if (typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_CDATA) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_EMPTY) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_PCDATA))
- return null;
-
- ComplexTypeDefinitionFactory factory = ComplexTypeDefinitionFactory.getInstance();
- if (factory == null)
- return null; // fatal error.
-
- ComplexTypeDefinition def = factory.createTypeDefinition(typeDefinitionName, elementCollection);
- return def;
- }
-
- /**
- * Get an attribute declaration.
- */
- public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
- if (attributes == null) {
- createAttributeDeclarations();
- if (attributes == null)
- return null; // fail to create
- }
-
- CMNode cmnode = attributes.getNamedItem(attrName);
- if (cmnode == null) {
- return null;
- }
- else {
- return (HTMLAttributeDeclaration) cmnode; // already exists.
- }
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getAttributes() {
- if (attributes == null)
- createAttributeDeclarations(); // lazy eval.
- return attributes;
- }
-
- /**
- * Get an instance of complex type definition.
- */
- private ComplexTypeDefinition getComplexTypeDefinition() {
- if (typeDefinition == null)
- typeDefinition = createComplexTypeDefinition();
- return typeDefinition;
- }
-
- /**
- * Content.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and always return null.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMContent getContent() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContent() : null;
- }
-
- /**
- * Content type.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and return an appropriate type.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContentType() : CMElementDeclaration.CDATA;
- }
-
- /**
- * @see HTMLElementDeclaration#getCorrectionType
- */
- public int getCorrectionType() {
- return correctionType;
- }
-
- /**
- * HTML element doesn't have any data type. So, this method always
- * returns <code>null</code>.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMDataType getDataType() {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public String getElementName() {
- return getNodeName();
- }
-
- /**
- * Exclusion.
- * Almost elements don't have a exclusion.
- * Only classes those have exclusion should override this method.
- */
- public CMContent getExclusion() {
- return null;
- }
-
- /**
- * Default format type is <code>FORMAT_HTML</code>.<br>
- */
- public int getFormatType() {
- return formatType;
- }
-
- /**
- * Inclusion.
- * Almost elements don't have a inclusion.
- * Only classes those have inclusion should override this method.
- */
- public CMContent getInclusion() {
- return null;
- }
-
- /**
- */
- public int getLayoutType() {
- return layoutType;
- }
-
- /**
- * Line break hint is strongly related to layout type.
- * Indeed, in the C++DOM, it is determined from layout type only.
- * So, this implementation, as the default implementation for all declarations,
- * also determines from layout type only.<br>
- * @return int
- */
- public int getLineBreakHint() {
- switch (getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- return HTMLElementDeclaration.BREAK_AFTER_START;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- default :
- return HTMLElementDeclaration.BREAK_NONE;
- }
- }
-
- /**
- * No HTML element has local elements. So, this method always
- * returns an empty map.
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getLocalElements() {
- return EMPTY_MAP;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- /**
- */
- public int getOmitType() {
- return omitType;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- return EMPTY_MAP;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return true;
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null);
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return false;
- return pp.supports(this);
- }
-
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(true);
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null) ? def.getPrimaryCandidate() : null;
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return null;
- return pp.get(this);
- }
- }
-
- /**
- * Return element names which terminates this element.<br>
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return null;
- }
-
- /**
- * return true when the element is a JSP element.
- */
- public boolean isJSP() {
- return false;
- }
-
- /**
- * In some elements, such as APPLET, a source generator should indent child
- * elements that their parents. That is, a source generator should generate
- * source of APPLET and PARAMS like this:
- * <PRE>
- * &lt;APPLET ...&gt;
- * &lt;PARAM ... &gt;
- * &lt;PARAM ... &gt;
- * &lt;/APPLET&gt;
- * <PRE>
- * @return boolean
- */
- public boolean shouldIndentChildSource() {
- return indentChild;
- }
-
- /**
- * Most of elements can compact spaces in their child text nodes.
- * Some special elements should keep them in their source.
- * @return boolean
- */
- public boolean shouldKeepSpaces() {
- return keepSpaces;
- }
-
- /**
- * @return boolean
- */
- public boolean shouldTerminateAt(HTMLElementDeclaration nextElement) {
- Iterator i = getTerminators();
- if (i == null)
- return false;
- String nextName = nextElement.getElementName();
- while (i.hasNext()) {
- if (nextName.equals(i.next()))
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java
deleted file mode 100644
index 7fe71f3cb3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLElementDeclaration.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMElementDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- * In addition to this, some interfaces are added to this interface,
- * those are specially to HTML elements.<br>
- */
-public interface HTMLElementDeclaration extends CMElementDeclaration {
-
- /** Tag ommission; Not ommisible. */
- int OMIT_NONE = 0;
- /** Tag ommission; Both tags are ommisible. */
- int OMIT_BOTH = 1;
- /** Tag ommission; The end tag is ommisible. */
- int OMIT_END = 2;
- /** Tag ommission; The end tag is ommitted when created. */
- int OMIT_END_DEFAULT = 3;
- /** Tag ommission; The end tag must be omitted. */
- int OMIT_END_MUST = 4;
- /** Line Break; No break. */
- int BREAK_NONE = 10;
- /** Line Break; Break after the start tag. */
- int BREAK_AFTER_START = 11;
- /** Line Break; Break both before the start tagn and after the end tag. */
- int BREAK_BEFORE_START_AND_AFTER_END = 12;
- /* Layout */
- /** initial value; the value should never returns to client programs. */
- int LAYOUT_NONE = 100;
- int LAYOUT_BLOCK = 101;
- int LAYOUT_WRAP = 102;
- /** No wrap object; like IMG, APPLET,... */
- int LAYOUT_OBJECT = 103;
- /** BR */
- int LAYOUT_BREAK = 104;
- /** Hidden object; like HTML or HEAD */
- int LAYOUT_HIDDEN = 105;
- /* Correction */
- /** Correct; No correct. */
- int CORRECT_NONE = 1000;
- /** Correct; Meaningless when the content is empty. */
- int CORRECT_EMPTY = 1001;
- /** Correct; Meaningless when no attribut is set. */
- int CORRECT_NEUTRAL = 1002;
- /** Correct; Meaningless when same element is nested. */
- int CORRECT_DUPLICATED = 1003;
- /** Format; HTML */
- int FORMAT_HTML = 10000;
- /** Format; SSI */
- int FORMAT_SSI = 10001;
- /** Format; JSP script */
- int FORMAT_JSP_SCRIPT = 10002;
- /** Format; JSP directive */
- int FORMAT_JSP_DIRECTIVE = 10003;
- /** Format; XML */
- int FORMAT_XML = 10004;
- /** Format; MW */
- int FORMAT_MW = 10005;
-
- /**
- * A short hand method to get an attribute declaration of a HTML element.
- * @param attrName java.lang.String
- */
- HTMLAttributeDeclaration getAttributeDeclaration(String attrName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java
deleted file mode 100644
index 137647e699..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLEntityDeclImpl extends CMNodeImpl implements HTMLEntityDeclaration {
-
- private java.lang.String value = null;
-
- /**
- * CMEntityDeclImpl constructor comment.
- * @param entityName java.lang.String; Entity name.
- * @param entityValue java.lang.String; Value string.
- */
- public HTMLEntityDeclImpl(String entityName, String entityValue) {
- super(entityName);
- value = entityValue;
- }
-
- /**
- * getName method
- * @return java.lang.String
- */
- public String getName() {
- return getNodeName();
- }
-
- /**
- * Get CMNode type.<br>
- * @return int; Always return ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ENTITY_DECLARATION;
- }
-
- /**
- * getValue method
- * @return java.lang.String
- */
- public String getValue() {
- return value;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- * Entities in HTML documents are always treated with ignoring cases.
- * Because no special entities are defined in JSP 1.0, this method
- * can always return <code>true</code>.<br>
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- return super.getProperty(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.java
deleted file mode 100644
index 2663e23fcb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLEntityDeclaration.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.core.internal.contentmodel;
-
-
-
-/**
- * This interface is intended to be a public interface which has
- * interfaces defined in both of {@link <code>CMEntityDeclaration</code>}
- * and {@link <code>HTMLCMNode</code>}.<br>
- */
-public interface HTMLEntityDeclaration extends org.eclipse.wst.xml.core.internal.contentmodel.CMEntityDeclaration {
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.java
deleted file mode 100644
index 3553507f3a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTMLPropertyDeclaration.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.html.core.internal.contentmodel;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * This interface is commonly used in declaration implementation, and internal use.
- * Use getProperty() method for public use.
- */
-public interface HTMLPropertyDeclaration {
- /**
- * To determin the type, look up the following keywords in C++DOM/DTDParser.cpp:
- * <ul>
- * <li>CORRECT_DUPLICATED - <code>GROUP_NODUP</code></li>
- * <li>CORRECT_EMPTY - <code>GROUP_COMPACT</code></li>
- * <li>CORRECT_NEUTRAL - <code>GROUP_NEUTRAL</code></li>
- * <li>CORRECT_NONE - <code>(N/A)</code></li>
- * </ul>
- * @return int
- */
- int getCorrectionType();
- /**
- * Get the list of declarations those should be excluded from the content.<br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- CMContent getExclusion();
- /**
- * To determin the type, see the following files in the C++DOM:
- * ElementType.cpp - ElementType#setGroup().
- * Element.cpp - Element#getStartTag().
- * @return int
- */
- int getFormatType();
- /**
- * Get the list of declarations those should be included into the content.<br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- CMContent getInclusion();
- /**
- * To determin the type, look up the following keywords in C++DOM/DTDParser.cpp:
- * <ul>
- * <li>LAYOUT_BLOCK - <code>GROUP_BLOCK</code></li>
- * <li>LAYOUT_BREAK - <code>GROUP_BREAK</code></li>
- * <li>LAYOUT_HIDDEN - <code>GROUP_HIDDEN</code></li>
- * <li>LAYOUT_NONE - <code>(N/A)</code></li>
- * <li>LAYOUT_OBJECT - <code>GROUP_NOWRAP</code></li>
- * <li>LAYOUT_WRAP - <code>(N/A)</code></li>
- * </ul>
- * @return int
- */
- int getLayoutType();
- /**
- * To determine the type, see <code>Element::isBreakingBeforeElement()</code>
- * and <code>Element::isBreakingAfterElement()</code> defined in C++DOM/Element.cpp.<br>
- * @return int
- */
- int getLineBreakHint();
- /**
- * To determine the type, Check the HTML DTD.
- * And look up <code>GROUP_NOEND</code> in C++DOM/DTDParser.cpp.<br>
- * @return int
- */
- int getOmitType();
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap
- */
- CMNamedNodeMap getProhibitedAncestors();
- /**
- * return true when the element is a JSP element.
- */
- boolean isJSP();
- /**
- * @return boolean
- */
- boolean shouldIndentChildSource();
- /**
- * Some elements should keep spaces in its child text nodes.
- * For example, PRE and TEXTAREA. This method returns true,
- * if a target element is one of such elements.
- * @return boolean
- */
- boolean shouldKeepSpaces();
- /**
- * Returns <code>true</code>, if <code>nextElement</code> terminates
- * the current element.
- * Some elements like <code>P</code> terminates other <code>P</code>.
- * That is, when <code>&lt;P&gt;</code> appears at the next to <code>P</code>,
- * which end tags is omitted, it represents not only the beginning of the
- * new <code>P</code> element but also the end of the previous <code>P</code>.
- */
- boolean shouldTerminateAt(HTMLElementDeclaration nextElement);
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
deleted file mode 100644
index 9ce421f33a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedA.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * A.
- */
-final class HedA extends HedInlineContainer {
-
- /**
- */
- public HedA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.A, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %attrs;
- * (charset %Charset; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (rel %LinkTypes; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (directkey %Character; #IMPLIED)
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_TYPE, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_HREFLANG, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_REL, HTML40Namespace.ATTR_NAME_REV, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_DIRECTKEY, HTML40Namespace.ATTR_NAME_SHAPE, HTML40Namespace.ATTR_NAME_COORDS, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>A</code> has the exclusion.
- * It is <code>A</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode a = elementCollection.getNamedItem(HTML40Namespace.ElementName.A);
- if (a != null)
- exclusion.appendChild(a);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.A, HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.java
deleted file mode 100644
index 4f9b73c730..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedADDRESS.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ADDRESS.
- */
-final class HedADDRESS extends HTMLElemDeclImpl {
-
- /**
- */
- public HedADDRESS(ElementCollection collection) {
- super(HTML40Namespace.ElementName.ADDRESS, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java
deleted file mode 100644
index d8244cdb4b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAPPLET.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * APPLET.
- */
-final class HedAPPLET extends HTMLElemDeclImpl {
-
- /**
- */
- public HedAPPLET(ElementCollection collection) {
- super(HTML40Namespace.ElementName.APPLET, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %coreattrs;
- * (codebase %URI; #IMPLIED)
- * (archive CDATA #IMPLIED)
- * (code CDATA #IMPLIED)
- * (object CDATA #IMPLIED)
- * (alt %Text; #IMPLIED) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (width %Length; #REQUIRED)
- * (height %Length; #REQUIRED)
- * (align %IAlign; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mayscript (mayscript) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CODEBASE, HTML40Namespace.ATTR_NAME_ARCHIVE, HTML40Namespace.ATTR_NAME_CODE, HTML40Namespace.ATTR_NAME_OBJECT, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_MAYSCRIPT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // %align; ... should be defined locally.
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.java
deleted file mode 100644
index 567e6ce1f4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedAREA.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * AREA.
- */
-final class HedAREA extends HedEmpty {
-
- /**
- */
- public HedAREA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.AREA, collection);
- // LAYOUT_HIDDEN.
- // Because, AREA is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * AREA.
- * %attrs;
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (nohref (nohref) #IMPLIED)
- * (alt %Text; #REQUIRED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_SHAPE, HTML40Namespace.ATTR_NAME_COORDS, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_NOHREF, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.java
deleted file mode 100644
index 7417dae557..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASE.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * BASE.
- */
-final class HedBASE extends HedEmpty {
-
- /**
- */
- public HedBASE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BASE, collection);
- // LAYOUT_HIDDEN.
- // Because, BASE is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * BASE.
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_TARGET};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.java
deleted file mode 100644
index 01ccce0291..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBASEFONT.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * BASEFONT.
- */
-final class HedBASEFONT extends HedEmpty {
-
- /**
- */
- public HedBASEFONT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BASEFONT, collection);
- // LAYOUT_OBJECT - GROUP_NOWRAP.
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * BASEFONT.
- * (id ID #IMPLIED)
- * (size CDATA #REQUIRED) ... should be localy defined.
- * (color %Color; #IMPLIED)
- * (face CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_COLOR, HTML40Namespace.ATTR_NAME_FACE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (size CDATA #REQUIRED) ... should be localy defined.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.java
deleted file mode 100644
index 67c2609e9d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBDO.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * BDO.
- */
-final class HedBDO extends HedInlineContainer {
-
- /**
- */
- public HedBDO(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BDO, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %coreattrs;
- * (lang %LanguageCode; #IMPLIED)
- * (dir (ltr|rtl) #REQUIRED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_LANG};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (dir (ltr|rtl) #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_LTR, HTML40Namespace.ATTR_VALUE_RTL};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_DIR, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_DIR, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.java
deleted file mode 100644
index 03b0881c41..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBGSOUND.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.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-final class HedBGSOUND extends HedEmpty {
-
- public HedBGSOUND(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BGSOUND, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * (src, CDATA, #IMPLIED)
- * (loop, CDATA, #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return;
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
- // src
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_SRC);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
- // loop
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_INFINITE);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LOOP, atype, CMAttributeDeclaration.OPTIONAL);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LOOP, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.java
deleted file mode 100644
index b587b23202..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBLOCKQUOTE.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BLOCKQUOTE.
- */
-final class HedBLOCKQUOTE extends HedFlowContainer {
-
- /**
- */
- public HedBLOCKQUOTE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BLOCKQUOTE, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CITE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java
deleted file mode 100644
index ad529603ea..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBODY.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * BODY.
- */
-final class HedBODY extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.HEAD, HTML40Namespace.ElementName.BODY, HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.HTML};
-
- /**
- */
- public HedBODY(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BODY, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_BOTH;
- }
-
- /**
- * %attrs;
- * %bodycolors;
- * (onload %Script; #IMPLIED)
- * (onunload %Script; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (marginwidth %Pixels; #IMPLIED) ... D205514
- * (marginheight %Pixels; #IMPLIED) .. D205514
- * (topmargin, CDATA, #IMPLIED) ...... D205514
- * (bottommargin, CDATA, #IMPLIED) ... D205514
- * (leftmargin, CDATA, #IMPLIED) ..... D205514
- * (rightmargin, CDATA, #IMPLIED) .... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %bodycolors;
- attributeCollection.getBodycolors(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ONLOAD, HTML40Namespace.ATTR_NAME_ONUNLOAD, HTML40Namespace.ATTR_NAME_BACKGROUND,
- // <<D205514
- HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_TOPMARGIN, HTML40Namespace.ATTR_NAME_BOTTOMMARGIN, HTML40Namespace.ATTR_NAME_LEFTMARGIN, HTML40Namespace.ATTR_NAME_RIGHTMARGIN
- // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Inclusion.
- * "Lazy eval."<br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getInclusion() {
- if (inclusion != null)
- return inclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // (INS|DEL)
- inclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.INS, HTML40Namespace.ElementName.DEL};
- elementCollection.getDeclarations(inclusion, Arrays.asList(names).iterator());
- return inclusion;
- }
-
- /**
- * BODY has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.java
deleted file mode 100644
index 39749a5ae5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBR.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.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * BR.
- */
-final class HedBR extends HedEmpty {
-
- /**
- */
- public HedBR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BR, collection);
- // LAYOUT_BREAK.
- // Because, BR is GROUP_BREAK in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_BREAK;
- }
-
- /**
- * BR.
- * %coreattrs;
- * (clear (left | all | right | none) none)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // clear
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_CLEAR);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_CLEAR, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.java
deleted file mode 100644
index 6112d253ed..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedBUTTON.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BUTTON.
- */
-final class HedBUTTON extends HedFlowContainer {
-
- /**
- */
- public HedBUTTON(ElementCollection collection) {
- super(HTML40Namespace.ElementName.BUTTON, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * %reserved; ... empty.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (type (button|submit|reset) submit) ... should be defined locally.
- * (disabled (disabled) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type (button|submit|reset) submit) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_BUTTON, HTML40Namespace.ATTR_VALUE_SUBMIT, HTML40Namespace.ATTR_VALUE_RESET};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
- }
-
- /**
- * Exclusion.
- * <code>FORM</code> has the exclusion.
- * It is <code>FORM</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.A, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.ISINDEX, HTML40Namespace.ElementName.FIELDSET, HTML40Namespace.ElementName.IFRAME};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- elementCollection.getFormctrl(exclusion);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java
deleted file mode 100644
index 167086c6b3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCAPTION.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * CAPTION.
- */
-final class HedCAPTION extends HedInlineContainer {
-
- /**
- */
- public HedCAPTION(ElementCollection collection) {
- super(HTML40Namespace.ElementName.CAPTION, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (align %CAlign; #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForCaption();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.java
deleted file mode 100644
index 310a8758f2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCENTER.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * CENTER.
- */
-final class HedCENTER extends HedFlowContainer {
-
- /**
- */
- public HedCENTER(ElementCollection collection) {
- super(HTML40Namespace.ElementName.CENTER, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java
deleted file mode 100644
index e381ed3a09..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOL.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * COL.
- */
-final class HedCOL extends HedEmpty {
-
- /**
- */
- public HedCOL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.COL, collection);
- // LAYOUT_BLOCK.
- // Because, COL is GROUP_BLOCK in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * COL.
- * %attrs;
- * (span NUMBER 1)
- * (width %MultiLength; #IMPLIED) ... should be defined locally.
- * %cellhalign;
- * %cellvalign;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (span NUMBER 1)
- String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (width %MultiLength; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java
deleted file mode 100644
index 7bf229c62c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedCOLGROUP.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * COLGROUP.
- */
-final class HedCOLGROUP extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.COLGROUP, HTML40Namespace.ElementName.CAPTION, HTML40Namespace.ElementName.THEAD, HTML40Namespace.ElementName.TBODY, HTML40Namespace.ElementName.TFOOT, HTML40Namespace.ElementName.TR};
-
- public HedCOLGROUP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.COLGROUP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_COLUMN_GROUP;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * (span NUMBER 1)
- * (width %MultiLength; #IMPLIED) ... should be defined locally.
- * %cellhalign;
- * %cellvalign;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_SPAN};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (width %MultiLength; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
- }
-
- /**
- * LI has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.java
deleted file mode 100644
index a200227944..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDD.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * DD.
- */
-final class HedDD extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.DT, HTML40Namespace.ElementName.DD};
-
- /**
- */
- public HedDD(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DD, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.java
deleted file mode 100644
index 54aa19d2c6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDIV.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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DIV.
- */
-final class HedDIV extends HedFlowContainer {
-
- /**
- */
- public HedDIV(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DIV, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * %align;
- * %reserved;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %align;
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- // %reserved; ... empty
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.java
deleted file mode 100644
index ec67ee9c6a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDL.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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DL.
- */
-final class HedDL extends HTMLElemDeclImpl {
-
- /**
- */
- public HedDL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DL, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * %arrays;
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.java
deleted file mode 100644
index 7ace82239e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedDT.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * DT.
- */
-final class HedDT extends HedInlineContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.DT, HTML40Namespace.ElementName.DD};
-
- /**
- */
- public HedDT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.DT, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DT has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java
deleted file mode 100644
index 558a3d7c28..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEMBED.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * EMBED.
- */
-final class HedEMBED extends HTMLElemDeclImpl {
-
- /**
- */
- public HedEMBED(ElementCollection collection) {
- super(HTML40Namespace.ElementName.EMBED, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMBED;
- layoutType = LAYOUT_OBJECT;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %coreattrs;
- * %events;
- * (src %URI; #REQUIRED) ... should be defined locally.
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (loop CDATA #IMPLIED)
- * (hidden CDATA #IMPLIED)
- * (volume CDATA #IMPLIED)
- * (autostart (true|false) #IMPLIED)
- * (autoplay (true|false) #IMPLIED)
- * (autosize (true|false) #IMPLIED)
- * (controller (true|false) true)
- * (scale CDATA #IMPLIED)
- * (showcontrols (true|false) #IMPLIED)
- * (playcount NUMBER #IMPLIED)
- * (repeat CDATA #IMPLIED)
- * (panel CDATA #IMPLIED)
- * (text CDATA #IMPLIED)
- * (palette CDATA #IMPLIED)
- * (textfocus CDATA #IMPLIED)
- * (type CDATA #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // %events;
- attributeCollection.getEvents(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_LOOP, HTML40Namespace.ATTR_NAME_HIDDEN, HTML40Namespace.ATTR_NAME_VOLUME, HTML40Namespace.ATTR_NAME_AUTOSTART, HTML40Namespace.ATTR_NAME_AUTOPLAY, HTML40Namespace.ATTR_NAME_AUTOSIZE, HTML40Namespace.ATTR_NAME_CONTROLLER, HTML40Namespace.ATTR_NAME_SCALE, HTML40Namespace.ATTR_NAME_SHOWCONTROLS, HTML40Namespace.ATTR_NAME_PLAYCOUNT, HTML40Namespace.ATTR_NAME_REPEAT, HTML40Namespace.ATTR_NAME_PANEL, HTML40Namespace.ATTR_NAME_TEXT, HTML40Namespace.ATTR_NAME_PALETTE, HTML40Namespace.ATTR_NAME_TEXTFOCUS};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (src %URI; #REQUIRED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
- // (align %IAlign; #IMPLIED) ... should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
- // (type CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.java
deleted file mode 100644
index 8f5898a5fe..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedEmpty.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for EMPTY type element declarations.
- */
-abstract class HedEmpty extends HTMLElemDeclImpl {
-
- /**
- */
- public HedEmpty(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- // EMPTY type has no end tag.
- omitType = OMIT_END_MUST;
- }
-
- /**
- * Content.<br>
- * EMPTY type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.EMPTY;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.java
deleted file mode 100644
index 2db5e0dcc5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFIELDSET.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.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * FIELDSET.
- */
-final class HedFIELDSET extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFIELDSET(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FIELDSET, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FIELDSET;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java
deleted file mode 100644
index fc610b52fe..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFONT.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * FONT.
- */
-final class HedFONT extends HedInlineContainer {
-
- /**
- */
- public HedFONT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FONT, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %coreattrs;
- * %i18n;
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (color %Color; #IMPLIED)
- * (face CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_COLOR, HTML40Namespace.ATTR_NAME_FACE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java
deleted file mode 100644
index d7c60aed99..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFORM.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * FORM.
- */
-final class HedFORM extends HedFlowContainer {
-
- /**
- */
- public HedFORM(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FORM, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (action %URI; #REQUIRED)
- * (method (GET|POST) GET)
- * (enctype %ContentType; "application/x-www-form-urlencoded")
- * (accept %ContentTypes; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (onsubmit %Script; #IMPLIED)
- * (onreset %Script; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (accept-charset %Charsets; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ACTION, HTML40Namespace.ATTR_NAME_METHOD, HTML40Namespace.ATTR_NAME_ENCTYPE, HTML40Namespace.ATTR_NAME_ACCEPT, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_ONSUBMIT, HTML40Namespace.ATTR_NAME_ONRESET, HTML40Namespace.ATTR_NAME_TARGET, HTML40Namespace.ATTR_NAME_ACCEPT_CHARSET};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>FORM</code> has the exclusion.
- * It is <code>FORM</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode form = elementCollection.getNamedItem(HTML40Namespace.ElementName.FORM);
- if (form != null)
- exclusion.appendChild(form);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java
deleted file mode 100644
index bb844cddc0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAME.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * FRAME.
- */
-final class HedFRAME extends HedEmpty {
-
- /**
- */
- public HedFRAME(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FRAME, collection);
- // LAYOUT_HIDDEN.
- // Because, FRAME is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * FRAME.
- * %coreattrs;
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (src %URI; #IMPLIED)
- * (frameborder (1|0) 1)
- * (marginwidth %Pixels; #IMPLIED)
- * (marginheight %Pixels; #IMPLIED)
- * (noresize (noresize) #IMPLIED)
- * (scrolling (yes|no|auto) auto)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_FRAMEBORDER, HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_NORESIZE, HTML40Namespace.ATTR_NAME_SCROLLING, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D20554
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java
deleted file mode 100644
index 0f389610a2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFRAMESET.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * FRAMESET.
- */
-final class HedFRAMESET extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFRAMESET(ElementCollection collection) {
- super(HTML40Namespace.ElementName.FRAMESET, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FRAMESET;
- layoutType = LAYOUT_HIDDEN;
- indentChild = true;
- }
-
- /**
- * %coreattrs;
- * (rows %MultiLengths; #IMPLIED) ... should be defined locally.
- * (cols %MultiLengths; #IMPLIED) ... should be defined locally.
- * (onload %Script; #IMPLIED)
- * (onunload %Script; #IMPLIED)
- * (frameborder (yes|no) #IMPLIED) ... should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- * (framespacing CDATA #IMPLIED) ... D215684
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ONLOAD, HTML40Namespace.ATTR_NAME_ONUNLOAD, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_BORDERCOLOR, // D205514
- HTML40Namespace.ATTR_NAME_FRAMESPACING // D215684
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (rows %MultiLengths; #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.MULTI_LENGTH);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ROWS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ROWS, attr);
-
- // (cols %MultiLengths; #IMPLIED) ... should be defined locally.
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_COLS, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_COLS, attr);
-
- // (frameborder (yes|no) #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_YES, HTML40Namespace.ATTR_VALUE_NO};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_FRAMEBORDER, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.java
deleted file mode 100644
index 96d47e2055..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFlowContainer.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.core.internal.contentmodel;
-
-
-
-/**
- * Base class for (%flow;)* containers.
- */
-abstract class HedFlowContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFlowContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.java
deleted file mode 100644
index 9b787c0e52..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedFontStyle.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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * %fontstyle;
- */
-final class HedFontStyle extends HedInlineContainer {
-
- /**
- */
- public HedFontStyle(String elementName, ElementCollection collection) {
- super(elementName, collection);
- if (elementName.equalsIgnoreCase(HTML40Namespace.ElementName.BIG) || elementName.equalsIgnoreCase(HTML40Namespace.ElementName.SMALL)) {
- correctionType = CORRECT_EMPTY;
- }
- else { // B, I, U, ...
- correctionType = CORRECT_DUPLICATED;
- }
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- String myName = getElementName();
- if (!myName.equalsIgnoreCase(HTML40Namespace.ElementName.BIG) && !myName.equalsIgnoreCase(HTML40Namespace.ElementName.SMALL))
- return EMPTY_MAP;
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.java
deleted file mode 100644
index d2c2e8aeb9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHEAD.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * HTML.
- */
-final class HedHEAD extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.HEAD, HTML40Namespace.ElementName.BODY, HTML40Namespace.ElementName.FRAMESET, HTML40Namespace.ElementName.HTML};
-
- /**
- */
- public HedHEAD(ElementCollection collection) {
- super(HTML40Namespace.ElementName.HEAD, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEAD;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HEAD</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%i18n;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>profile</td><td>URI</td><td>#IMPLIED</td><td>N/A</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- // profile
- HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_PROFILE);
- if (adec != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_PROFILE, adec);
- }
-
- /**
- * HEAD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java
deleted file mode 100644
index bf7155e6b8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHR.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * HR.
- */
-final class HedHR extends HedEmpty {
-
- /**
- */
- public HedHR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.HR, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs
- * (align (left|center|right) #IMPLIED) ... should be defined locally.
- * (noshade (noshade) #IMPLIED)
- * (size %Pixels; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (color %Color; #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (align (left|center|right) #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_LEFT, HTML40Namespace.ATTR_VALUE_CENTER, HTML40Namespace.ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {HTML40Namespace.ATTR_NAME_NOSHADE, HTML40Namespace.ATTR_NAME_SIZE, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_COLOR // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
deleted file mode 100644
index 152239557b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHTML.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * HTML.
- */
-final class HedHTML extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.HTML};
-
- /**
- */
- public HedHTML(ElementCollection collection) {
- super(HTML40Namespace.ElementName.HTML, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HTML;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HTML</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td><code>%i18n;</code></td><td>-</td><td>-</td><td>-</td>
- * <td>{@link PDCMDocImpl#getAttrDeclarationsI18n}</td>
- * </tr>
- * <tr>
- * <td>version</td><td>CDATA</td><td>#FIXED</td>
- * <td>{@link HTML_VERSION_TRANSITIONAL}</td><td>deplecated in HTML4.01</td>
- * </tr>
- * </tbody>
- * </table>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- // version
- HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_VERSION);
- if (adec != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VERSION, adec);
- }
-
- /**
- * HTML has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java
deleted file mode 100644
index 3123cec297..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedHeading.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * H[1-6].
- */
-final class HedHeading extends HedInlineContainer {
-
- /**
- */
- public HedHeading(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>H1</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
deleted file mode 100644
index 6036741d1b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIFRAME.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IFRAME.
- */
-final class HedIFRAME extends HedFlowContainer {
-
- /**
- */
- public HedIFRAME(ElementCollection collection) {
- super(HTML40Namespace.ElementName.IFRAME, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * %coreattrs;
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (src %URI; #IMPLIED)
- * (frameborder (1|0) 1)
- * (marginwidth %Pixels; #IMPLIED)
- * (marginheight %Pixels; #IMPLIED)
- * (scrolling (yes|no|auto) auto)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_FRAMEBORDER, HTML40Namespace.ATTR_NAME_MARGINWIDTH, HTML40Namespace.ATTR_NAME_MARGINHEIGHT, HTML40Namespace.ATTR_NAME_SCROLLING, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
deleted file mode 100644
index ae1296bf27..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedIMG.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IMG.
- */
-final class HedIMG extends HedEmpty {
-
- /**
- */
- public HedIMG(ElementCollection collection) {
- super(HTML40Namespace.ElementName.IMG, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * IMG.
- * %attrs;
- * (src %URI; #REQUIRED): should be defined locally.
- * (alt %Text; #REQUIRED)
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (align %IAlign; #IMPLIED): should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mapfile %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SRC, attr);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_LONGDESC, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_ISMAP, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE, HTML40Namespace.ATTR_NAME_MAPFILE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local); should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
deleted file mode 100644
index ecf5aaebdd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedINPUT.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * INPUT.
- */
-final class HedINPUT extends HedEmpty {
-
- /**
- */
- public HedINPUT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.INPUT, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * INPUT.
- * %attrs;
- * (type %InputType; TEXT) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (checked (checked) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (maxlength NUMBER #IMPLIED)
- * (src %URI; #IMPLIED)
- * (alt CDATA #IMPLIED) ... should be defined locally.
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (accept %ContentTypes; #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (istyle CDATA #IMPLIED)
- * <<D215684
- * (width CDATA; #IMPLIED)
- * (height CDATA; #IMPLIED)
- * (border CDATA; #IMPLIED)
- * D215684
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (type %InputType; TEXT) ... should be defined locally.
- // NOTE: %InputType is ENUM;
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_TEXT, HTML40Namespace.ATTR_VALUE_PASSWORD, HTML40Namespace.ATTR_VALUE_CHECKBOX, HTML40Namespace.ATTR_VALUE_RADIO, HTML40Namespace.ATTR_VALUE_SUBMIT, HTML40Namespace.ATTR_VALUE_RESET, HTML40Namespace.ATTR_VALUE_FILE, HTML40Namespace.ATTR_VALUE_HIDDEN, HTML40Namespace.ATTR_VALUE_IMAGE, HTML40Namespace.ATTR_VALUE_BUTTON};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, HTML40Namespace.ATTR_VALUE_TEXT);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-
- // (alt CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALT, attr);
-
- // (align %IAlign; #IMPLIED) ... should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_CHECKED, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_READONLY, HTML40Namespace.ATTR_NAME_SIZE, HTML40Namespace.ATTR_NAME_MAXLENGTH, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_ALT, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_ISMAP, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONSELECT, HTML40Namespace.ATTR_NAME_ONCHANGE, HTML40Namespace.ATTR_NAME_ACCEPT, HTML40Namespace.ATTR_NAME_ALIGN, HTML40Namespace.ATTR_NAME_ISTYLE,
- //<<D215684
- HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BORDER
- //<D215684
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java
deleted file mode 100644
index c3ec75d6de..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedISINDEX.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ISINDEX.
- */
-final class HedISINDEX extends HedEmpty {
-
- /**
- */
- public HedISINDEX(ElementCollection collection) {
- super(HTML40Namespace.ElementName.ISINDEX, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * ISINDEX.
- * %coreattrs;
- * %i18n;
- * (prompt %Text; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(HTML40Namespace.ATTR_NAME_PROMPT);
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_PROMPT, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.java
deleted file mode 100644
index 08812aa8ad..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedInlineContainer.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.core.internal.contentmodel;
-
-
-
-/**
- * Base class for (%inline;)* containers.
- */
-abstract class HedInlineContainer extends HTMLElemDeclImpl {
-
- /**
- * HedInlineContainer.
- * @param elementName java.lang.String
- * @param collection ElementCollection
- */
- public HedInlineContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java
deleted file mode 100644
index aecb7b3ec9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLABEL.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * LABEL.
- */
-final class HedLABEL extends HedInlineContainer {
-
- /**
- */
- public HedLABEL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LABEL, collection);
- }
-
- /**
- * %attrs;
- * (for IDREF #IMPLIED) ... should be defined locally.
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (for IDREF #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.IDREF);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_FOR, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_FOR, attr);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>LABEL</code> has the exclusion.
- * It is <code>LABEL</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.LABEL);
- if (label != null)
- exclusion.appendChild(label);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON, HTML40Namespace.ElementName.LABEL};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.java
deleted file mode 100644
index f66d866851..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLEGEND.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * LEGEND.
- */
-final class HedLEGEND extends HedInlineContainer {
-
- /**
- */
- public HedLEGEND(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LEGEND, collection);
- }
-
- /**
- * (accesskey %Character; #IMPLIED)
- * (align %LAlign; #IMPLIED) ... shuld be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ACCESSKEY};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForLegend();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.java
deleted file mode 100644
index 9012dab124..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLI.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * LI.
- */
-final class HedLI extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.LI};
-
- /**
- */
- public HedLI(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LI, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- * (type %LIStyle; #IMPLIED) ... should be defined locally.
- * (value NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (type %LIStyle; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LI_STYLE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
- // (value NUMBER #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VALUE, attr);
- }
-
- /**
- * LI has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.java
deleted file mode 100644
index 5fe5269231..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedLINK.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * LINK.
- */
-final class HedLINK extends HedEmpty {
-
- /**
- */
- public HedLINK(ElementCollection collection) {
- super(HTML40Namespace.ElementName.LINK, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * LINK.
- * %attrs;
- * (charset %Charset; #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (type %ContentType; #IMPLIED): should be defined locally.
- * (rel %LinkTypes; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (media %MediaDesc; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_HREF, HTML40Namespace.ATTR_NAME_HREFLANG, HTML40Namespace.ATTR_NAME_REL, HTML40Namespace.ATTR_NAME_REV, HTML40Namespace.ATTR_NAME_MEDIA, HTML40Namespace.ATTR_NAME_TARGET};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type %ContentType; #IMPLIED)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.java
deleted file mode 100644
index ca497170be..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedListItemContainer.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.core.internal.contentmodel;
-
-
-
-/**
- * Base class for list item container declarations.
- * - OL, UL, MENU, DIR.
- */
-abstract class HedListItemContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedListItemContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.java
deleted file mode 100644
index 4e1036f871..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMAP.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.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-
-
-/**
- * MAP.
- */
-final class HedMAP extends HTMLElemDeclImpl {
-
- /**
- */
- public HedMAP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.MAP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_MAP;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * (name CDATA #REQUIRED) ... should be defined locally
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (name CDATA #REQUIRED) ... should be defined locally
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java
deleted file mode 100644
index c9cadcb325..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMARQUEE.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * MARQUEE.
- */
-final class HedMARQUEE extends HedFlowContainer {
-
- /**
- */
- public HedMARQUEE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.MARQUEE, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * %attrs;
- * (behavior (scroll|slide|alternate) scroll)
- * (bgcolor %Color; #IMPLIED)
- * (direction (left|right|up|down) left)
- * (height CDATA #IMPLIED) ... should be defined locally.
- * (hspace NUMBER #IMPLIED) ... should be defined locally.
- * (loop CDATA #IMPLIED)
- * (scrollamount NUMBER #IMPLIED)
- * (scrolldelay NUMBER #IMPLIED)
- * (vspace NUMBER #IMPLIED) ... should be defined locally.
- * (width CDATA #IMPLIED) ... should be defined locally.
- * (truespeed (truespeed) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_BEHAVIOR, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_DIRECTION, HTML40Namespace.ATTR_NAME_LOOP, HTML40Namespace.ATTR_NAME_SCROLLAMOUNT, HTML40Namespace.ATTR_NAME_SCROLLDELAY, HTML40Namespace.ATTR_NAME_TRUESPEED};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (height CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_HEIGHT, attr);
-
- // (width CDATA #IMPLIED) ... should be defined locally.
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
-
- // (hspace NUMBER #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_HSPACE, attr);
-
- // (vspace NUMBER #IMPLIED) ... should be defined locally.
- attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_VSPACE, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
deleted file mode 100644
index 1957036839..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMENU.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * MENU/DIR.
- */
-final class HedMENU extends HedListItemContainer {
-
- /**
- */
- public HedMENU(String elementName, ElementCollection collection) {
- super(elementName, collection);
- }
-
- /**
- * MENU/DIR.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>MENU/DIR</code> has the exclusion.
- * It is <code>%block;</code>.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.
- * %heading; is: H1 | H2 | H3 | H4 | H5 | H6.
- * %list; is : UL | OL | DIR | MENU.
- * %preformatted; is PRE.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // %block;
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.P, HTML40Namespace.ElementName.H1, HTML40Namespace.ElementName.H2, HTML40Namespace.ElementName.H3, HTML40Namespace.ElementName.H4, HTML40Namespace.ElementName.H5, HTML40Namespace.ElementName.H6, HTML40Namespace.ElementName.UL, HTML40Namespace.ElementName.OL, HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU, HTML40Namespace.ElementName.PRE, HTML40Namespace.ElementName.DL, HTML40Namespace.ElementName.DIV, HTML40Namespace.ElementName.CENTER, HTML40Namespace.ElementName.NOSCRIPT, HTML40Namespace.ElementName.NOFRAMES, HTML40Namespace.ElementName.BLOCKQUOTE, HTML40Namespace.ElementName.FORM, HTML40Namespace.ElementName.ISINDEX, HTML40Namespace.ElementName.HR, HTML40Namespace.ElementName.TABLE, HTML40Namespace.ElementName.FIELDSET, HTML40Namespace.ElementName.ADDRESS};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.java
deleted file mode 100644
index 3b7e0088cc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMETA.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * META.
- */
-final class HedMETA extends HedEmpty {
-
- /**
- */
- public HedMETA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.META, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * META.
- * %i18n;
- * (http-equiv NAME #IMPLIED)
- * (name NAME #IMPLIED) ... should be defined locally.
- * (content CDATA #REQUIRED)
- * (scheme CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- // (name NAME #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
-
- String[] names = {HTML40Namespace.ATTR_NAME_HTTP_EQUIV, HTML40Namespace.ATTR_NAME_CONTENT, HTML40Namespace.ATTR_NAME_SCHEME};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.java
deleted file mode 100644
index 3cff404a8d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedMarkChanges.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * (INS|DEL)
- */
-final class HedMarkChanges extends HedFlowContainer {
-
- /**
- */
- public HedMarkChanges(String elementName, ElementCollection collection) {
- super(elementName, collection);
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- * (datetime %Datetime; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CITE, HTML40Namespace.ATTR_NAME_DATETIME};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.java
deleted file mode 100644
index 4e3a1a2eb9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOBR.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.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * NOBR -- not standard tag but it is commonly used.
- */
-final class HedNOBR extends HedInlineContainer {
-
-
- public HedNOBR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOBR, collection);
- correctionType = HTMLElementDeclaration.CORRECT_DUPLICATED;
- }
-
- protected void createAttributeDeclarations() {
- // No attributes is defined.
- if (attributes != null)
- return;
- attributes = new CMNamedNodeMapImpl();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.java
deleted file mode 100644
index 3d5d5fdbc5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOEMBED.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.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * NOEMBED.
- */
-final class HedNOEMBED extends HedFlowContainer {
-
- /**
- */
- public HedNOEMBED(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOEMBED, collection);
- }
-
- /**
- * %coreattrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java
deleted file mode 100644
index 3d2d044522..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOFRAMES.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * NOFRAMES.
- */
-final class HedNOFRAMES extends HTMLElemDeclImpl {
-
- /**
- */
- public HedNOFRAMES(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOFRAMES, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_NOFRAMES_CONTENT;
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * Exclusion.
- * <code>NOFRAMES</code> has the exclusion.
- * It is <code>NOFRAMES</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
- if (label != null)
- exclusion.appendChild(label);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU, HTML40Namespace.ElementName.NOFRAMES};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.java
deleted file mode 100644
index df9a403a60..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedNOSCRIPT.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * NOSCRIPT.
- */
-final class HedNOSCRIPT extends HedFlowContainer {
-
- /**
- */
- public HedNOSCRIPT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.NOSCRIPT, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java
deleted file mode 100644
index f229abb89a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOBJECT.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OBJECT.
- */
-final class HedOBJECT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedOBJECT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OBJECT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PARAM_CONTAINER;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %reserved; ... empty.
- * (declare (declare) #IMPLIED)
- * (classid %URI; #IMPLIED)
- * (codebase %URI; #IMPLIED)
- * (data %URI; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * (codetype %ContentType; #IMPLIED)
- * (archive CDATA #IMPLIED)
- * (standby %Text; #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (usemap %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %reserved; ... empty.
-
- String[] names = {HTML40Namespace.ATTR_NAME_DECLARE, HTML40Namespace.ATTR_NAME_CLASSID, HTML40Namespace.ATTR_NAME_CODEBASE, HTML40Namespace.ATTR_NAME_DATA, HTML40Namespace.ATTR_NAME_TYPE, HTML40Namespace.ATTR_NAME_CODETYPE, HTML40Namespace.ATTR_NAME_ARCHIVE, HTML40Namespace.ATTR_NAME_STANDBY, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_USEMAP, HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_HSPACE, HTML40Namespace.ATTR_NAME_VSPACE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- // %align; ... should be defined locally.
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForImage();
- if (attr != null)
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.java
deleted file mode 100644
index ad26f3a4e8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOL.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OL.
- */
-final class HedOL extends HedListItemContainer {
-
- /**
- */
- public HedOL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OL, collection);
- }
-
- /**
- * OL.
- * (type %OLStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- * (start NUMBER #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (type %OLStyle; #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.OL_STYLE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
- // the rest.
- String[] names = {HTML40Namespace.ATTR_NAME_COMPACT, HTML40Namespace.ATTR_NAME_START};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.java
deleted file mode 100644
index 1367344e6d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTGROUP.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-
-/**
- * OPTGROUP.
- */
-final class HedOPTGROUP extends HTMLElemDeclImpl {
-
- /**
- */
- public HedOPTGROUP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OPTGROUP, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
- layoutType = LAYOUT_HIDDEN;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * (disabled (disabled) #IMPLIED)
- * (label %Text; #REQUIRED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // (disabled (disabled) #IMPLIED)
- String[] names = {HTML40Namespace.ATTR_NAME_DISABLED};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (label %Text; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_LABEL, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_LABEL, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.java
deleted file mode 100644
index 0568bd741a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedOPTION.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * OPTION.
- */
-final class HedOPTION extends HedPcdata {
-
- private static String[] terminators = {HTML40Namespace.ElementName.OPTION};
-
- /**
- */
- public HedOPTION(ElementCollection collection) {
- super(HTML40Namespace.ElementName.OPTION, collection);
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_END;
- }
-
- /**
- * OPTION.
- * %attrs;
- * (selected (selected) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (label %Text; #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_SELECTED, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_LABEL, HTML40Namespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * OPTION has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.java
deleted file mode 100644
index 3ee637cab0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedP.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * P.
- */
-final class HedP extends HedInlineContainer {
-
- private static Collection terminators = null;
-
- /**
- */
- public HedP(ElementCollection collection) {
- super(HTML40Namespace.ElementName.P, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>P</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl adec = AttributeCollection.createAlignForParagraph();
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, adec);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
- return prohibitedAncestors;
- }
-
- /**
- * Return names of terminators.
- * <code>P</code> has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- if (terminators != null)
- return terminators.iterator();
- //<<D217982
- terminators = new Vector();
- terminators.addAll(elementCollection.getNamesOfBlock());
- terminators.add(HTML40Namespace.ElementName.LI);
- terminators.add(HTML40Namespace.ElementName.DT);
- terminators.add(HTML40Namespace.ElementName.DD);
- //D217982
- return terminators.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.java
deleted file mode 100644
index bb44fe55b1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPARAM.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.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * PARAM.
- */
-final class HedPARAM extends HedEmpty {
-
- /**
- */
- public HedPARAM(ElementCollection collection) {
- super(HTML40Namespace.ElementName.PARAM, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * PARAM.
- * (id ID #IMPLIED)
- * (name CDATA #REQUIRED) ... should be defined locally.
- * (value CDATA #IMPLIED)
- * (valuetype (DATA|REF|OBJECT) DATA)
- * (type %ContentType; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_ID, HTML40Namespace.ATTR_NAME_VALUE, HTML40Namespace.ATTR_NAME_VALUETYPE, HTML40Namespace.ATTR_NAME_TYPE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (name CDATA #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_NAME, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java
deleted file mode 100644
index 4e6b22800d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPRE.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * PRE.
- */
-final class HedPRE extends HedInlineContainer {
-
- /**
- * PRE element should keep spaces in its source.
- */
- public HedPRE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.PRE, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
-
- keepSpaces = true;
- }
-
- /**
- * %attrs;
- * (width NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // (width NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_WIDTH, attr);
- }
-
- /**
- * Exclusion.
- * <code>PRE</code> has the exclusion.
- * It is <code>%pre.exclusion;</code>.
- * %pre.exclusion is:
- * IMG | OBJECT | APPLET | BIG | SMALL | SUB | SUP | FONT | BASEFONT
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {HTML40Namespace.ElementName.IMG, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.APPLET, HTML40Namespace.ElementName.BIG, HTML40Namespace.ElementName.SMALL, HTML40Namespace.ElementName.SUB, HTML40Namespace.ElementName.SUP, HTML40Namespace.ElementName.FONT, HTML40Namespace.ElementName.BASEFONT};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.java
deleted file mode 100644
index 7e14c31104..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPcdata.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.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for PCDATA type element declarations.<br>
- */
-abstract class HedPcdata extends HTMLElemDeclImpl {
-
- /**
- */
- public HedPcdata(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PCDATA;
- }
-
- /**
- * Content.<br>
- * PCDATA type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.PCDATA;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java
deleted file mode 100644
index 7561e1e54f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedPhrase.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-/**
- * %phrase;
- */
-final class HedPhrase extends HedInlineContainer {
-
- /**
- */
- public HedPhrase(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = HTMLElementDeclaration.CORRECT_DUPLICATED;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.java
deleted file mode 100644
index 018232f8b2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedQ.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * Q.
- */
-final class HedQ extends HedInlineContainer {
-
- /**
- */
- public HedQ(ElementCollection collection) {
- super(HTML40Namespace.ElementName.Q, collection);
- correctionType = CORRECT_DUPLICATED;
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_CITE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
deleted file mode 100644
index a279a0d229..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSCRIPT.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * SCRIPT.
- */
-final class HedSCRIPT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSCRIPT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SCRIPT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * SCRIPT.
- * (charset %Charset; #IMPLIED)
- * (type %ContentType; #REQUIRED) ... should be defined locally.
- * (language CDATA #IMPLIED)
- * (src %URI; #IMPLIED)
- * (defer (defer) #IMPLIED)
- * (event CDATA #IMPLIED)
- * (for %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_CHARSET, HTML40Namespace.ATTR_NAME_LANGUAGE, HTML40Namespace.ATTR_NAME_SRC, HTML40Namespace.ATTR_NAME_DEFER, HTML40Namespace.ATTR_NAME_EVENT, HTML40Namespace.ATTR_NAME_FOR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // (type %ContentType; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, "text/javascript"); //$NON-NLS-1$
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
- }
-
- /**
- * <code>SCRIPT</code> is CDATA type.
- * So, the method always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * CDATA content.<br>
- * @return int
- */
- public int getContentType() {
- return CMElementDeclaration.CDATA;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
deleted file mode 100644
index 8e3c3f41d1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSELECT.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SELECT.
- */
-final class HedSELECT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSELECT(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SELECT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_SELECT;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %reserved;
- * (name CDATA #IMPLIED)
- * (size NUMBER #IMPLIED) ... should be defined locally.
- * (multiple (multiple) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (size NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_SIZE, attr);
-
- String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_MULTIPLE, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONCHANGE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.java
deleted file mode 100644
index b5aaa179a8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSPAN.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.wst.html.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * SPAN.
- */
-final class HedSPAN extends HedInlineContainer {
-
- /**
- * SPAN.
- */
- public HedSPAN(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SPAN, collection);
- }
-
- /**
- * %attrs;
- * %reserved; ... empty.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.java
deleted file mode 100644
index 6638be7c27..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIBase.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.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-/**
- * Base class for SSI declarations.
- */
-abstract class HedSSIBase extends HedEmpty {
-
- /**
- */
- public HedSSIBase(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- */
- public int getFormatType() {
- return HTMLElementDeclaration.FORMAT_SSI;
- }
-
- /**
- */
- public boolean supports(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return true;
- return super.supports(propName);
- }
-
- /*
- */
- public Object getProperty(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return new Boolean(true);
- return super.getProperty(propName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java
deleted file mode 100644
index 71d292c455..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIConfig.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:CONFIG.
- */
-final class HedSSIConfig extends HedSSIBase {
-
- /**
- */
- public HedSSIConfig(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_CONFIG, collection);
- }
-
- /**
- * SSI:CONFIG.
- * (errmsg CDATA #IMPLIED)
- * (sizefmt CDATA #IMPLIED)
- * (timefmt CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_ERRMSG, HTML40Namespace.ATTR_NAME_SIZEFMT, HTML40Namespace.ATTR_NAME_TIMEFMT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.java
deleted file mode 100644
index 38c5e6d384..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIEcho.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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:ECHO.
- */
-final class HedSSIEcho extends HedSSIBase {
-
- /**
- */
- public HedSSIEcho(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_ECHO, collection);
- }
-
- /**
- * SSI:ECHO
- * (var CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_VAR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.java
deleted file mode 100644
index b2c3c8521a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIExec.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:EXEC.
- */
-final class HedSSIExec extends HedSSIBase {
-
- /**
- */
- public HedSSIExec(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_EXEC, collection);
- }
-
- /**
- * SSI:EXEC
- * (cgi %URI; #IMPLIED)
- * (cmd CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_CGI, HTML40Namespace.ATTR_NAME_CMD};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.java
deleted file mode 100644
index 4a83941837..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFlastmod.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:FLASTMOD.
- */
-final class HedSSIFlastmod extends HedSSIBase {
-
- /**
- */
- public HedSSIFlastmod(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_FLASTMOD, collection);
- }
-
- /**
- * SSI:FLASTMOD
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.java
deleted file mode 100644
index 93f7541447..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIFsize.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:FSIZE.
- */
-final class HedSSIFsize extends HedSSIBase {
-
- /**
- */
- public HedSSIFsize(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_FSIZE, collection);
- }
-
- /**
- * SSI:FSIZE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.java
deleted file mode 100644
index d28a5532bd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIInclude.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:INCLUDE.
- */
-final class HedSSIInclude extends HedSSIBase {
-
- /**
- */
- public HedSSIInclude(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_INCLUDE, collection);
- }
-
- /**
- * SSI:INCLUDE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_FILE, HTML40Namespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.java
deleted file mode 100644
index 05c303d20b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSIPrintenv.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SSI:PRINTENV.
- */
-final class HedSSIPrintenv extends HedSSIBase {
-
- /**
- */
- public HedSSIPrintenv(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_PRINTENV, collection);
- }
-
- /**
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- }
-
- /**
- * SSI:PRINTENV has no attributes. So, this method should
- * always return <code>null</code>.
- * Note: Since somebody doesn't expect null is returned, return the empty attribute
- * like a custom tag which doesn't have attributes
- */
- public CMNamedNodeMap getAttributes() {
- return super.getAttributes();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.java
deleted file mode 100644
index ed8c41ab8e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSSISet.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.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * SSI:SET.
- */
-final class HedSSISet extends HedSSIBase {
-
- /**
- */
- public HedSSISet(ElementCollection collection) {
- super(HTML40Namespace.ElementName.SSI_SET, collection);
- }
-
- /**
- * SSI:SET
- * (var CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {HTML40Namespace.ATTR_NAME_VAR, HTML40Namespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
deleted file mode 100644
index 3782d5b3c7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedSTYLE.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * STYLE.
- */
-final class HedSTYLE extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSTYLE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.STYLE, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_CDATA;
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * STYLE
- * %i18n;
- * (type %ContentType; #REQUIRED) ... should be defined locally.
- * (media %MediaDesc; #IMPLIED)
- * (title %Text; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_MEDIA, HTML40Namespace.ATTR_NAME_TITLE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- // (type %ContentType; #REQUIRED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
- }
-
- /**
- * Content.<br>
- * <code>STYLE</code> is CDATA content type. So, it always returns <code>null</code>.
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * CDATA content.<br>
- * @return int
- */
- public int getContentType() {
- return CMElementDeclaration.CDATA;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.java
deleted file mode 100644
index dab20e106d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedScripts.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.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SUB and SUP.
- */
-final class HedScripts extends HedInlineContainer {
-
- /**
- */
- public HedScripts(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
deleted file mode 100644
index 77aea58550..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTABLE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * TABLE.
- */
-final class HedTABLE extends HTMLElemDeclImpl {
-
- /**
- */
- public HedTABLE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TABLE, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TABLE;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * TABLE.
- * %attrs;
- * %reserved;
- * (summary %Text; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (border %Pixels; #IMPLIED)
- * (frame %TFrame; #IMPLIED)
- * (rules %TRules; #IMPLIED)
- * (cellspacing %Length; #IMPLIED)
- * (cellpadding %Length; #IMPLIED)
- * (align %TAlign; #IMPLIED)
- * (bgcolor %Color; #IMPLIED)
- * (datapagesize CDATA #IMPLIED)
- * (height %Pixels; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %reserved;
- // ... %reserved; is empty in the current DTD.
-
- String[] names = {HTML40Namespace.ATTR_NAME_SUMMARY, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_BORDER, HTML40Namespace.ATTR_NAME_FRAME, HTML40Namespace.ATTR_NAME_RULES, HTML40Namespace.ATTR_NAME_CELLSPACING, HTML40Namespace.ATTR_NAME_CELLPADDING, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_DATAPAGESIZE, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] alignValues = {HTML40Namespace.ATTR_VALUE_LEFT, HTML40Namespace.ATTR_VALUE_CENTER, HTML40Namespace.ATTR_VALUE_RIGHT};
- atype.setEnumValues(alignValues);
- HTMLAttrDeclImpl adec = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_ALIGN, adec);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
deleted file mode 100644
index 4fb0f5e8b0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTEXTAREA.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * TEXTAREA.
- */
-final class HedTEXTAREA extends HedPcdata {
-
- /**
- * TEXTAREA should keep spaces in its source.
- */
- public HedTEXTAREA(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TEXTAREA, collection);
- layoutType = LAYOUT_OBJECT;
-
- keepSpaces = true;
- }
-
- /**
- * TEXTAREA.
- * %attrs;
- * %reserved; ... empty
- * (name CDATA #IMPLIED)
- * (rows NUMBER #REQUIRED)
- * (cols NUMBER #REQUIRED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (istyle CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_NAME, HTML40Namespace.ATTR_NAME_ROWS, HTML40Namespace.ATTR_NAME_COLS, HTML40Namespace.ATTR_NAME_DISABLED, HTML40Namespace.ATTR_NAME_READONLY, HTML40Namespace.ATTR_NAME_TABINDEX, HTML40Namespace.ATTR_NAME_ACCESSKEY, HTML40Namespace.ATTR_NAME_ONFOCUS, HTML40Namespace.ATTR_NAME_ONBLUR, HTML40Namespace.ATTR_NAME_ONSELECT, HTML40Namespace.ATTR_NAME_ONCHANGE, HTML40Namespace.ATTR_NAME_ISTYLE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.BUTTON};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java
deleted file mode 100644
index ae8cf19fba..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTITLE.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * TITLE.
- */
-final class HedTITLE extends HedPcdata {
-
- /**
- */
- public HedTITLE(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TITLE, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * TITLE.
- * %i18n;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- }
-
- /**
- * Exclusion.
- * <code>TITLE</code> has the exclusion.
- * It is <code>%head.misc;</code>.
- * %head.misc; is <code>SCRIPT|STYLE|META|LINK|OBJECT</code>.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // (SCRIPT|STYLE|META|LINK|OBJECT)
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
- String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java
deleted file mode 100644
index cf15cf0a43..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTR.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * TR.
- */
-final class HedTR extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.TR};
-
- /**
- */
- public HedTR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.TR, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TCELL_CONTAINER;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %cellhalign;
- * %cellvalign;
- * (bgcolor %Color; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- * (height %Length #IMPLIED) bug2246
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR, HTML40Namespace.ATTR_NAME_HEIGHT // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * TR has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java
deleted file mode 100644
index ad2e6a7a00..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableBody.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * THEAD/TFOOT/TBODY
- */
-final class HedTableBody extends HTMLElemDeclImpl {
-
- private static String[] terminators = {HTML40Namespace.ElementName.CAPTION, HTML40Namespace.ElementName.COL, HTML40Namespace.ElementName.COLGROUP, HTML40Namespace.ElementName.THEAD, HTML40Namespace.ElementName.TBODY, HTML40Namespace.ElementName.TFOOT};
-
- /**
- */
- public HedTableBody(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_TR_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- if (elementName == HTML40Namespace.ElementName.TBODY) {
- omitType = OMIT_BOTH;
- }
- else {
- omitType = OMIT_END;
- }
- indentChild = true;
- }
-
- /**
- * TBODY/TFOOT/THEAD
- * %attrs;
- * %cellhalign;
- * %cellvalign;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
- }
-
- /**
- * THEAD, TFOOT and TBODY have terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java
deleted file mode 100644
index 5a791e6426..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedTableCell.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-/**
- * (TH | TD).
- */
-final class HedTableCell extends HedFlowContainer {
-
- private static String[] terminators = {HTML40Namespace.ElementName.TR, HTML40Namespace.ElementName.TH, HTML40Namespace.ElementName.TD};
-
- /**
- */
- public HedTableCell(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- }
-
- /**
- * %attrs;
- * (abbr %Text; #IMPLIED)
- * (axis CDATA #IMPLIED)
- * (headers IDREFS #IMPLIED)
- * (scope %Scope; #IMPLIED)
- * (rowspan NUMBER 1)
- * (colspan NUMBER 1)
- * %cellhalign;
- * %cellvalign;
- * (nowrap (nowrap) #IMPLIED)
- * (bgcolor %Color; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (height %Length; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (bordercolor %Color #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %cellhalign;
- attributeCollection.getCellhalign(attributes);
- // %cellvalign;
- attributeCollection.getCellvalign(attributes);
-
- String[] names = {HTML40Namespace.ATTR_NAME_ABBR, HTML40Namespace.ATTR_NAME_AXIS, HTML40Namespace.ATTR_NAME_HEADERS, HTML40Namespace.ATTR_NAME_SCOPE, HTML40Namespace.ATTR_NAME_ROWSPAN, HTML40Namespace.ATTR_NAME_COLSPAN, HTML40Namespace.ATTR_NAME_NOWRAP, HTML40Namespace.ATTR_NAME_BGCOLOR, HTML40Namespace.ATTR_NAME_WIDTH, HTML40Namespace.ATTR_NAME_HEIGHT, HTML40Namespace.ATTR_NAME_BACKGROUND, HTML40Namespace.ATTR_NAME_BORDERCOLOR // D205514
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * TH and TD have terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java
deleted file mode 100644
index 2244e67244..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedUL.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * UL.
- */
-final class HedUL extends HedListItemContainer {
-
- /**
- */
- public HedUL(ElementCollection collection) {
- super(HTML40Namespace.ElementName.UL, collection);
- }
-
- /**
- * UL.
- * (type %ULStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (type %ULStyle; #IMPLIED) ... should be defined locally.
- // %ULStyle; is (disc|square|circle).
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {HTML40Namespace.ATTR_VALUE_DISC, HTML40Namespace.ATTR_VALUE_SQUARE, HTML40Namespace.ATTR_VALUE_CIRCLE};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(HTML40Namespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(HTML40Namespace.ATTR_NAME_TYPE, attr);
-
- // the rest.
- String[] names = {HTML40Namespace.ATTR_NAME_COMPACT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {HTML40Namespace.ElementName.DIR, HTML40Namespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.java
deleted file mode 100644
index 2e4e54df4e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HedWBR.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.core.internal.contentmodel;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-final class HedWBR extends HedEmpty {
-
- public HedWBR(ElementCollection collection) {
- super(HTML40Namespace.ElementName.WBR, collection);
- // LAYOUT_BREAK.
- // same as BR.
- layoutType = LAYOUT_BREAK;
- }
-
- protected void createAttributeDeclarations() {
- // No attributes is defined.
- if (attributes != null)
- return;
- attributes = new CMNamedNodeMapImpl();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java
deleted file mode 100644
index 0d60d50915..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation of CMDocument for the JSP 1.1.
- */
-class JCMDocImpl extends CMNodeImpl implements JSPCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespaceImpl namespace = null;
- private JSPElementCollection elements = null;
-
- /**
- * HCMDocImpl constructor comment.
- */
- public JCMDocImpl(String docTypeName, CMNamespaceImpl targetNamespace) {
- super(docTypeName);
- namespace = targetNamespace;
- elements = new JSPElementCollection();
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public CMNamedNodeMap getEntities() {
- return null;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java
deleted file mode 100644
index acfff3b016..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP11Namespace.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel;
-
-
-/**
- * JSP 1.1 Namespace. Note, this interface was
- * copied form JSP core packages. One implication
- * is that extra care is needed in using '==' instead
- * of '.equals'.
- */
-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.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.java
deleted file mode 100644
index a7f37c9dc4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPCMDocument.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.core.internal.contentmodel;
-
-
-
-/**
- * JSP extension for CMDocument.
- * This interface provides some short hand methods to get declarations
- * by a name.
- */
-public interface JSPCMDocument extends org.eclipse.wst.xml.core.internal.contentmodel.CMDocument {
-
- /**
- * A short hand method to get a element declaration for a JSP element.
- * JSP declaration class implements HTMLElementDeclaration interface.
- * @param elementName java.lang.String
- */
- HTMLElementDeclaration getElementDeclaration(String elementName);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
deleted file mode 100644
index f6633f2e43..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSPElementCollection.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations of the JSP 1.1.
- */
-final class JSPElementCollection extends DeclCollection implements JSP11Namespace.ElementName {
-
-
- private class TypePacket {
- public String name = null;
- public int content = CMElementDeclaration.EMPTY;
- public int omit = HTMLElementDeclaration.OMIT_NONE;
- public int lineBreak = HTMLElementDeclaration.BREAK_NONE;
- public int layout = HTMLElementDeclaration.LAYOUT_NONE;
- public int correct = HTMLElementDeclaration.CORRECT_NONE;
- public int format = HTMLElementDeclaration.FORMAT_XML;
- public boolean indentChild = false;
-
- public TypePacket() {
- }
- }
-
- /** JSP element declaration. */
- private class ElemDecl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
- private TypePacket type = null;
- private CMGroupImpl content = null;
- private CMNamedNodeMapImpl attributes = null;
-
- public ElemDecl(TypePacket t) {
- super(t.name, 1, 1);
- type = t;
- }
-
- public void setContent(CMGroupImpl group) {
- content = group;
- }
-
- public void setAttributes(CMNamedNodeMapImpl attrs) {
- attributes = attrs;
- }
-
- // implementes CMNode
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return true;
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- return true;
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return false;
- return pp.supports(this);
- }
- }
-
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(false); //D208839
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- String myName = getElementName();
- if (myName == JSP11Namespace.ElementName.PLUGIN) {
- return getNamedItem(JSP11Namespace.ElementName.PARAMS); // outer class method.
- }
- else if (myName == JSP11Namespace.ElementName.PARAMS) {
- return getNamedItem(JSP11Namespace.ElementName.PARAM); // outer class method.
- }
- else {
- return null;
- }
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return null;
- return pp.get(this);
- }
- }
-
- // implementes CMElementDeclaration
- public CMNamedNodeMap getAttributes() {
- return attributes;
- }
-
- public CMContent getContent() {
- return content;
- }
-
- public int getContentType() {
- return type.content;
- }
-
- public CMDataType getDataType() {
- return null;
- }
-
- public String getElementName() {
- return getNodeName();
- }
-
- public CMNamedNodeMap getLocalElements() {
- return null;
- }
-
- // implementes HTMLElementDeclaration
- public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
- if (attributes == null)
- return null;
- return (HTMLAttributeDeclaration) attributes.getNamedItem(attrName);
- }
-
- public int getCorrectionType() {
- return type.correct;
- }
-
- public CMContent getExclusion() {
- return null;
- }
-
- public CMContent getInclusion() {
- return null;
- }
-
- public CMNamedNodeMap getProhibitedAncestors() {
- return EMPTY_MAP;
- }
-
- public int getFormatType() {
- return type.format;
- }
-
- public int getLayoutType() {
- return type.layout;
- }
-
- public int getLineBreakHint() {
- return type.lineBreak;
- }
-
- public int getOmitType() {
- return type.omit;
- }
-
- public boolean shouldTerminateAt(HTMLElementDeclaration dec) {
- return false;
- }
-
- public boolean shouldKeepSpaces() {
- return false;
- }
-
- public boolean shouldIndentChildSource() {
- return type.indentChild;
- }
-
- public boolean isJSP() {
- return true;
- }
- }
-
- // element IDs
- private static class Ids {
- public static final int ID_SCRIPTLET = 0;
- public static final int ID_EXPRESSION = 1;
- public static final int ID_DECLARATION = 2;
- public static final int ID_DIRECTIVE_PAGE = 3;
- public static final int ID_DIRECTIVE_INCLUDE = 4;
- public static final int ID_DIRECTIVE_TAGLIB = 5;
- public static final int ID_USEBEAN = 6;
- public static final int ID_SETPROPERTY = 7;
- public static final int ID_GETPROPERTY = 8;
- public static final int ID_INCLUDE = 9;
- public static final int ID_FORWARD = 10;
- public static final int ID_PLUGIN = 11;
- public static final int ID_PARAMS = 12;
- public static final int ID_FALLBACK = 13;
- public static final int ID_PARAM = 14;
- public static final int ID_ROOT = 15;
- public static final int ID_TEXT = 16;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- // attribute creater
- private class JACreater implements JSP11Namespace {
- // attribute declaration
- private class AttrDecl extends CMNodeImpl implements HTMLAttributeDeclaration {
- HTMLCMDataTypeImpl type = null;
- int usage = CMAttributeDeclaration.OPTIONAL;
-
- // methods
- public AttrDecl(String attrName) {
- super(attrName);
- }
-
- public String getAttrName() {
- return getNodeName();
- }
-
- public CMDataType getAttrType() {
- return type;
- }
-
- /** @deprecated by superclass */
- public String getDefaultValue() {
- if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
- return null;
- return type.getImpliedValue();
- }
-
- /** @deprecated by superclass */
- public Enumeration getEnumAttr() {
- Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
- return v.elements();
- }
-
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- public int getUsage() {
- return usage;
- }
-
- public boolean shouldIgnoreCase() {
- return false;
- }
- }
-
- private CMNamedNodeMapImpl declarations = null;
-
- public JACreater() {
- declarations = new CMNamedNodeMapImpl();
- }
-
- public CMNamedNodeMapImpl getDeclarations(int eid) {
- switch (eid) {
- case Ids.ID_DIRECTIVE_PAGE :
- createForDirPage();
- break;
- case Ids.ID_DIRECTIVE_INCLUDE :
- createForDirInclude();
- break;
- case Ids.ID_DIRECTIVE_TAGLIB :
- createForDirTaglib();
- break;
- case Ids.ID_USEBEAN :
- createForUseBean();
- break;
- case Ids.ID_SETPROPERTY :
- createForSetProperty();
- break;
- case Ids.ID_GETPROPERTY :
- createForGetProperty();
- break;
- case Ids.ID_INCLUDE :
- createForInclude();
- break;
- case Ids.ID_FORWARD :
- createForForward();
- break;
- case Ids.ID_PLUGIN :
- createForPlugin();
- break;
- case Ids.ID_PARAM :
- createForParam();
- break;
- case Ids.ID_ROOT :
- createForRoot();
- break;
- default :
- // should warn.
- break;
- }
- return declarations;
- }
-
- private AttrDecl createBoolType(String name, String defValue) {
- AttrDecl adec = new AttrDecl(name);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, defValue);
- return adec;
- }
-
- private void createForDirPage() {
- AttrDecl adec = null;
- // ("language" CDATA DECLARED "java")
- adec = new AttrDecl(ATTR_NAME_LANGUAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JAVA);
- declarations.putNamedItem(ATTR_NAME_LANGUAGE, adec);
-
- // ("extends" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_EXTENDS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_EXTENDS, adec);
-
- // ("contentType" CDATA DECLARED "text/html; ISO-8859-1")
- adec = new AttrDecl(ATTR_NAME_CONTENT_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_CT_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_CONTENT_TYPE, adec);
-
- // ("import" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IMPORT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_IMPORT, adec);
-
- // ("session" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_SESSION, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_SESSION, adec);
-
- // ("buffer" CDATA DECLARED "8kb")
- adec = new AttrDecl(ATTR_NAME_BUFFER);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_BUFSIZ_DEFAULT);
- declarations.putNamedItem(ATTR_NAME_BUFFER, adec);
-
- // ("autoFlush" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_AUTOFLUSH, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_AUTOFLUSH, adec);
-
- // ("isThreadSafe" ENUM DECLARED (true|false) "true")
- adec = createBoolType(ATTR_NAME_IS_THREAD_SAFE, ATTR_VALUE_TRUE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_IS_THREAD_SAFE, adec);
-
- // ("info" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_INFO);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_INFO, adec);
-
- // ("errorPage" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ERROR_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_ERROR_PAGE, adec);
-
- // ("isErrorPage" ENUM DECLARED (true|false) "false")
- adec = createBoolType(ATTR_NAME_IS_ERROR_PAGE, ATTR_VALUE_FALSE);
- if (adec != null)
- declarations.putNamedItem(ATTR_NAME_IS_ERROR_PAGE, adec);
-
- // ("pageEncoding" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_PAGE_ENCODING);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_PAGE_ENCODING, adec);
-
- }
-
- private void createForDirInclude() {
- // ("file" URI REQUIRED); Defect TORO:185241
- AttrDecl adec = new AttrDecl(ATTR_NAME_FILE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_FILE, adec);
- }
-
- private void createForDirTaglib() {
- // ("uri" URI REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_URI);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_URI, adec);
-
- // ("prefix" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PREFIX);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PREFIX, adec);
- }
-
- private void createForUseBean() {
- // ("id" ID REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_ID);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ID);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_ID, adec);
-
- // ("scope" ENUM DECLARED (page|session|request|application) "page")
- adec = new AttrDecl(ATTR_NAME_SCOPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_PAGE, ATTR_VALUE_SESSION, ATTR_VALUE_REQUEST, ATTR_VALUE_APPLICATION};
- adec.type.setEnumValues(values);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_PAGE);
- declarations.putNamedItem(ATTR_NAME_SCOPE, adec);
-
- // ("class" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_CLASS);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_CLASS, adec);
-
- // ("beanName" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_BEAN_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_BEAN_NAME, adec);
-
- // ("type" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_TYPE, adec);
- }
-
- private void createForSetProperty() {
- // ("name" IDREF REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.IDREF);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("property" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PROPERTY);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PROPERTY, adec);
-
- // ("value" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_VALUE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_VALUE, adec);
-
- // ("param" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_PARAM);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_PARAM, adec);
-
- }
-
- private void createForGetProperty() {
- // ("name" IDREF REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.IDREF);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("property" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PROPERTY);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PROPERTY, adec);
-
- }
-
- private void createForInclude() {
- AttrDecl adec = null;
- // ("page" URI REQUIRED)
- adec = new AttrDecl(ATTR_NAME_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PAGE, adec);
-
- // ("flush" ENUM REQUIRED (true|false)); Defect TORO:185241
- adec = new AttrDecl(ATTR_NAME_FLUSH);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.usage = CMAttributeDeclaration.OPTIONAL;
- String[] values = {ATTR_VALUE_TRUE, ATTR_VALUE_FALSE};
- adec.type.setEnumValues(values);
- declarations.putNamedItem(ATTR_NAME_FLUSH, adec);
- }
-
- private void createForForward() {
- // ("page" URI REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_PAGE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_PAGE, adec);
- }
-
- private void createForPlugin() {
- // ("type" ENUM REQUIRED (bean|applet))
- AttrDecl adec = new AttrDecl(ATTR_NAME_TYPE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- String[] values = {ATTR_VALUE_BEAN, ATTR_VALUE_APPLET};
- adec.type.setEnumValues(values);
- declarations.putNamedItem(ATTR_NAME_TYPE, adec);
-
- // ("code" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODE, adec);
-
- // ("codebase" URI REQUIRED)
- adec = new AttrDecl(ATTR_NAME_CODEBASE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_CODEBASE, adec);
-
- // ("align" ENUM IMPLIED (top|middle|bottom|left|right))
- adec = new AttrDecl(ATTR_NAME_ALIGN);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] aligns = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- adec.type.setEnumValues(aligns);
- declarations.putNamedItem(ATTR_NAME_ALIGN, adec);
-
- // ("archive" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_ARCHIVE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_ARCHIVE, adec);
-
- // ("height" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HEIGHT);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HEIGHT, adec);
-
- // ("hspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_HSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_HSPACE, adec);
-
- // ("jreversion" CDATA DECLARED "1.1")
- adec = new AttrDecl(ATTR_NAME_JREVERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_JVER11);
- declarations.putNamedItem(ATTR_NAME_JREVERSION, adec);
-
- // ("name" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("vspace" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_VSPACE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_VSPACE, adec);
-
- // ("width" CDATA IMPLIED)
- adec = new AttrDecl(ATTR_NAME_WIDTH);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- declarations.putNamedItem(ATTR_NAME_WIDTH, adec);
-
- // ("nspluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_NSPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_NSPLUGINURL, adec);
-
- // ("iepluginurl" URI IMPLIED)
- adec = new AttrDecl(ATTR_NAME_IEPLUGINURL);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.URI);
- declarations.putNamedItem(ATTR_NAME_IEPLUGINURL, adec);
- }
-
- private void createForParam() {
- // ("name" CDATA REQUIRED)
- AttrDecl adec = new AttrDecl(ATTR_NAME_NAME);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_NAME, adec);
-
- // ("value" CDATA REQUIRED); Defect TORO:185241
- adec = new AttrDecl(ATTR_NAME_VALUE);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_VALUE, adec);
-
- }
-
- private void createForRoot() {
- // ("xmlns:jsp" CDATA "http://jva.sun.com/JSP/Page")
- AttrDecl adec = new AttrDecl(ATTR_NAME_XMLNS_JSP);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.type.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_XMLNS_JSP);
- declarations.putNamedItem(ATTR_NAME_XMLNS_JSP, adec);
- // ("version" CDATA REQUIRED)
- adec = new AttrDecl(ATTR_NAME_VERSION);
- adec.type = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- adec.usage = CMAttributeDeclaration.REQUIRED;
- declarations.putNamedItem(ATTR_NAME_VERSION, adec);
- }
- }
-
- private final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- };
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_SCRIPTLET] = SCRIPTLET;
- names[Ids.ID_EXPRESSION] = EXPRESSION;
- names[Ids.ID_DECLARATION] = DECLARATION;
- names[Ids.ID_DIRECTIVE_PAGE] = DIRECTIVE_PAGE;
- names[Ids.ID_DIRECTIVE_INCLUDE] = DIRECTIVE_INCLUDE;
- names[Ids.ID_DIRECTIVE_TAGLIB] = DIRECTIVE_TAGLIB;
- names[Ids.ID_USEBEAN] = USEBEAN;
- names[Ids.ID_SETPROPERTY] = SETPROPERTY;
- names[Ids.ID_GETPROPERTY] = GETPROPERTY;
- names[Ids.ID_INCLUDE] = INCLUDE;
- names[Ids.ID_FORWARD] = FORWARD;
- names[Ids.ID_PLUGIN] = PLUGIN;
- names[Ids.ID_PARAMS] = PARAMS;
- names[Ids.ID_FALLBACK] = FALLBACK;
- names[Ids.ID_PARAM] = PARAM;
- names[Ids.ID_ROOT] = ROOT;
- names[Ids.ID_TEXT] = TEXT;
- }
-
- /**
- */
- public JSPElementCollection() {
- super(names, TOLERANT_CASE);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param elementName java.lang.String
- */
- protected CMNode create(String elementName) {
- return createElemDecl(getID(elementName));
- }
-
- /**
- * @param eid int
- */
- private CMGroupImpl createContent(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- CMGroupImpl content = null;
- CMNode child = null;
-
- switch (eid) {
- case Ids.ID_INCLUDE :
- case Ids.ID_FORWARD :
- // (jsp:param)*
- content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
- child = item(Ids.ID_PARAM);
- if (child != null)
- content.appendChild(child);
- break;
- case Ids.ID_PLUGIN :
- // (jsp:params | jsp:fallback)?
- content = new CMGroupImpl(CMGroup.CHOICE, 0, 1);
- // jsp:params
- child = item(Ids.ID_PARAMS);
- if (child != null)
- content.appendChild(child);
- // jsp:fallback
- child = item(Ids.ID_FALLBACK);
- if (child != null)
- content.appendChild(child);
- break;
- case Ids.ID_PARAMS :
- // (jsp:param)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- child = item(Ids.ID_PARAM);
- if (child != null)
- content.appendChild(child);
- break;
- case Ids.ID_ROOT :
- // %Body;
- // --> (jsp:text|%Directives;|%Scripts;|%Actions;)*
- // %Directives --> jsp:directive.page|jsp:directive.include
- // %Scripts; --> jsp:scriptlet|jsp:declaration|jsp:expression
- // %Actions --> jsp:useBean|jsp.setProperty|jsp:getProperty
- // |jsp:include|jsp:forward|jsp:plugin
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- int validChildren[] = {Ids.ID_TEXT,
- // %Directves;
- Ids.ID_DIRECTIVE_PAGE, Ids.ID_DIRECTIVE_INCLUDE,
- // %Scripts;
- Ids.ID_SCRIPTLET, Ids.ID_DECLARATION, Ids.ID_EXPRESSION,
- // %Actions;
- Ids.ID_USEBEAN, Ids.ID_SETPROPERTY, Ids.ID_GETPROPERTY, Ids.ID_INCLUDE, Ids.ID_FORWARD, Ids.ID_PLUGIN};
- for (int i = 0; i < validChildren.length; i++) {
- child = item(validChildren[i]);
- if (child != null)
- content.appendChild(child);
- }
- break;
- }
-
- return content;
- }
-
- /**
- * @param eid int
- */
- private HTMLElementDeclaration createElemDecl(int eid) {
- if (eid == ID_UNKNOWN)
- return null;
-
- TypePacket packet = new TypePacket();
- switch (eid) {
- case Ids.ID_SCRIPTLET :
- // content, omit, lineBreak, layout, correct, format
- // scriptlet
- packet.name = SCRIPTLET;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_EXPRESSION :
- // expression
- packet.name = EXPRESSION;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_DECLARATION :
- // declaration
- packet.name = DECLARATION;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_SCRIPT;
- break;
- case Ids.ID_DIRECTIVE_PAGE :
- // directive.page
- packet.name = DIRECTIVE_PAGE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_DIRECTIVE_INCLUDE :
- // directive.inlcude
- packet.name = DIRECTIVE_INCLUDE;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_DIRECTIVE_TAGLIB :
- // directive.taglib
- packet.name = DIRECTIVE_TAGLIB;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.format = HTMLElementDeclaration.FORMAT_JSP_DIRECTIVE;
- break;
- case Ids.ID_USEBEAN :
- // useBean
- packet.name = USEBEAN;
- packet.content = CMElementDeclaration.ANY;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.indentChild = true;
- break;
- case Ids.ID_SETPROPERTY :
- // setProperty
- packet.name = SETPROPERTY;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- break;
- case Ids.ID_GETPROPERTY :
- // getProperty
- packet.name = GETPROPERTY;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- break;
- case Ids.ID_INCLUDE :
- // include
- packet.name = INCLUDE;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- case Ids.ID_FORWARD :
- // forward
- packet.name = FORWARD;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- case Ids.ID_PLUGIN :
- // plugin
- packet.name = PLUGIN;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_OBJECT;
- packet.indentChild = true;
- break;
- case Ids.ID_PARAMS :
- // params
- packet.name = PARAMS;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- packet.indentChild = true;
- break;
- case Ids.ID_FALLBACK :
- // fallback
- packet.name = FALLBACK;
- packet.content = CMElementDeclaration.CDATA;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- break;
- case Ids.ID_PARAM :
- // param
- packet.name = PARAM;
- packet.omit = HTMLElementDeclaration.OMIT_END;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN;
- break;
- case Ids.ID_ROOT :
- packet.name = ROOT;
- packet.content = CMElementDeclaration.ELEMENT;
- packet.layout = HTMLElementDeclaration.LAYOUT_HIDDEN; // same as HTML
- break;
- case Ids.ID_TEXT :
- packet.name = TEXT;
- packet.content = CMElementDeclaration.PCDATA;
- break;
- default :
- // unknown ID
- return null;
- }
-
- ElemDecl dec = new ElemDecl(packet);
-
- CMGroupImpl content = createContent(eid);
- if (content != null)
- dec.setContent(content);
-
- JACreater creater = new JACreater();
- dec.setAttributes(creater.getDeclarations(eid));
-
- return dec;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.java
deleted file mode 100644
index 09cba4b407..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProvider.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.core.internal.contentmodel;
-
-
-/**
- * PropertyProvider class.
- * This class is intended to be used in HTMLElementDeclaration instances.
- */
-interface PropertyProvider {
-
- boolean supports(HTMLElementDeclaration edecl);
-
- Object get(HTMLElementDeclaration edecl);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java
deleted file mode 100644
index 38e2619c54..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/PropertyProviderFactory.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-/**
- * The factory object of PropertyProvider.
- */
-final class PropertyProviderFactory {
-
-
- /**
- * DefaultProvider is intended to be used for unknown properties.
- * It always returns null value for any properties.
- */
- class DefaultProvider implements PropertyProvider {
- public DefaultProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return false;
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- return null;
- }
- }
-
- abstract class AbstractElementPropertyProvider implements PropertyProvider {
- protected AbstractElementPropertyProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return (edecl != null);
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- if (!(edecl instanceof HTMLPropertyDeclaration))
- return null;
- return getElementProperty((HTMLPropertyDeclaration)edecl);
- }
-
- abstract protected Object getElementProperty(HTMLPropertyDeclaration decl);
- }
-
- /*
- * "tagInfo"
- * gets documentation for the element
- */
- class PPTagInfo extends AbstractElementPropertyProvider {
- private final static String htmlAnnotationLoc = "data/htmref.xml"; //$NON-NLS-1$
- protected AnnotationMap fAnnotationMap = null;
-
- public PPTagInfo() {
- super();
- }
-
- /**
- * Gets the annotationMap.
- * @return Returns a AnnotationMap
- */
- protected AnnotationMap getAnnotationMap() {
- if (fAnnotationMap == null) {
- fAnnotationMap = new AnnotationMap();
- try {
- fAnnotationMap.load(htmlAnnotationLoc, HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
- }
- catch (Exception e) {
- // no annotation available
- }
- }
- return fAnnotationMap;
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (decl instanceof HTMLElementDeclaration) {
- return getAnnotationMap().getProperty(((HTMLElementDeclaration)decl).getElementName(), "tagInfo"); //$NON-NLS-1$
- } else {
- return null;
- }
- }
- }
-
- /*
- * "shouldKeepSpace"
- */
- class PPShouldKeepSpace extends AbstractElementPropertyProvider {
- public PPShouldKeepSpace() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldKeepSpaces());
- }
- }
-
- /*
- * "shouldIndentChildSource"
- */
- class PPShouldIndentChildSource extends AbstractElementPropertyProvider {
- public PPShouldIndentChildSource() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldIndentChildSource());
- }
- }
-
- /*
- * "terminators"
- */
- class PPTerminators extends AbstractElementPropertyProvider {
- public PPTerminators() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (! (decl instanceof HTMLElemDeclImpl)) return null;
- return ((HTMLElemDeclImpl)decl).getTerminators();
- }
- }
-
- /*
- * "prohibitedAncestors"
- */
- class PPProhibitedAncestors extends AbstractElementPropertyProvider {
- public PPProhibitedAncestors() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getProhibitedAncestors();
- }
- }
-
- /*
- * "isJSP"
- */
- class PPIsJSP extends AbstractElementPropertyProvider {
- public PPIsJSP() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.isJSP());
- }
- }
-
- /*
- * "isXHTML"
- * HTMLElementDeclaration itself never represent any XHTML element declaration.
- * So, this property must be always false.
- */
- class PPIsXHTML extends AbstractElementPropertyProvider {
- public PPIsXHTML() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "isSSI"
- * Each declaration class for SSI elements must provide this property itself,
- * and then return true. Other declaration must always return false.
- */
- class PPIsSSI extends AbstractElementPropertyProvider {
- public PPIsSSI() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "lineBreakHint"
- */
- class PPLineBreakHint extends AbstractElementPropertyProvider {
- public PPLineBreakHint() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String hint = HTMLCMProperties.Values.BREAK_NONE;
- switch (decl.getLineBreakHint()) {
- case HTMLElementDeclaration.BREAK_AFTER_START :
- hint = HTMLCMProperties.Values.BREAK_AFTER_START;
- break;
- case HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END :
- hint = HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END;
- break;
- case HTMLElementDeclaration.BREAK_NONE :
- // nothing to do
- default :
- break;
- }
- return hint;
- }
- }
-
- /*
- * "layoutType"
- */
- class PPLayoutType extends AbstractElementPropertyProvider {
- public PPLayoutType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.LAYOUT_NONE;
- switch (decl.getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- type = HTMLCMProperties.Values.LAYOUT_BLOCK;
- break;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- type = HTMLCMProperties.Values.LAYOUT_BREAK;
- break;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- type = HTMLCMProperties.Values.LAYOUT_HIDDEN;
- break;
- case HTMLElementDeclaration.LAYOUT_OBJECT :
- type = HTMLCMProperties.Values.LAYOUT_OBJECT;
- break;
- case HTMLElementDeclaration.LAYOUT_WRAP :
- type = HTMLCMProperties.Values.LAYOUT_WRAP;
- break;
- case HTMLElementDeclaration.LAYOUT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "omitType"
- */
- class PPOmitType extends AbstractElementPropertyProvider {
- public PPOmitType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.OMIT_NONE;
- switch (decl.getOmitType()) {
- case HTMLElementDeclaration.OMIT_BOTH :
- type = HTMLCMProperties.Values.OMIT_BOTH;
- break;
- case HTMLElementDeclaration.OMIT_END :
- type = HTMLCMProperties.Values.OMIT_END;
- break;
- case HTMLElementDeclaration.OMIT_END_DEFAULT :
- type = HTMLCMProperties.Values.OMIT_END_DEFAULT;
- break;
- case HTMLElementDeclaration.OMIT_END_MUST :
- type = HTMLCMProperties.Values.OMIT_END_MUST;
- break;
- case HTMLElementDeclaration.OMIT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "inclusion"
- */
- class PPInclusion extends AbstractElementPropertyProvider {
- public PPInclusion() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getInclusion();
- }
- }
-
- public static PropertyProvider getProvider(String propName) {
- PropertyProviderFactory factory = getInstance();
- PropertyProvider pp = (PropertyProvider) factory.registry.get(propName);
- if (pp != null)
- return pp;
-
- pp = factory.create(propName);
- if (pp == null)
- return factory.defaultProvider;
-
- factory.registry.put(propName, pp);
- return pp;
- }
-
- private static PropertyProviderFactory instance = null;
-
- private synchronized static PropertyProviderFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new PropertyProviderFactory();
- return instance;
- }
-
- private Hashtable registry = new Hashtable();
- private PropertyProvider defaultProvider = new DefaultProvider();
-
- private PropertyProviderFactory() {
- super();
- }
-
- private PropertyProvider create(String propName) {
- PropertyProvider pp = null;
- if (propName.equals(HTMLCMProperties.IS_JSP))
- pp = new PPIsJSP();
- else if (propName.equals(HTMLCMProperties.IS_XHTML))
- pp = new PPIsXHTML();
- else if (propName.equals(HTMLCMProperties.IS_SSI))
- pp = new PPIsSSI();
- else if (propName.equals(HTMLCMProperties.LAYOUT_TYPE))
- pp = new PPLayoutType();
- else if (propName.equals(HTMLCMProperties.LINE_BREAK_HINT))
- pp = new PPLineBreakHint();
- else if (propName.equals(HTMLCMProperties.PROHIBITED_ANCESTORS))
- pp = new PPProhibitedAncestors();
- else if (propName.equals(HTMLCMProperties.SHOULD_KEEP_SPACE))
- pp = new PPShouldKeepSpace();
- else if (propName.equals(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE))
- pp = new PPShouldIndentChildSource();
- else if (propName.equals(HTMLCMProperties.TERMINATORS))
- pp = new PPTerminators();
- else if (propName.equals(HTMLCMProperties.TAGINFO))
- pp = new PPTagInfo();
- else if (propName.equals(HTMLCMProperties.OMIT_TYPE))
- pp = new PPOmitType();
- else if (propName.equals(HTMLCMProperties.INCLUSION))
- pp = new PPInclusion();
-
- return pp;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java
deleted file mode 100644
index 5d282031da..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/AttributeCollection.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for attribute declarations.
- */
-final class AttributeCollection extends CMNamedNodeMapImpl implements CHTMLNamespace {
- /**
- * constructor.
- */
- public AttributeCollection() {
- super();
- }
-
- /**
- * Create an attribute declaration.
- * @param attrName java.lang.String
- */
- private HTMLAttrDeclImpl create(String attrName) {
- HTMLAttrDeclImpl attr = null;
- HTMLCMDataTypeImpl atype = null;
-
- if (attrName.equalsIgnoreCase(ATTR_NAME_ACTION)) {
- // (action %URI #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ACTION, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ALT)) {
- // (alt %Text; #REQUIRED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.TEXT);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ALT, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_BORDER)) {
- // (border %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_BORDER, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CHECKED)) {
- // (checked (checked) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_CHECKED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CHECKED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_CLEAR)) {
- // (clear (left | all | right | none) none)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_ALL, ATTR_VALUE_RIGHT, ATTR_VALUE_NONE};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_NONE);
-
- attr = new HTMLAttrDeclImpl(ATTR_NAME_CLEAR, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_COLS)) {
- // (cols NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_COLS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ENCTYPE)) {
- // (enctype %ContentType; "application/x-www-form-urlencoded")
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_WWW_FORM_URLENCODED);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ENCTYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HEIGHT)) {
- // (height %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HEIGHT, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HREF)) {
- // (href %URI; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HREF, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HSPACE)) {
- // (hspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_HTTP_EQUIV)) {
- // (http-equiv NAME #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_HTTP_EQUIV, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MAXLENGTH)) {
- // (maxlength NUMBER #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MAXLENGTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_METHOD)) {
- // (method (GET|POST) GET)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_VALUE_GET, ATTR_VALUE_POST};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_GET);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_METHOD, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_MULTIPLE)) {
- // (multiple (multiple) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_MULTIPLE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_MULTIPLE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NAME)) {
- // (name CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_NOSHADE)) {
- // (noshade (noshade) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_NOSHADE};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_NOSHADE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_ROWS)) {
- // (rows NUMBER #REQUIRED)
- atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_ROWS, atype, CMAttributeDeclaration.REQUIRED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SELECTED)) {
- // (selected (selected) #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {ATTR_NAME_SELECTED};
- atype.setEnumValues(values);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SELECTED, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SIZE)) {
- // (size %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_SRC)) {
- // (src %URI; #IMPLIED)
- // NOTE: "src" attributes are defined in several elements.
- // The definition of IMG is different from others.
- // So, it should be locally defined.
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_SRC, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_TYPE)) {
- // (type %CotentType; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.CONTENT_TYPE);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VALUE)) {
- // (value CDATA #IMPLIED)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VALUE, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VERSION)) {
- // (version CDATA #FIXED '%HTML.Version;)
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_FIXED, ATTR_VALUE_VERSION_TRANSITIONAL);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VERSION, atype, CMAttributeDeclaration.FIXED);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_WIDTH)) {
- // (width %Length; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.LENGTH);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
-
- }
- else if (attrName.equalsIgnoreCase(ATTR_NAME_VSPACE)) {
- // (vspace %Pixels; #IMPLIED)
- atype = new HTMLCMDataTypeImpl(HTMLCMDataType.PIXELS);
- attr = new HTMLAttrDeclImpl(ATTR_NAME_VSPACE, atype, CMAttributeDeclaration.OPTIONAL);
-
- // <<D205514
- }
- else {
- // unknown attribute; maybe error.
- // should warn.
- attr = null;
- }
-
- return attr;
- }
-
- /**
- * Get %bodycolors; declarations.
- */
- public void getBodycolors(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get align attribute which has %IAlign; as values..
- */
- public static final HTMLAttrDeclImpl createAlignForImage() {
- // align (local)
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values
- String[] values = {ATTR_VALUE_TOP, ATTR_VALUE_MIDDLE, ATTR_VALUE_BOTTOM, ATTR_VALUE_LEFT, ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Create an attribute declaration for <code>align</code>
- * in several elements, like <code>P</code>, <code>DIV</code>.
- * The values are different from attributes those have the same name
- * in other elements (<code>IMG</code> and <code>TABLE</code>).
- * So, it can't treat as global attributes.
- * <strong>NOTE: These attribute declaration has
- * no owner CMDocument instance.</strong>
- */
- public static final HTMLAttrDeclImpl createAlignForParagraph() {
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- // set enum values: left|center|right|justify
- String[] values = {ATTR_VALUE_LEFT, ATTR_VALUE_CENTER, ATTR_VALUE_RIGHT,};
- atype.setEnumValues(values);
-
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- return attr;
- }
-
- /**
- * Get %attrs; declarations.
- * %attrs; consists of %coreattrs;, %i18n, and %events;.
- */
- public void getAttrs(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get %coreattrs; declarations.
- */
- public void getCore(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get a global attribute declaration.
- * @param attrName java.lang.String
- */
- public HTMLAttributeDeclaration getDeclaration(String attrName) {
- CMNode cmnode = getNamedItem(attrName);
- if (cmnode != null)
- return (HTMLAttributeDeclaration) cmnode; // already exists.
-
- HTMLAttrDeclImpl dec = create(attrName);
- if (dec != null)
- putNamedItem(attrName, dec);
-
- return dec;
- }
-
- /**
- * Get declarations which are specified by names.
- * @param names java.util.Iterator
- */
- public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
- while (names.hasNext()) {
- String attrName = (String) names.next();
- HTMLAttributeDeclaration dec = getDeclaration(attrName);
- if (dec != null)
- declarations.putNamedItem(attrName, dec);
- }
- }
-
- /**
- * Get %events; declarations.
- */
- public void getEvents(CMNamedNodeMapImpl declarations) {
- }
-
- /**
- * Get %i18n; declarations.
- */
- public void getI18n(CMNamedNodeMapImpl declarations) {
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java
deleted file mode 100644
index 5ebf483fbf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHCMDocImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLEntityDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * CMDocument implementation for the HTML.
- */
-public class CHCMDocImpl extends CMNodeImpl implements HTMLCMDocument {
-
- /** Namespace for all names of elements, entities and attributes. */
- private CMNamespace namespace = null;
- private ElementCollection elements = null;
- private EntityCollection entities = null;
- private AttributeCollection attributes = null;
-
- /**
- */
- public CHCMDocImpl(String docTypeName, CMNamespace targetNamespace) {
- super(docTypeName);
- namespace = targetNamespace;
- attributes = new AttributeCollection();
- elements = new ElementCollection(attributes);
- entities = new EntityCollection();
- }
-
- AttributeCollection getAttributes() {
- return attributes;
- }
-
- public HTMLElementDeclaration getElementDeclaration(String elementName) {
- if (elements == null)
- return null;
- return (HTMLElementDeclaration) elements.getNamedItem(elementName);
- }
-
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- public CMNamedNodeMap getEntities() {
- return entities;
- }
-
- public HTMLEntityDeclaration getEntityDeclaration(String entityName) {
- if (entities == null)
- return null;
- return (HTMLEntityDeclaration) entities.getNamedItem(entityName);
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDocument
- */
- public org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace getNamespace() {
- return namespace;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java
deleted file mode 100644
index 95d5c21a1d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CHTMLNamespace.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-
-
-
-/**
- * Provide all names defined in the HTML 4.0? specification.
- */
-public interface CHTMLNamespace {
-
- // Element names
- public static interface ElementName {
- public static final String A = HTML40Namespace.ElementName.A;
- public static final String ADDRESS = HTML40Namespace.ElementName.ADDRESS;
- public static final String BASE = HTML40Namespace.ElementName.BASE;
- public static final String BLOCKQUOTE = HTML40Namespace.ElementName.BLOCKQUOTE;
- public static final String BODY = HTML40Namespace.ElementName.BODY;
- public static final String BR = HTML40Namespace.ElementName.BR;
- public static final String CENTER = HTML40Namespace.ElementName.CENTER;
- public static final String DD = HTML40Namespace.ElementName.DD;
- public static final String DIR = HTML40Namespace.ElementName.DIR;
- public static final String DIV = HTML40Namespace.ElementName.DIV;
- public static final String DL = HTML40Namespace.ElementName.DL;
- public static final String DT = HTML40Namespace.ElementName.DT;
- public static final String FORM = HTML40Namespace.ElementName.FORM;
- public static final String H1 = HTML40Namespace.ElementName.H1;
- public static final String H2 = HTML40Namespace.ElementName.H2;
- public static final String H3 = HTML40Namespace.ElementName.H3;
- public static final String H4 = HTML40Namespace.ElementName.H4;
- public static final String H5 = HTML40Namespace.ElementName.H5;
- public static final String H6 = HTML40Namespace.ElementName.H6;
- public static final String HEAD = HTML40Namespace.ElementName.HEAD;
- public static final String HR = HTML40Namespace.ElementName.HR;
- public static final String HTML = HTML40Namespace.ElementName.HTML;
- public static final String IMG = HTML40Namespace.ElementName.IMG;
- public static final String INPUT = HTML40Namespace.ElementName.INPUT;
- public static final String LI = HTML40Namespace.ElementName.LI;
- public static final String MENU = HTML40Namespace.ElementName.MENU;
- public static final String META = HTML40Namespace.ElementName.META;
- public static final String OL = HTML40Namespace.ElementName.OL;
- public static final String OPTION = HTML40Namespace.ElementName.OPTION;
- public static final String P = HTML40Namespace.ElementName.P;
- public static final String PRE = HTML40Namespace.ElementName.PRE;
- public static final String SELECT = HTML40Namespace.ElementName.SELECT;
- public static final String TEXTAREA = HTML40Namespace.ElementName.TEXTAREA;
- public static final String TITLE = HTML40Namespace.ElementName.TITLE;
- public static final String UL = HTML40Namespace.ElementName.UL;
- public static final String SSI_CONFIG = HTML40Namespace.ElementName.SSI_CONFIG;
- public static final String SSI_ECHO = HTML40Namespace.ElementName.SSI_ECHO;
- public static final String SSI_EXEC = HTML40Namespace.ElementName.SSI_EXEC;
- public static final String SSI_FSIZE = HTML40Namespace.ElementName.SSI_FSIZE;
- public static final String SSI_FLASTMOD = HTML40Namespace.ElementName.SSI_FLASTMOD;
- public static final String SSI_INCLUDE = HTML40Namespace.ElementName.SSI_INCLUDE;
- public static final String SSI_PRINTENV = HTML40Namespace.ElementName.SSI_PRINTENV;
- public static final String SSI_SET = HTML40Namespace.ElementName.SSI_SET;
- }
-
- // Character Entities
- public static interface EntityName {
- }
-
- // global attribute names
- public static final String ATTR_NAME_VERSION = HTML40Namespace.ATTR_NAME_VERSION;
- public static final String ATTR_NAME_SRC = HTML40Namespace.ATTR_NAME_SRC;
- public static final String ATTR_NAME_ALT = HTML40Namespace.ATTR_NAME_ALT;
- public static final String ATTR_NAME_HEIGHT = HTML40Namespace.ATTR_NAME_HEIGHT;
- public static final String ATTR_NAME_WIDTH = HTML40Namespace.ATTR_NAME_WIDTH;
- public static final String ATTR_NAME_ALIGN = HTML40Namespace.ATTR_NAME_ALIGN;
- public static final String ATTR_NAME_BORDER = HTML40Namespace.ATTR_NAME_BORDER;
- public static final String ATTR_NAME_HSPACE = HTML40Namespace.ATTR_NAME_HSPACE;
- public static final String ATTR_NAME_VSPACE = HTML40Namespace.ATTR_NAME_VSPACE;
- public static final String ATTR_NAME_NAME = HTML40Namespace.ATTR_NAME_NAME;
- public static final String ATTR_NAME_CLEAR = HTML40Namespace.ATTR_NAME_CLEAR;
- public static final String ATTR_NAME_NOSHADE = HTML40Namespace.ATTR_NAME_NOSHADE;
- public static final String ATTR_NAME_CHECKED = HTML40Namespace.ATTR_NAME_CHECKED;
- public static final String ATTR_NAME_MAXLENGTH = HTML40Namespace.ATTR_NAME_MAXLENGTH;
- public static final String ATTR_NAME_ISTYLE = HTML40Namespace.ATTR_NAME_ISTYLE;
- public static final String ATTR_NAME_HTTP_EQUIV = HTML40Namespace.ATTR_NAME_HTTP_EQUIV;
- public static final String ATTR_NAME_CONTENT = HTML40Namespace.ATTR_NAME_CONTENT;
-
- public static final String ATTR_NAME_HREF = HTML40Namespace.ATTR_NAME_HREF;
- public static final String ATTR_NAME_MULTIPLE = HTML40Namespace.ATTR_NAME_MULTIPLE;
- public static final String ATTR_NAME_SELECTED = HTML40Namespace.ATTR_NAME_SELECTED;
- public static final String ATTR_NAME_ROWS = HTML40Namespace.ATTR_NAME_ROWS;
- public static final String ATTR_NAME_COLS = HTML40Namespace.ATTR_NAME_COLS;
- public static final String ATTR_NAME_ACTION = HTML40Namespace.ATTR_NAME_ACTION;
- public static final String ATTR_NAME_METHOD = HTML40Namespace.ATTR_NAME_METHOD;
- public static final String ATTR_NAME_ENCTYPE = HTML40Namespace.ATTR_NAME_ENCTYPE;
- public static final String ATTR_NAME_SIZE = HTML40Namespace.ATTR_NAME_SIZE;
- public static final String ATTR_NAME_TYPE = HTML40Namespace.ATTR_NAME_TYPE;
- public static final String ATTR_NAME_VALUE = HTML40Namespace.ATTR_NAME_VALUE;
-
-
-
- public static final String ATTR_NAME_ERRMSG = HTML40Namespace.ATTR_NAME_ERRMSG;
- public static final String ATTR_NAME_SIZEFMT = HTML40Namespace.ATTR_NAME_SIZEFMT;
- public static final String ATTR_NAME_TIMEFMT = HTML40Namespace.ATTR_NAME_TIMEFMT;
- public static final String ATTR_NAME_VAR = HTML40Namespace.ATTR_NAME_VAR;
- public static final String ATTR_NAME_CGI = HTML40Namespace.ATTR_NAME_CGI;
- public static final String ATTR_NAME_CMD = HTML40Namespace.ATTR_NAME_CMD;
- public static final String ATTR_NAME_FILE = HTML40Namespace.ATTR_NAME_FILE;
- public static final String ATTR_NAME_VIRTUAL = HTML40Namespace.ATTR_NAME_VIRTUAL;
-
- // global attribute values; mainly used in enumeration.
- public static final String ATTR_VALUE_VERSION_TRANSITIONAL = "-//W3C//DTD Compact HTML 1.0 Draft//EN"; //$NON-NLS-1$
- // for align (top|middle|bottom|left|right)
- public static final String ATTR_VALUE_TOP = HTML40Namespace.ATTR_VALUE_TOP;
- public static final String ATTR_VALUE_MIDDLE = HTML40Namespace.ATTR_VALUE_MIDDLE;
- public static final String ATTR_VALUE_BOTTOM = HTML40Namespace.ATTR_VALUE_BOTTOM;
- public static final String ATTR_VALUE_LEFT = HTML40Namespace.ATTR_VALUE_LEFT;
- public static final String ATTR_VALUE_CENTER = HTML40Namespace.ATTR_VALUE_CENTER;
- public static final String ATTR_VALUE_RIGHT = HTML40Namespace.ATTR_VALUE_RIGHT;
- // for clear (left|all|right|none): left and right are already defined above.
- public static final String ATTR_VALUE_ALL = HTML40Namespace.ATTR_VALUE_ALL;
- public static final String ATTR_VALUE_NONE = HTML40Namespace.ATTR_VALUE_NONE;
- // for type of INPUT
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- public static final String ATTR_VALUE_TEXT = HTML40Namespace.ATTR_VALUE_TEXT;
- public static final String ATTR_VALUE_PASSWORD = HTML40Namespace.ATTR_VALUE_PASSWORD;
- public static final String ATTR_VALUE_CHECKBOX = HTML40Namespace.ATTR_VALUE_CHECKBOX;
- public static final String ATTR_VALUE_RADIO = HTML40Namespace.ATTR_VALUE_RADIO;
- public static final String ATTR_VALUE_SUBMIT = HTML40Namespace.ATTR_VALUE_SUBMIT;
- public static final String ATTR_VALUE_RESET = HTML40Namespace.ATTR_VALUE_RESET;
- public static final String ATTR_VALUE_HIDDEN = HTML40Namespace.ATTR_VALUE_HIDDEN;
- // for span, colspan, rowspan
- public static final String ATTR_VALUE_1 = HTML40Namespace.ATTR_VALUE_1;
- // for frameborder
- public static final String ATTR_VALUE_0 = HTML40Namespace.ATTR_VALUE_0;
- // for method of FORM
- public static final String ATTR_VALUE_GET = HTML40Namespace.ATTR_VALUE_GET;
- public static final String ATTR_VALUE_POST = HTML40Namespace.ATTR_VALUE_POST;
- public static final String ATTR_VALUE_WWW_FORM_URLENCODED = HTML40Namespace.ATTR_VALUE_WWW_FORM_URLENCODED;
- // for behaviro of MARQUEE
- public static final String ATTR_VALUE_SCROLL = HTML40Namespace.ATTR_VALUE_SCROLL;
- public static final String ATTR_VALUE_SLIDE = HTML40Namespace.ATTR_VALUE_SLIDE;
- public static final String ATTR_VALUE_ALTERNATE = HTML40Namespace.ATTR_VALUE_ALTERNATE;
- // for direction of MARQUEE
- public static final String ATTR_VALUE_UP = HTML40Namespace.ATTR_VALUE_UP;
- public static final String ATTR_VALUE_DOWN = HTML40Namespace.ATTR_VALUE_DOWN;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.java
deleted file mode 100644
index 28b7966b9d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMContentImpl.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.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Implementation of CMContent for HTML CM.
- */
-abstract class CMContentImpl extends CMNodeImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMContent {
-
- public static final int UNBOUNDED = -1;
- /** -1: it's UNBOUNDED. */
- private int maxOccur = UNBOUNDED;
- /** 0: it's OPTIONAL, 1, it's REQUIRED. */
- private int minOccur = 0;
-
- /**
- * The primary consturctor.
- * Use this one for usual cases.<br>
- */
- public CMContentImpl(String name, int min, int max) {
- super(name);
- minOccur = min;
- maxOccur = max;
- }
-
- /**
- * 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;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.java
deleted file mode 100644
index 812b3ed3dc..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMGroupImpl.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-
-/**
- */
-class CMGroupImpl extends CMContentImpl implements CMGroup {
-
- private int operator = CMGroup.SEQUENCE;
- private CMNodeListImpl children = null;
-
- /**
- * CMGroupImpl constructor comment.
- */
- public CMGroupImpl(int op, int minOccur, int maxOccur) {
- super(null, minOccur, maxOccur);
- switch (op) {
- case CMGroup.ALL :
- case CMGroup.CHOICE :
- case CMGroup.SEQUENCE :
- operator = op;
- break;
- default :
- // should warn.
- break;
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendChild(CMNode child) {
- if (child == null)
- return null;
- if (children == null)
- children = new CMNodeListImpl();
- return children.appendNode(child);
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList
- */
- public CMNodeList getChildNodes() {
- return children;
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.GROUP;
- }
-
- /**
- * getOperation method
- * @return int
- *
- * Returns one of :
- * ALONE (a), SEQUENCE (a,b), CHOICE (a|b), ALL (a&b).
- */
- public int getOperator() {
- return operator;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
deleted file mode 100644
index 098f91ae1a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNamedNodeMapImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * An implementation of the CMNamedNodeMap interface. This class is intented
- * to be used as a container of attribute declarations. If someone wants to
- * use this class for other purpose, he must pay attention to the fact that
- * this class is tolerant of the key name case. That is, this class does not
- * distinguish "name", "NAME", and "Name" as a key name.
- */
-class CMNamedNodeMapImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap {
-
- private java.util.Hashtable items = null;
-
- /**
- */
- public CMNamedNodeMapImpl() {
- super();
- items = new java.util.Hashtable();
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- return items.size();
- }
-
- /**
- * getNamedItem method
- *
- * @return CMNode <code>null</code> for unknown keys.
- * @param name
- * java.lang.String
- */
- public CMNode getNamedItem(String name) {
- String cookedName = makeCanonicalForm(name);
- if (!items.containsKey(cookedName))
- return null;
- return (CMNode) items.get(cookedName);
- }
-
- /**
- * item method
- *
- * @return CMNode
- * @param index
- * int
- */
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- CMNode node = (CMNode) iter.next();
- if (--index < 0)
- return node;
- }
- return null;
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator iterator() {
- return items.values().iterator();
- }
-
- /**
- * @return java.lang.String
- * @param rawForm
- * java.lang.String
- */
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
-
- /**
- * @param key
- * java.lang.String
- * @param item
- * java.lang.String
- */
- void putNamedItem(String name, CMNode item) {
- String cookedName = makeCanonicalForm(name);
- if (items.containsKey(cookedName))
- return; // already registered.
- items.put(cookedName, item);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.java
deleted file mode 100644
index c3838487fb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeImpl.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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-/**
- */
-abstract class CMNodeImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
- private java.lang.String name = null;
-
- /**
- * CMNodeImpl constructor comment.
- */
- public CMNodeImpl(String nm) {
- super();
- name = nm;
- }
-
- /**
- * getNodeName method
- * @return java.lang.String
- */
- public String getNodeName() {
- return name;
- }
-
- /**
- * getProperty method
- * @return java.lang.Object
- *
- * Returns the object property desciped by the propertyName
- *
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return new Boolean(false);
- return null;
- }
-
- /**
- * supports method
- * @return boolean
- *
- * Returns true if the CMNode supports a specified property
- *
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return true;
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.java
deleted file mode 100644
index 3e4404a3ee..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CMNodeListImpl.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Analog of dom.NodeList for CM.
- */
-class CMNodeListImpl implements org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList {
-
- private java.util.Vector nodes = null;
-
- /**
- * CMNodeListImpl constructor comment.
- */
- public CMNodeListImpl() {
- super();
- nodes = new java.util.Vector();
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param node org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- protected CMNode appendNode(CMNode node) {
- nodes.addElement(node);
- return 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.elementAt(index);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java
deleted file mode 100644
index a0c2dfdf43..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinition.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * This class is intended to represent a complex type definition
- * in XML Schema.<br>
- */
-abstract class ComplexTypeDefinition {
-
- protected CMGroupImpl content = null;
- protected ElementCollection collection = null;
- protected String primaryCandidateName = null;
-
- /**
- * ComplexTypeDefinition constructor comment.
- */
- public ComplexTypeDefinition(ElementCollection elementCollection) {
- super();
- collection = elementCollection;
- createContent();
- }
-
- /**
- * Create an actual content model.
- * This method should be called once and only once in the constructor.<br>
- */
- protected abstract void createContent();
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMGroup
- */
- public CMGroup getContent() {
- return content;
- }
-
- /**
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- /* NOTE: Do we need LOGICAL type?
- * -- 3/7/2001
- */
- public abstract int getContentType();
-
- /**
- * Get content hint.
- */
- public HTMLElementDeclaration getPrimaryCandidate() {
- if (primaryCandidateName == null)
- return null;
- return (HTMLElementDeclaration) collection.getNamedItem(primaryCandidateName);
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public abstract String getTypeName();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java
deleted file mode 100644
index 5f346bfcee..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ComplexTypeDefinitionFactory.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Factory of ComplexTypeDefinition.
- */
-final class ComplexTypeDefinitionFactory {
-
- private static ComplexTypeDefinitionFactory instance = null;
- private java.util.Hashtable definitions = null;
- // constants for complex type name
- /** for ADDRESS. */
- public final static String CTYPE_ADDRESS = "CTYPE_ADDRESS";//$NON-NLS-1$
- /** CDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_CDATA = "CTYPE_CDATA";//$NON-NLS-1$
- /** col group content. COL* */
- public final static String CTYPE_COLUMN_GROUP = "CTYPE_COLUMN_GROUP";//$NON-NLS-1$
- /** for DL. */
- public final static String CTYPE_DEFINITION_LIST = "CTYPE_DEFINITION_LIST";//$NON-NLS-1$
- /** for EMBED. */
- public final static String CTYPE_EMBED = "CTYPE_EMBED";//$NON-NLS-1$
- /** empty content. No ComplexTypeDefinition instance should be created. */
- public final static String CTYPE_EMPTY = "CTYPE_EMPTY";//$NON-NLS-1$
- /** for FIELDSET. */
- public final static String CTYPE_FIELDSET = "CTYPE_FIELDSET";//$NON-NLS-1$
- /** for FRAMESET. */
- public final static String CTYPE_FRAMESET = "CTYPE_FRAMESET";//$NON-NLS-1$
- /** flow content. (%flow;)* */
- public final static String CTYPE_FLOW_CONTAINER = "CTYPE_FLOW_CONTAINER";//$NON-NLS-1$
- /** html content. HEAD, (FRAMESET|BODY) */
- public final static String CTYPE_HTML = "CTYPE_HTML";//$NON-NLS-1$
- /** head content. TITLE & ISINDEX? & BASE? */
- public final static String CTYPE_HEAD = "CTYPE_HEAD";//$NON-NLS-1$
- /** inline content. (%inline;)* */
- public final static String CTYPE_INLINE_CONTAINER = "CTYPE_INLINE_CONTAINER";//$NON-NLS-1$
- /** list item container. (LI)+ */
- public final static String CTYPE_LI_CONTAINER = "CTYPE_LI_CONTAINER";//$NON-NLS-1$
- /** for MAP. */
- public final static String CTYPE_MAP = "CTYPE_MAP";//$NON-NLS-1$
- /** noframes content. */
- public final static String CTYPE_NOFRAMES_CONTENT = "CTYPE_NOFRAMES_CONTENT";//$NON-NLS-1$
- /** for OPTGROUP. */
- public final static String CTYPE_OPTION_CONTAINER = "CTYPE_OPTION_CONTAINER";//$NON-NLS-1$
- /** param container. For OBJECT/APPLET. */
- public final static String CTYPE_PARAM_CONTAINER = "CTYPE_PARAM_CONTAINER";//$NON-NLS-1$
- /** PCDATA content. No ComplexTypeDefinition instance shuld be created. */
- public final static String CTYPE_PCDATA = "CTYPE_PCDATA";//$NON-NLS-1$
- /** for SELECT. */
- public final static String CTYPE_SELECT = "CTYPE_SELECT";//$NON-NLS-1$
- /** table content. CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+ */
- public final static String CTYPE_TABLE = "CTYPE_TABLE";//$NON-NLS-1$
- /** table cell contaier. (TH|TD)+ */
- public final static String CTYPE_TCELL_CONTAINER = "CTYPE_TCELL_CONTAINER";//$NON-NLS-1$
- /** table record container. (TR)+ */
- public final static String CTYPE_TR_CONTAINER = "CTYPE_TR_CONTAINER";//$NON-NLS-1$
-
- /**
- * ComplexTypeDefinitionFactory constructor comment.
- */
- private ComplexTypeDefinitionFactory() {
- super();
- definitions = new java.util.Hashtable();
- }
-
- /**
- * Factory method for ComplexTypeDefinition.
- * Each instance created in this method must be registered into
- * the map with its name.
- * @param definitionName java.lang.String
- * @param elementCollection ElementCollection
- */
- public ComplexTypeDefinition createTypeDefinition(String definitionName, ElementCollection elementCollection) {
- if (definitions.containsKey(definitionName)) {
- return (ComplexTypeDefinition) definitions.get(definitionName);
- }
-
- ComplexTypeDefinition def = null;
- if (definitionName == CTYPE_ADDRESS) {
- def = new CtdAddress(elementCollection);
-
- }
- else if (definitionName == CTYPE_DEFINITION_LIST) {
- def = new CtdDl(elementCollection);
-
- }
- else if (definitionName == CTYPE_FLOW_CONTAINER) {
- def = new CtdFlowContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_HEAD) {
- def = new CtdHead(elementCollection);
-
- }
- else if (definitionName == CTYPE_HTML) {
- def = new CtdHtml(elementCollection);
-
- }
- else if (definitionName == CTYPE_INLINE_CONTAINER) {
- def = new CtdInlineContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_LI_CONTAINER) {
- def = new CtdLiContainer(elementCollection);
-
-
- }
- else if (definitionName == CTYPE_OPTION_CONTAINER) {
- def = new CtdOptionContainer(elementCollection);
-
- }
- else if (definitionName == CTYPE_SELECT) {
- def = new CtdSelect(elementCollection);
-
- }
- else {
- def = null;
- }
- if (def == null)
- return null; // fail to create.
- definitions.put(definitionName, def);
- return def;
- }
-
- /**
- * For singleton.<br>
- */
- public synchronized static ComplexTypeDefinitionFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new ComplexTypeDefinitionFactory();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.java
deleted file mode 100644
index 84796f4af4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdAddress.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for ADDRESS.
- */
-final class CtdAddress extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdAddress(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * ((%inline) | P)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )*
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- // (%inline)
- CMGroupImpl inlines = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (inlines == null)
- return;
- collection.getInline(inlines);
- content.appendChild(inlines);
- // P
- CMNode p = collection.getNamedItem(CHTMLNamespace.ElementName.P);
- if (p != null)
- content.appendChild(p);
- }
-
- /**
- * ((%inline) | P)*.
- * Because %inline; contains #PCDATA, the type is MIXED.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java
deleted file mode 100644
index dcfb159a3d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdDl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for DL.
- */
-final class CtdDl extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdDl(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.DT;
- }
-
- /**
- * (DT | DD)+
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // DT
- CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.DT);
- if (dec != null)
- content.appendChild(dec);
- // DD
- dec = collection.getNamedItem(CHTMLNamespace.ElementName.DD);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (DT | DD)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.java
deleted file mode 100644
index ee94d6224a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdFlowContainer.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for containers of <code>%flow;</code>.
- */
-final class CtdFlowContainer extends ComplexTypeDefinition {
-
- /**
- */
- public CtdFlowContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%flow;)*
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getFlow(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.java
deleted file mode 100644
index 5361c3a7ce..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHead.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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for the head content.
- * Content Model: (TITLE & ISINDEX? & BASE?)
- */
-final class CtdHead extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHead(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.TITLE;
- }
-
- /**
- * for HEAD.
- * To avoid using inclusion, the content model comes from the XHTML 1.0.
- *
- * (%head.misc;, ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc;, (title, %head.misc;))))
- * And %head.misc; is:
- * (script|style|meta|link|object|isindex)*
- *
- * 0: (%head.misc, A)
- * A: (B | C)
- * B: (title, %head.misc;, D)
- * C: (base, %head.misc;, E)
- * D: (base, %head.misc;)?
- * E: (title, %head.misc;)
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // At 1st, create %head.misc; content.
- // %head.misc;
- // ( | )*
- CMGroupImpl misc = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- if (misc == null)
- return;
- String[] names = {CHTMLNamespace.ElementName.META,};
- collection.getDeclarations(misc, Arrays.asList(names).iterator());
- // 2nd, get a title
- CMNode title = collection.getNamedItem(CHTMLNamespace.ElementName.TITLE);
- // 3rd, get a base
- CMNode base = collection.getNamedItem(CHTMLNamespace.ElementName.BASE);
- if (title == null || base == null)
- return;
-
- // Top level content is a sequence of %head.misc; and A.
- // 0: (%head.misc;, A)
- // create a sequence
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
- // append %head.misc;
- content.appendChild(misc);
- // create A and append it to the top level.
- {
- // A is a choice of B and C.
- // A: (B | C)
- // create a choice
- CMGroupImpl gA = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- if (gA == null)
- return;
- // append A to the top level.
- content.appendChild(gA);
-
- // create B and append it to A
- {
- // B is a sequence of title, %head.misc;, and D.
- // B: (title, %head.misc;, D)
- // create a sequence
- CMGroupImpl gB = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gB == null)
- return;
- // append B to A.
- gA.appendChild(gB);
-
- // append title to B
- gB.appendChild(title);
- // append %head.misc; to B
- gB.appendChild(misc);
- // create D and append it to B.
- {
- // D is a sequence of base, %head.misc;.
- // D: (base, %head.misc;)?
- // create a sequence
- CMGroupImpl gD = new CMGroupImpl(CMGroup.SEQUENCE, 0, 1);
- if (gD == null)
- return;
- // append D to B.
- gB.appendChild(gD);
-
- // append base to D
- gD.appendChild(base);
- // append %head.misc; to D.
- gD.appendChild(misc);
- }
- }
- // create C and append it to A
- {
- // C is a sequence of base, %head.misc;, and E
- // C: (base, %head.misc;, E)
- // create a sequence
- CMGroupImpl gC = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gC == null)
- return;
- // append C to A.
- gA.appendChild(gC);
-
- // append base to C
- gC.appendChild(base);
- // append %head.misc; to C
- gC.appendChild(misc);
-
- // create E and append it to C.
- {
- // E is a sequence of title and %head.misc;.
- // E: (title, %head.misc;)
- // create a sequence
- CMGroupImpl gE = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (gE == null)
- return;
- // append E to C.
- gC.appendChild(gE);
-
- // append title to E
- gE.appendChild(title);
- // append %head.misc; to E.
- gE.appendChild(misc);
- }
- }
- }
- }
-
- /**
- * Element content.<br>
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HEAD;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java
deleted file mode 100644
index 72bab174b3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdHtml.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Complex type definition for <code>HTML</code>.<br>
- * Content Model:
- * HEAD, (FRAMESET|BODY)<br>
- */
-final class CtdHtml extends ComplexTypeDefinition {
-
- /**
- */
- public CtdHtml(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.HEAD;
- }
-
- /**
- * (%html.content;).
- * %html.content; is HEAD, (FRAMESET | BODY).
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
- if (content == null)
- return;
-
- // HEAD
- CMNode edec = collection.getNamedItem(CHTMLNamespace.ElementName.HEAD);
- if (edec != null)
- content.appendChild(edec);
-
- // ( | )
- CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- content.appendChild(group);
-
- // FRAMESET, BODY
- String[] names = {CHTMLNamespace.ElementName.BODY};
- collection.getDeclarations(group, Arrays.asList(names).iterator());
- }
-
- /**
- * Element content.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_HTML;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.java
deleted file mode 100644
index 973944a1e6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdInlineContainer.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * Complex type definition for (%inline;)*.
- */
-final class CtdInlineContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdInlineContainer(ElementCollection elementCollection) {
- super(elementCollection);
- }
-
- /**
- * (%inline)*.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
- collection.getInline(content);
- }
-
- public int getContentType() {
- return CMElementDeclaration.MIXED;
- }
-
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java
deleted file mode 100644
index 8e4716a019..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdLiContainer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * List item container.
- * (LI)+
- */
-final class CtdLiContainer extends ComplexTypeDefinition {
-
- /**
- * @param elemenCollection ElementCollection
- */
- public CtdLiContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.LI;
- }
-
- /**
- * (LI)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // (LI)+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- CMNode li = collection.getNamedItem(CHTMLNamespace.ElementName.LI);
- if (li != null)
- content.appendChild(li);
- }
-
- /**
- * ELEMENT content.<br>
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java
deleted file mode 100644
index b1e0a5496c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdOptionContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * OPTION container.
- * (OPTION)+
- */
-final class CtdOptionContainer extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdOptionContainer(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.OPTION;
- }
-
- /**
- * (OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( )+
- content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTION)+
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * Name of complex type definition.
- * Each singleton must know its own name.
- * All names should be defined in
- * {@link <code>ComplexTypeDefinitionFactory</code>} as constants.<br>
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_OPTION_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.java
deleted file mode 100644
index cc0d61ed69..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/CtdSelect.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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * for SELECT.
- */
-final class CtdSelect extends ComplexTypeDefinition {
-
- /**
- * @param elementCollection ElementCollection
- */
- public CtdSelect(ElementCollection elementCollection) {
- super(elementCollection);
- primaryCandidateName = CHTMLNamespace.ElementName.OPTION;
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- */
- protected void createContent() {
- if (content != null)
- return; // already created.
- if (collection == null)
- return;
-
- // ( | )+
- content = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
- // OPTION
- CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.OPTION);
- if (dec != null)
- content.appendChild(dec);
- }
-
- /**
- * (OPTGROUP | OPTION)+.
- * @return int; Should be one of ANY, EMPTY, ELEMENT, MIXED, PCDATA, CDATA,
- * those are defined in CMElementDeclaration.
- */
- public int getContentType() {
- return CMElementDeclaration.ELEMENT;
- }
-
- /**
- * @return java.lang.String
- */
- public String getTypeName() {
- return ComplexTypeDefinitionFactory.CTYPE_SELECT;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.java
deleted file mode 100644
index 22558cfb87..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/DeclCollection.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class DeclCollection implements CMNamedNodeMap {
-
-
- protected class DualMap {
- public DualMap() {
- super();
- }
-
- public DualMap(Object[] objects) {
- super();
- initialize(objects);
- }
-
- public int size() {
- return table.length;
- }
-
- public Object getValue(int key) {
- if (!isValidIndex(key))
- return null;
- return table[key];
- }
-
- public int getKey(Object value) {
- Integer keyObj = (Integer) map.get(value);
- if (keyObj == null)
- return ID_UNKNOWN;
- return keyObj.intValue();
- }
-
- protected void initialize(Object[] objects) {
- if (objects == null)
- return;
- table = objects;
- map = new HashMap();
- for (int key = 0; key < objects.length; key++) {
- Object value = table[key];
- map.put(value, new Integer(key));
- }
- }
-
- private Object[] table = null;
- private HashMap map = null;
-
- private boolean isValidIndex(int index) {
- return index >= 0 && index < table.length;
- }
- }
-
- protected class TolerantStringDualMap extends DualMap {
- public TolerantStringDualMap(String[] names) {
- super();
- Object[] objects = new Object[names.length];
- for (int i = 0; i < names.length; i++) {
- objects[i] = makeCanonicalForm(names[i]);
- }
- initialize(objects);
- }
-
- public int getKey(Object value) {
- try {
- String name = (String) value;
- return super.getKey(makeCanonicalForm(name));
- }
- catch (ClassCastException e) {
- return ID_UNKNOWN;
- }
- }
-
- private String makeCanonicalForm(String raw) {
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=100152
- // we are able to "cheat" here a little and use US Locale
- // to get a good cononical form, since we are using this only
- // for HTML and JSP standard tags.
- // Long term, for similar needs with XML 1.1 (for example)
- // we should use a class such as com.ibm.icu.text.Normalizer
- return raw.toUpperCase(Locale.US);
- }
- }
-
- private class DeclIterator implements Iterator {
- public DeclIterator() {
- maxid = fDecls.length - 1;
- }
-
- public boolean hasNext() {
- return id < maxid;
- }
-
- public Object next() {
- if (!hasNext())
- return null;
- return item(++id);
- }
-
- public void remove() { /* nothing should be done. */
- }
-
- private int id = -1;
- private int maxid = -1;
- }
-
- CMNode[] fDecls = null;
- protected final static boolean STRICT_CASE = false;
- protected final static boolean TOLERANT_CASE = true;
- protected final static int ID_UNKNOWN = -1;
- private DualMap fMap = null;
-
- /**
- */
- public DeclCollection(String[] names, boolean tolerant) {
- super();
- fDecls = new CMNode[names.length];
- if (tolerant) {
- fMap = new TolerantStringDualMap(names);
- }
- else {
- fMap = new DualMap(names);
- }
- }
-
- /**
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param id
- * int
- */
- protected abstract CMNode create(String name);
-
- /**
- */
- public CMNamedNodeMap getDeclarations(String[] names) {
- CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- CMNode node = getNamedItem(name);
- if (node == null)
- continue;
- map.putNamedItem(name, node);
- }
- return map;
- }
-
- public void getDeclarations(CMGroupImpl group, Iterator names) {
- while (names.hasNext()) {
- String entityName = (String) names.next();
- CMNode dec = getNamedItem(entityName);
- if (dec != null)
- group.appendChild(dec);
- }
- }
-
- /**
- * Map name to id.
- *
- * @return int
- * @param name
- * java.lang.String
- */
- protected int getID(String name) {
- return fMap.getKey(name);
- }
-
- /**
- * getLength method
- *
- * @return int
- */
- public int getLength() {
- return fDecls.length;
- }
-
- /**
- * @return java.lang.String
- * @param id
- * int
- */
- protected String getName(int id) {
- return (String) fMap.getValue(id);
- }
-
- /**
- * getNamedItem method
- *
- * @return CMNode
- * @param name
- * java.lang.String
- */
- public CMNode getNamedItem(String name) {
- int id = getID(name);
- if (!isValidID(id))
- return null;
- return item(id);
- }
-
- /**
- * @return boolean
- * @param id
- * int
- */
- private boolean isValidID(int id) {
- return id >= 0 && id < fDecls.length;
- }
-
- /**
- * item method
- *
- * @return CMNode
- * @param index
- * int
- */
- public CMNode item(int index) {
- if (!isValidID(index))
- return null;
- CMNode decl = fDecls[index];
- if (decl != null)
- return decl; // already exist.
-
- decl = create(getName(index));
- fDecls[index] = decl;
- return decl;
- }
-
- /**
- */
- public Iterator iterator() {
- return new DeclIterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java
deleted file mode 100644
index bf5ad468ea..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/ElementCollection.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for element declarations.
- */
-final class ElementCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ElementName {
-
-
- // Element IDs
- private static class Ids {
- public static final int ID_A = 0;
- public static final int ID_ADDRESS = 1;
- public static final int ID_BASE = 2;
- public static final int ID_BLOCKQUOTE = 3;
- public static final int ID_BODY = 4;
- public static final int ID_BR = 5;
- public static final int ID_CENTER = 6;
- public static final int ID_DD = 7;
- public static final int ID_DIR = 8;
- public static final int ID_DIV = 9;
- public static final int ID_DL = 10;
- public static final int ID_DT = 11;
- public static final int ID_FORM = 12;
- public static final int ID_H1 = 13;
- public static final int ID_H2 = 14;
- public static final int ID_H3 = 15;
- public static final int ID_H4 = 16;
- public static final int ID_H5 = 17;
- public static final int ID_H6 = 18;
- public static final int ID_HEAD = 19;
- public static final int ID_HR = 20;
- public static final int ID_HTML = 21;
- public static final int ID_IMG = 22;
- public static final int ID_INPUT = 23;
- public static final int ID_LI = 24;
- public static final int ID_MENU = 25;
- public static final int ID_META = 26;
- public static final int ID_OL = 27;
- public static final int ID_OPTION = 28;
- public static final int ID_P = 29;
- public static final int ID_PRE = 30;
- public static final int ID_SELECT = 31;
- public static final int ID_TEXTAREA = 32;
- public static final int ID_TITLE = 33;
- public static final int ID_UL = 34;
- public static final int ID_SSI_CONFIG = 35;
- public static final int ID_SSI_ECHO = 36;
- public static final int ID_SSI_EXEC = 37;
- public static final int ID_SSI_FSIZE = 38;
- public static final int ID_SSI_FLASTMOD = 39;
- public static final int ID_SSI_INCLUDE = 40;
- public static final int ID_SSI_PRINTENV = 41;
- public static final int ID_SSI_SET = 42;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 105.
- // -- 5/25/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- /** %formctl;. INPUT | SELECT | TEXTAREA */
- private static final String[] FORMCTL = {INPUT, SELECT, TEXTAREA};
- /** %phrase;.
- * DFN
- */
- private static final String[] PHRASE = {DFN};
- /** %special;.
- * A | IMG | BR
- */
- private static final String[] SPECIAL = {A, IMG, BR};
- /** %heading;. H[1-6] */
- private static final String[] HEADING = {H1, H2, H3, H4, H5, H6};
- /** %list;. UL | OL | DIR | MENU */
- private static final String[] LIST = {UL, OL, DIR, MENU};
- /** %preformatted;. PRE */
- private static final String[] PREFORMATTED = {PRE};
- private AttributeCollection attributeCollection = null;
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_A] = A;
- names[Ids.ID_ADDRESS] = ADDRESS;
- names[Ids.ID_BASE] = BASE;
- names[Ids.ID_BLOCKQUOTE] = BLOCKQUOTE;
- names[Ids.ID_BODY] = BODY;
- names[Ids.ID_BR] = BR;
- names[Ids.ID_CENTER] = CENTER;
- names[Ids.ID_DD] = DD;
- names[Ids.ID_DIR] = DIR;
- names[Ids.ID_DIV] = DIV;
- names[Ids.ID_DL] = DL;
- names[Ids.ID_DT] = DT;
- names[Ids.ID_FORM] = FORM;
- names[Ids.ID_H1] = H1;
- names[Ids.ID_H2] = H2;
- names[Ids.ID_H3] = H3;
- names[Ids.ID_H4] = H4;
- names[Ids.ID_H5] = H5;
- names[Ids.ID_H6] = H6;
- names[Ids.ID_HEAD] = HEAD;
- names[Ids.ID_HR] = HR;
- names[Ids.ID_HTML] = HTML;
- names[Ids.ID_IMG] = IMG;
- names[Ids.ID_INPUT] = INPUT;
- names[Ids.ID_LI] = LI;
- names[Ids.ID_MENU] = MENU;
- names[Ids.ID_META] = META;
- names[Ids.ID_OL] = OL;
- names[Ids.ID_OPTION] = OPTION;
- names[Ids.ID_P] = P;
- names[Ids.ID_PRE] = PRE;
- names[Ids.ID_SELECT] = SELECT;
- names[Ids.ID_TEXTAREA] = TEXTAREA;
- names[Ids.ID_TITLE] = TITLE;
- names[Ids.ID_UL] = UL;
- names[Ids.ID_SSI_CONFIG] = SSI_CONFIG;
- names[Ids.ID_SSI_ECHO] = SSI_ECHO;
- names[Ids.ID_SSI_EXEC] = SSI_EXEC;
- names[Ids.ID_SSI_FSIZE] = SSI_FSIZE;
- names[Ids.ID_SSI_FLASTMOD] = SSI_FLASTMOD;
- names[Ids.ID_SSI_INCLUDE] = SSI_INCLUDE;
- names[Ids.ID_SSI_PRINTENV] = SSI_PRINTENV;
- names[Ids.ID_SSI_SET] = SSI_SET;
- }
-
- /**
- */
- public ElementCollection(AttributeCollection collection) {
- super(names, TOLERANT_CASE);
- attributeCollection = collection;
- }
-
- /**
- * Actually creates HTMLElementDeclaration instance.
- * @return HTMLElementDeclaration
- */
- protected CMNode create(String elementName) {
- HTMLElemDeclImpl edec = null;
-
- if (elementName.equalsIgnoreCase(A)) {
- edec = new HedA(this);
-
- }
- else if (elementName.equalsIgnoreCase(ADDRESS)) {
- edec = new HedADDRESS(this);
-
- }
- else if (elementName.equalsIgnoreCase(BASE)) {
- edec = new HedBASE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BLOCKQUOTE)) {
- edec = new HedBLOCKQUOTE(this);
-
- }
- else if (elementName.equalsIgnoreCase(BODY)) {
- edec = new HedBODY(this);
-
- }
- else if (elementName.equalsIgnoreCase(BR)) {
- edec = new HedBR(this);
-
- }
- else if (elementName.equalsIgnoreCase(CENTER)) {
- edec = new HedCENTER(this);
-
- }
- else if (elementName.equalsIgnoreCase(DD)) {
- edec = new HedDD(this);
-
- }
- else if (elementName.equalsIgnoreCase(DIR)) {
- edec = new HedMENU(DIR, this);
-
- }
- else if (elementName.equalsIgnoreCase(DIV)) {
- edec = new HedDIV(this);
-
- }
- else if (elementName.equalsIgnoreCase(DL)) {
- edec = new HedDL(this);
-
- }
- else if (elementName.equalsIgnoreCase(DT)) {
- edec = new HedDT(this);
-
- }
- else if (elementName.equalsIgnoreCase(FORM)) {
- edec = new HedFORM(this);
-
- }
- else if (elementName.equalsIgnoreCase(H1)) {
- edec = new HedHeading(H1, this);
-
- }
- else if (elementName.equalsIgnoreCase(H2)) {
- edec = new HedHeading(H2, this);
-
- }
- else if (elementName.equalsIgnoreCase(H3)) {
- edec = new HedHeading(H3, this);
-
- }
- else if (elementName.equalsIgnoreCase(H4)) {
- edec = new HedHeading(H4, this);
-
- }
- else if (elementName.equalsIgnoreCase(H5)) {
- edec = new HedHeading(H5, this);
-
- }
- else if (elementName.equalsIgnoreCase(H6)) {
- edec = new HedHeading(H6, this);
-
- }
- else if (elementName.equalsIgnoreCase(HEAD)) {
- edec = new HedHEAD(this);
-
- }
- else if (elementName.equalsIgnoreCase(HR)) {
- edec = new HedHR(this);
-
- }
- else if (elementName.equalsIgnoreCase(HTML)) {
- edec = new HedHTML(this);
-
- }
- else if (elementName.equalsIgnoreCase(IMG)) {
- edec = new HedIMG(this);
-
- }
- else if (elementName.equalsIgnoreCase(INPUT)) {
- edec = new HedINPUT(this);
-
- }
- else if (elementName.equalsIgnoreCase(LI)) {
- edec = new HedLI(this);
-
- }
- else if (elementName.equalsIgnoreCase(MENU)) {
- edec = new HedMENU(MENU, this);
-
- }
- else if (elementName.equalsIgnoreCase(META)) {
- edec = new HedMETA(this);
-
- }
- else if (elementName.equalsIgnoreCase(OL)) {
- edec = new HedOL(this);
-
- }
- else if (elementName.equalsIgnoreCase(OPTION)) {
- edec = new HedOPTION(this);
-
- }
- else if (elementName.equalsIgnoreCase(P)) {
- edec = new HedP(this);
-
- }
- else if (elementName.equalsIgnoreCase(PRE)) {
- edec = new HedPRE(this);
-
- }
- else if (elementName.equalsIgnoreCase(SELECT)) {
- edec = new HedSELECT(this);
-
- }
- else if (elementName.equalsIgnoreCase(TEXTAREA)) {
- edec = new HedTEXTAREA(this);
-
- }
- else if (elementName.equalsIgnoreCase(TITLE)) {
- edec = new HedTITLE(this);
-
- }
- else if (elementName.equalsIgnoreCase(UL)) {
- edec = new HedUL(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_CONFIG)) {
- edec = new HedSSIConfig(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_ECHO)) {
- edec = new HedSSIEcho(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_EXEC)) {
- edec = new HedSSIExec(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FSIZE)) {
- edec = new HedSSIFsize(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_FLASTMOD)) {
- edec = new HedSSIFlastmod(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_INCLUDE)) {
- edec = new HedSSIInclude(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_PRINTENV)) {
- edec = new HedSSIPrintenv(this);
-
- }
- else if (elementName.equalsIgnoreCase(SSI_SET)) {
- edec = new HedSSISet(this);
-
- } // unknown
- else {
- // NOTE: We don't define the UNKNOWN element declaration.
- // <code>null</code> for a declaration is a sign of
- // the target element is unknown.
- // -- 3/9/2001
- edec = null;
- }
- return edec;
- }
-
- public AttributeCollection getAttributeCollection() {
- return attributeCollection;
- }
-
- /**
- */
- public final Collection getNamesOfBlock() {
- // P | %list | %preformatted | DL | DIV | CENTER | BLOCKQUOTE | FORM | HR
- String[] blockMisc = {P, DL, DIV, CENTER, BLOCKQUOTE, FORM, HR,};
- Vector blockNames = new Vector(Arrays.asList(blockMisc));
- // %heading;
- blockNames.addAll(Arrays.asList(HEADING));
- // %list;
- blockNames.addAll(Arrays.asList(LIST));
- // %preformatted;
- blockNames.addAll(Arrays.asList(PREFORMATTED));
-
- return blockNames;
- }
-
- /**
- * %block;.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getBlock(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, getNamesOfBlock().iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public final void getFlow(CMGroupImpl group) {
- if (group == null)
- return;
- getBlock(group);
- getInline(group);
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFontstyle(CMGroupImpl group) {
- return;
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getFormctrl(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(FORMCTL).iterator());
- }
-
- /**
- * %heading;.
- * @param group CMGroupImpl Return values.
- */
- public final void getHeading(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(HEADING).iterator());
- }
-
- /**
- * Create element declarations and store them
- * into a <code>CMGroupImpl</code> instance.
- * @param group CMGroupImpl Return values.
- */
- public final void getInline(CMGroupImpl group) {
- if (group == null)
- return;
- getFontstyle(group);
- getPhrase(group);
- getSpecial(group);
- getFormctrl(group);
- }
-
- /**
- * %list;.
- * @param group CMGroupImpl Return values.
- */
- public final void getList(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(LIST).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getPhrase(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(PHRASE).iterator());
- }
-
- /**
- * %preformatted;
- * @param group CMGroupImpl Return values.
- */
- public final void getPreformatted(CMGroupImpl group) {
- if (group == null)
- return;
-
- getDeclarations(group, Arrays.asList(PREFORMATTED).iterator());
- }
-
- /**
- * Create element declarations and store them into a <code>CMGroupImpl</code>
- * instance.<br>
- * @param group CMGroupImpl Return values.
- */
- public final void getSpecial(CMGroupImpl group) {
- if (group == null)
- return;
- getDeclarations(group, Arrays.asList(SPECIAL).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java
deleted file mode 100644
index 7b44593534..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/EntityCollection.java
+++ /dev/null
@@ -1,837 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.lang.reflect.Field;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Factory for entity declarations.
- */
-final class EntityCollection extends DeclCollection implements org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.EntityName {
-
-
- private static class Ids {
- public static final int ID_AACUTE_L = 0;
- public static final int ID_AACUTE_U = 1;
- public static final int ID_ACIRC_L = 2;
- public static final int ID_ACIRC_U = 3;
- public static final int ID_ACUTE = 4;
- public static final int ID_AELIG_L = 5;
- public static final int ID_AELIG_U = 6;
- public static final int ID_AGRAVE_L = 7;
- public static final int ID_AGRAVE_U = 8;
- public static final int ID_ALEFSYM = 9;
- public static final int ID_ALPHA_L = 10;
- public static final int ID_ALPHA_U = 11;
- public static final int ID_AMP = 12;
- public static final int ID_AND = 13;
- public static final int ID_ANG = 14;
- public static final int ID_ARING_L = 15;
- public static final int ID_ARING_U = 16;
- public static final int ID_ASYMP = 17;
- public static final int ID_ATILDE_L = 18;
- public static final int ID_ATILDE_U = 19;
- public static final int ID_AUML_L = 20;
- public static final int ID_AUML_U = 21;
- public static final int ID_BDQUO = 22;
- public static final int ID_BETA_L = 23;
- public static final int ID_BETA_U = 24;
- public static final int ID_BRVBAR = 25;
- public static final int ID_BULL = 26;
- public static final int ID_CAP = 27;
- public static final int ID_CCEDIL_L = 28;
- public static final int ID_CCEDIL_U = 29;
- public static final int ID_CEDIL = 30;
- public static final int ID_CENT = 31;
- public static final int ID_CHI_L = 32;
- public static final int ID_CHI_U = 33;
- public static final int ID_CIRC = 34;
- public static final int ID_CLUBS = 35;
- public static final int ID_CONG = 36;
- public static final int ID_COPY = 37;
- public static final int ID_CRARR = 38;
- public static final int ID_CUP = 39;
- public static final int ID_CURREN = 40;
- public static final int ID_DAGGER_L = 41;
- public static final int ID_DAGGER_U = 42;
- public static final int ID_DARR_L = 43;
- public static final int ID_DARR_U = 44;
- public static final int ID_DEG = 45;
- public static final int ID_DELTA_L = 46;
- public static final int ID_DELTA_U = 47;
- public static final int ID_DIAMS = 48;
- public static final int ID_DIVIDE = 49;
- public static final int ID_EACUTE_L = 50;
- public static final int ID_EACUTE_U = 51;
- public static final int ID_ECIRC_L = 52;
- public static final int ID_ECIRC_U = 53;
- public static final int ID_EGRAVE_L = 54;
- public static final int ID_EGRAVE_U = 55;
- public static final int ID_EMPTY = 56;
- public static final int ID_EMSP = 57;
- public static final int ID_ENSP = 58;
- public static final int ID_EPSILON_L = 59;
- public static final int ID_EPSILON_U = 60;
- public static final int ID_EQUIV = 61;
- public static final int ID_ETA_L = 62;
- public static final int ID_ETA_U = 63;
- public static final int ID_ETH_L = 64;
- public static final int ID_ETH_U = 65;
- public static final int ID_EUML_L = 66;
- public static final int ID_EUML_U = 67;
- public static final int ID_EURO = 68;
- public static final int ID_EXIST = 69;
- public static final int ID_FNOF = 70;
- public static final int ID_FORALL = 71;
- public static final int ID_FRAC12 = 72;
- public static final int ID_FRAC14 = 73;
- public static final int ID_FRAC34 = 74;
- public static final int ID_FRASL = 75;
- public static final int ID_GAMMA_L = 76;
- public static final int ID_GAMMA_U = 77;
- public static final int ID_GE = 78;
- public static final int ID_GT = 79;
- public static final int ID_HARR_L = 80;
- public static final int ID_HARR_U = 81;
- public static final int ID_HEARTS = 82;
- public static final int ID_HELLIP = 83;
- public static final int ID_IACUTE_L = 84;
- public static final int ID_IACUTE_U = 85;
- public static final int ID_ICIRC_L = 86;
- public static final int ID_ICIRC_U = 87;
- public static final int ID_IEXCL = 88;
- public static final int ID_IGRAVE_L = 89;
- public static final int ID_IGRAVE_U = 90;
- public static final int ID_IMAGE = 91;
- public static final int ID_INFIN = 92;
- public static final int ID_INT = 93;
- public static final int ID_IOTA_L = 94;
- public static final int ID_IOTA_U = 95;
- public static final int ID_IQUEST = 96;
- public static final int ID_ISIN = 97;
- public static final int ID_IUML_L = 98;
- public static final int ID_IUML_U = 99;
- public static final int ID_KAPPA_L = 100;
- public static final int ID_KAPPA_U = 101;
- public static final int ID_LAMBDA_L = 102;
- public static final int ID_LAMBDA_U = 103;
- public static final int ID_LANG = 104;
- public static final int ID_LAQUO = 105;
- public static final int ID_LARR_L = 106;
- public static final int ID_LARR_U = 107;
- public static final int ID_LCEIL = 108;
- public static final int ID_LDQUO = 109;
- public static final int ID_LE = 110;
- public static final int ID_LFLOOR = 111;
- public static final int ID_LOWAST = 112;
- public static final int ID_LOZ = 113;
- public static final int ID_LRM = 114;
- public static final int ID_LSAQUO = 115;
- public static final int ID_LSQUO = 116;
- public static final int ID_LT = 117;
- public static final int ID_MACR = 118;
- public static final int ID_MDASH = 119;
- public static final int ID_MICRO = 120;
- public static final int ID_MIDDOT = 121;
- public static final int ID_MINUS = 122;
- public static final int ID_MU_L = 123;
- public static final int ID_MU_U = 124;
- public static final int ID_NABLA = 125;
- public static final int ID_NBSP = 126;
- public static final int ID_NDASH = 127;
- public static final int ID_NE = 128;
- public static final int ID_NI = 129;
- public static final int ID_NOT = 130;
- public static final int ID_NOTIN = 131;
- public static final int ID_NSUB = 132;
- public static final int ID_NTILDE_L = 133;
- public static final int ID_NTILDE_U = 134;
- public static final int ID_NU_L = 135;
- public static final int ID_NU_U = 136;
- public static final int ID_OACUTE_L = 137;
- public static final int ID_OACUTE_U = 138;
- public static final int ID_OCIRC_L = 139;
- public static final int ID_OCIRC_U = 140;
- public static final int ID_OELIG_L = 141;
- public static final int ID_OELIG_U = 142;
- public static final int ID_OGRAVE_L = 143;
- public static final int ID_OGRAVE_U = 144;
- public static final int ID_OLINE = 145;
- public static final int ID_OMEGA_L = 146;
- public static final int ID_OMEGA_U = 147;
- public static final int ID_OMICRON_L = 148;
- public static final int ID_OMICRON_U = 149;
- public static final int ID_OPLUS = 150;
- public static final int ID_OR = 151;
- public static final int ID_ORDF = 152;
- public static final int ID_ORDM = 153;
- public static final int ID_OSLASH_L = 154;
- public static final int ID_OSLASH_U = 155;
- public static final int ID_OTILDE_L = 156;
- public static final int ID_OTILDE_U = 157;
- public static final int ID_OTIMES = 158;
- public static final int ID_OUML_L = 159;
- public static final int ID_OUML_U = 160;
- public static final int ID_PARA = 161;
- public static final int ID_PART = 162;
- public static final int ID_PERMIL = 163;
- public static final int ID_PERP = 164;
- public static final int ID_PHI_L = 165;
- public static final int ID_PHI_U = 166;
- public static final int ID_PIV = 167;
- public static final int ID_PI_L = 168;
- public static final int ID_PI_U = 169;
- public static final int ID_PLUSMN = 170;
- public static final int ID_POUND = 171;
- public static final int ID_PRIME_L = 172;
- public static final int ID_PRIME_U = 173;
- public static final int ID_PROD = 174;
- public static final int ID_PROP = 175;
- public static final int ID_PSI_L = 176;
- public static final int ID_PSI_U = 177;
- public static final int ID_QUOT = 178;
- public static final int ID_RADIC = 179;
- public static final int ID_RANG = 180;
- public static final int ID_RAQUO = 181;
- public static final int ID_RARR_L = 182;
- public static final int ID_RARR_U = 183;
- public static final int ID_RCEIL = 184;
- public static final int ID_RDQUO = 185;
- public static final int ID_REAL = 186;
- public static final int ID_REG = 187;
- public static final int ID_RFLOOR = 188;
- public static final int ID_RHO_L = 189;
- public static final int ID_RHO_U = 190;
- public static final int ID_RLM = 191;
- public static final int ID_RSAQUO = 192;
- public static final int ID_RSQUO = 193;
- public static final int ID_SBQUO = 194;
- public static final int ID_SCARON_L = 195;
- public static final int ID_SCARON_U = 196;
- public static final int ID_SDOT = 197;
- public static final int ID_SECT = 198;
- public static final int ID_SHY = 199;
- public static final int ID_SIGMAF = 200;
- public static final int ID_SIGMA_L = 201;
- public static final int ID_SIGMA_U = 202;
- public static final int ID_SIM = 203;
- public static final int ID_SPADES = 204;
- public static final int ID_SUB = 205;
- public static final int ID_SUBE = 206;
- public static final int ID_SUM = 207;
- public static final int ID_SUP = 208;
- public static final int ID_SUP1 = 209;
- public static final int ID_SUP2 = 210;
- public static final int ID_SUP3 = 211;
- public static final int ID_SUPE = 212;
- public static final int ID_SZLIG = 213;
- public static final int ID_TAU_L = 214;
- public static final int ID_TAU_U = 215;
- public static final int ID_THERE4 = 216;
- public static final int ID_THETASYM = 217;
- public static final int ID_THETA_L = 218;
- public static final int ID_THETA_U = 219;
- public static final int ID_THINSP = 220;
- public static final int ID_THORN_L = 221;
- public static final int ID_THORN_U = 222;
- public static final int ID_TILDE = 223;
- public static final int ID_TIMES = 224;
- public static final int ID_TRADE = 225;
- public static final int ID_UACUTE_L = 226;
- public static final int ID_UACUTE_U = 227;
- public static final int ID_UARR_L = 228;
- public static final int ID_UARR_U = 229;
- public static final int ID_UCIRC_L = 230;
- public static final int ID_UCIRC_U = 231;
- public static final int ID_UGRAVE_L = 232;
- public static final int ID_UGRAVE_U = 233;
- public static final int ID_UML = 234;
- public static final int ID_UPSIH = 235;
- public static final int ID_UPSILON_L = 236;
- public static final int ID_UPSILON_U = 237;
- public static final int ID_UUML_L = 238;
- public static final int ID_UUML_U = 239;
- public static final int ID_WEIERP = 240;
- public static final int ID_XI_L = 241;
- public static final int ID_XI_U = 242;
- public static final int ID_YACUTE_L = 243;
- public static final int ID_YACUTE_U = 244;
- public static final int ID_YEN = 245;
- public static final int ID_YUML_L = 246;
- public static final int ID_YUML_U = 247;
- public static final int ID_ZETA_L = 248;
- public static final int ID_ZETA_U = 249;
- public static final int ID_ZWJ = 250;
- public static final int ID_ZWNJ = 251;
-
- public static int getNumOfIds() {
- if (numofids != -1)
- return numofids;
-
- // NOTE: If the reflection is too slow, this method should
- // just return the literal value, like 252.
- // -- 5/24/2001
- Class clazz = Ids.class;
- Field[] fields = clazz.getFields();
- numofids = 0;
- for (int i = 0; i < fields.length; i++) {
- String name = fields[i].getName();
- if (name.startsWith("ID_"))//$NON-NLS-1$
- numofids++;
- }
- return numofids;
- }
-
- // chache the result of the reflection.
- private static int numofids = -1;
- }
-
- private static String[] names = null;
-
- static {
- names = new String[Ids.getNumOfIds()];
- names[Ids.ID_AACUTE_L] = AACUTE_L;
- names[Ids.ID_AACUTE_U] = AACUTE_U;
- names[Ids.ID_ACIRC_L] = ACIRC_L;
- names[Ids.ID_ACIRC_U] = ACIRC_U;
- names[Ids.ID_ACUTE] = ACUTE;
- names[Ids.ID_AELIG_L] = AELIG_L;
- names[Ids.ID_AELIG_U] = AELIG_U;
- names[Ids.ID_AGRAVE_L] = AGRAVE_L;
- names[Ids.ID_AGRAVE_U] = AGRAVE_U;
- names[Ids.ID_ALEFSYM] = ALEFSYM;
- names[Ids.ID_ALPHA_L] = ALPHA_L;
- names[Ids.ID_ALPHA_U] = ALPHA_U;
- names[Ids.ID_AMP] = AMP;
- names[Ids.ID_AND] = AND;
- names[Ids.ID_ANG] = ANG;
- names[Ids.ID_ARING_L] = ARING_L;
- names[Ids.ID_ARING_U] = ARING_U;
- names[Ids.ID_ASYMP] = ASYMP;
- names[Ids.ID_ATILDE_L] = ATILDE_L;
- names[Ids.ID_ATILDE_U] = ATILDE_U;
- names[Ids.ID_AUML_L] = AUML_L;
- names[Ids.ID_AUML_U] = AUML_U;
- names[Ids.ID_BDQUO] = BDQUO;
- names[Ids.ID_BETA_L] = BETA_L;
- names[Ids.ID_BETA_U] = BETA_U;
- names[Ids.ID_BRVBAR] = BRVBAR;
- names[Ids.ID_BULL] = BULL;
- names[Ids.ID_CAP] = CAP;
- names[Ids.ID_CCEDIL_L] = CCEDIL_L;
- names[Ids.ID_CCEDIL_U] = CCEDIL_U;
- names[Ids.ID_CEDIL] = CEDIL;
- names[Ids.ID_CENT] = CENT;
- names[Ids.ID_CHI_L] = CHI_L;
- names[Ids.ID_CHI_U] = CHI_U;
- names[Ids.ID_CIRC] = CIRC;
- names[Ids.ID_CLUBS] = CLUBS;
- names[Ids.ID_CONG] = CONG;
- names[Ids.ID_COPY] = COPY;
- names[Ids.ID_CRARR] = CRARR;
- names[Ids.ID_CUP] = CUP;
- names[Ids.ID_CURREN] = CURREN;
- names[Ids.ID_DAGGER_L] = DAGGER_L;
- names[Ids.ID_DAGGER_U] = DAGGER_U;
- names[Ids.ID_DARR_L] = DARR_L;
- names[Ids.ID_DARR_U] = DARR_U;
- names[Ids.ID_DEG] = DEG;
- names[Ids.ID_DELTA_L] = DELTA_L;
- names[Ids.ID_DELTA_U] = DELTA_U;
- names[Ids.ID_DIAMS] = DIAMS;
- names[Ids.ID_DIVIDE] = DIVIDE;
- names[Ids.ID_EACUTE_L] = EACUTE_L;
- names[Ids.ID_EACUTE_U] = EACUTE_U;
- names[Ids.ID_ECIRC_L] = ECIRC_L;
- names[Ids.ID_ECIRC_U] = ECIRC_U;
- names[Ids.ID_EGRAVE_L] = EGRAVE_L;
- names[Ids.ID_EGRAVE_U] = EGRAVE_U;
- names[Ids.ID_EMPTY] = EMPTY;
- names[Ids.ID_EMSP] = EMSP;
- names[Ids.ID_ENSP] = ENSP;
- names[Ids.ID_EPSILON_L] = EPSILON_L;
- names[Ids.ID_EPSILON_U] = EPSILON_U;
- names[Ids.ID_EQUIV] = EQUIV;
- names[Ids.ID_ETA_L] = ETA_L;
- names[Ids.ID_ETA_U] = ETA_U;
- names[Ids.ID_ETH_L] = ETH_L;
- names[Ids.ID_ETH_U] = ETH_U;
- names[Ids.ID_EUML_L] = EUML_L;
- names[Ids.ID_EUML_U] = EUML_U;
- names[Ids.ID_EURO] = EURO;
- names[Ids.ID_EXIST] = EXIST;
- names[Ids.ID_FNOF] = FNOF;
- names[Ids.ID_FORALL] = FORALL;
- names[Ids.ID_FRAC12] = FRAC12;
- names[Ids.ID_FRAC14] = FRAC14;
- names[Ids.ID_FRAC34] = FRAC34;
- names[Ids.ID_FRASL] = FRASL;
- names[Ids.ID_GAMMA_L] = GAMMA_L;
- names[Ids.ID_GAMMA_U] = GAMMA_U;
- names[Ids.ID_GE] = GE;
- names[Ids.ID_GT] = GT;
- names[Ids.ID_HARR_L] = HARR_L;
- names[Ids.ID_HARR_U] = HARR_U;
- names[Ids.ID_HEARTS] = HEARTS;
- names[Ids.ID_HELLIP] = HELLIP;
- names[Ids.ID_IACUTE_L] = IACUTE_L;
- names[Ids.ID_IACUTE_U] = IACUTE_U;
- names[Ids.ID_ICIRC_L] = ICIRC_L;
- names[Ids.ID_ICIRC_U] = ICIRC_U;
- names[Ids.ID_IEXCL] = IEXCL;
- names[Ids.ID_IGRAVE_L] = IGRAVE_L;
- names[Ids.ID_IGRAVE_U] = IGRAVE_U;
- names[Ids.ID_IMAGE] = IMAGE;
- names[Ids.ID_INFIN] = INFIN;
- names[Ids.ID_INT] = INT;
- names[Ids.ID_IOTA_L] = IOTA_L;
- names[Ids.ID_IOTA_U] = IOTA_U;
- names[Ids.ID_IQUEST] = IQUEST;
- names[Ids.ID_ISIN] = ISIN;
- names[Ids.ID_IUML_L] = IUML_L;
- names[Ids.ID_IUML_U] = IUML_U;
- names[Ids.ID_KAPPA_L] = KAPPA_L;
- names[Ids.ID_KAPPA_U] = KAPPA_U;
- names[Ids.ID_LAMBDA_L] = LAMBDA_L;
- names[Ids.ID_LAMBDA_U] = LAMBDA_U;
- names[Ids.ID_LANG] = LANG;
- names[Ids.ID_LAQUO] = LAQUO;
- names[Ids.ID_LARR_L] = LARR_L;
- names[Ids.ID_LARR_U] = LARR_U;
- names[Ids.ID_LCEIL] = LCEIL;
- names[Ids.ID_LDQUO] = LDQUO;
- names[Ids.ID_LE] = LE;
- names[Ids.ID_LFLOOR] = LFLOOR;
- names[Ids.ID_LOWAST] = LOWAST;
- names[Ids.ID_LOZ] = LOZ;
- names[Ids.ID_LRM] = LRM;
- names[Ids.ID_LSAQUO] = LSAQUO;
- names[Ids.ID_LSQUO] = LSQUO;
- names[Ids.ID_LT] = LT;
- names[Ids.ID_MACR] = MACR;
- names[Ids.ID_MDASH] = MDASH;
- names[Ids.ID_MICRO] = MICRO;
- names[Ids.ID_MIDDOT] = MIDDOT;
- names[Ids.ID_MINUS] = MINUS;
- names[Ids.ID_MU_L] = MU_L;
- names[Ids.ID_MU_U] = MU_U;
- names[Ids.ID_NABLA] = NABLA;
- names[Ids.ID_NBSP] = NBSP;
- names[Ids.ID_NDASH] = NDASH;
- names[Ids.ID_NE] = NE;
- names[Ids.ID_NI] = NI;
- names[Ids.ID_NOT] = NOT;
- names[Ids.ID_NOTIN] = NOTIN;
- names[Ids.ID_NSUB] = NSUB;
- names[Ids.ID_NTILDE_L] = NTILDE_L;
- names[Ids.ID_NTILDE_U] = NTILDE_U;
- names[Ids.ID_NU_L] = NU_L;
- names[Ids.ID_NU_U] = NU_U;
- names[Ids.ID_OACUTE_L] = OACUTE_L;
- names[Ids.ID_OACUTE_U] = OACUTE_U;
- names[Ids.ID_OCIRC_L] = OCIRC_L;
- names[Ids.ID_OCIRC_U] = OCIRC_U;
- names[Ids.ID_OELIG_L] = OELIG_L;
- names[Ids.ID_OELIG_U] = OELIG_U;
- names[Ids.ID_OGRAVE_L] = OGRAVE_L;
- names[Ids.ID_OGRAVE_U] = OGRAVE_U;
- names[Ids.ID_OLINE] = OLINE;
- names[Ids.ID_OMEGA_L] = OMEGA_L;
- names[Ids.ID_OMEGA_U] = OMEGA_U;
- names[Ids.ID_OMICRON_L] = OMICRON_L;
- names[Ids.ID_OMICRON_U] = OMICRON_U;
- names[Ids.ID_OPLUS] = OPLUS;
- names[Ids.ID_OR] = OR;
- names[Ids.ID_ORDF] = ORDF;
- names[Ids.ID_ORDM] = ORDM;
- names[Ids.ID_OSLASH_L] = OSLASH_L;
- names[Ids.ID_OSLASH_U] = OSLASH_U;
- names[Ids.ID_OTILDE_L] = OTILDE_L;
- names[Ids.ID_OTILDE_U] = OTILDE_U;
- names[Ids.ID_OTIMES] = OTIMES;
- names[Ids.ID_OUML_L] = OUML_L;
- names[Ids.ID_OUML_U] = OUML_U;
- names[Ids.ID_PARA] = PARA;
- names[Ids.ID_PART] = PART;
- names[Ids.ID_PERMIL] = PERMIL;
- names[Ids.ID_PERP] = PERP;
- names[Ids.ID_PHI_L] = PHI_L;
- names[Ids.ID_PHI_U] = PHI_U;
- names[Ids.ID_PIV] = PIV;
- names[Ids.ID_PI_L] = PI_L;
- names[Ids.ID_PI_U] = PI_U;
- names[Ids.ID_PLUSMN] = PLUSMN;
- names[Ids.ID_POUND] = POUND;
- names[Ids.ID_PRIME_L] = PRIME_L;
- names[Ids.ID_PRIME_U] = PRIME_U;
- names[Ids.ID_PROD] = PROD;
- names[Ids.ID_PROP] = PROP;
- names[Ids.ID_PSI_L] = PSI_L;
- names[Ids.ID_PSI_U] = PSI_U;
- names[Ids.ID_QUOT] = QUOT;
- names[Ids.ID_RADIC] = RADIC;
- names[Ids.ID_RANG] = RANG;
- names[Ids.ID_RAQUO] = RAQUO;
- names[Ids.ID_RARR_L] = RARR_L;
- names[Ids.ID_RARR_U] = RARR_U;
- names[Ids.ID_RCEIL] = RCEIL;
- names[Ids.ID_RDQUO] = RDQUO;
- names[Ids.ID_REAL] = REAL;
- names[Ids.ID_REG] = REG;
- names[Ids.ID_RFLOOR] = RFLOOR;
- names[Ids.ID_RHO_L] = RHO_L;
- names[Ids.ID_RHO_U] = RHO_U;
- names[Ids.ID_RLM] = RLM;
- names[Ids.ID_RSAQUO] = RSAQUO;
- names[Ids.ID_RSQUO] = RSQUO;
- names[Ids.ID_SBQUO] = SBQUO;
- names[Ids.ID_SCARON_L] = SCARON_L;
- names[Ids.ID_SCARON_U] = SCARON_U;
- names[Ids.ID_SDOT] = SDOT;
- names[Ids.ID_SECT] = SECT;
- names[Ids.ID_SHY] = SHY;
- names[Ids.ID_SIGMAF] = SIGMAF;
- names[Ids.ID_SIGMA_L] = SIGMA_L;
- names[Ids.ID_SIGMA_U] = SIGMA_U;
- names[Ids.ID_SIM] = SIM;
- names[Ids.ID_SPADES] = SPADES;
- names[Ids.ID_SUB] = SUB;
- names[Ids.ID_SUBE] = SUBE;
- names[Ids.ID_SUM] = SUM;
- names[Ids.ID_SUP] = SUP;
- names[Ids.ID_SUP1] = SUP1;
- names[Ids.ID_SUP2] = SUP2;
- names[Ids.ID_SUP3] = SUP3;
- names[Ids.ID_SUPE] = SUPE;
- names[Ids.ID_SZLIG] = SZLIG;
- names[Ids.ID_TAU_L] = TAU_L;
- names[Ids.ID_TAU_U] = TAU_U;
- names[Ids.ID_THERE4] = THERE4;
- names[Ids.ID_THETASYM] = THETASYM;
- names[Ids.ID_THETA_L] = THETA_L;
- names[Ids.ID_THETA_U] = THETA_U;
- names[Ids.ID_THINSP] = THINSP;
- names[Ids.ID_THORN_L] = THORN_L;
- names[Ids.ID_THORN_U] = THORN_U;
- names[Ids.ID_TILDE] = TILDE;
- names[Ids.ID_TIMES] = TIMES;
- names[Ids.ID_TRADE] = TRADE;
- names[Ids.ID_UACUTE_L] = UACUTE_L;
- names[Ids.ID_UACUTE_U] = UACUTE_U;
- names[Ids.ID_UARR_L] = UARR_L;
- names[Ids.ID_UARR_U] = UARR_U;
- names[Ids.ID_UCIRC_L] = UCIRC_L;
- names[Ids.ID_UCIRC_U] = UCIRC_U;
- names[Ids.ID_UGRAVE_L] = UGRAVE_L;
- names[Ids.ID_UGRAVE_U] = UGRAVE_U;
- names[Ids.ID_UML] = UML;
- names[Ids.ID_UPSIH] = UPSIH;
- names[Ids.ID_UPSILON_L] = UPSILON_L;
- names[Ids.ID_UPSILON_U] = UPSILON_U;
- names[Ids.ID_UUML_L] = UUML_L;
- names[Ids.ID_UUML_U] = UUML_U;
- names[Ids.ID_WEIERP] = WEIERP;
- names[Ids.ID_XI_L] = XI_L;
- names[Ids.ID_XI_U] = XI_U;
- names[Ids.ID_YACUTE_L] = YACUTE_L;
- names[Ids.ID_YACUTE_U] = YACUTE_U;
- names[Ids.ID_YEN] = YEN;
- names[Ids.ID_YUML_L] = YUML_L;
- names[Ids.ID_YUML_U] = YUML_U;
- names[Ids.ID_ZETA_L] = ZETA_L;
- names[Ids.ID_ZETA_U] = ZETA_U;
- names[Ids.ID_ZWJ] = ZWJ;
- names[Ids.ID_ZWNJ] = ZWNJ;
- }
- private static char[] values = null;
-
- static {
- values = new char[Ids.getNumOfIds()];
- values[Ids.ID_AACUTE_L] = 225;
- values[Ids.ID_AACUTE_U] = 193;
- values[Ids.ID_ACIRC_L] = 226;
- values[Ids.ID_ACIRC_U] = 194;
- values[Ids.ID_ACUTE] = 180;
- values[Ids.ID_AELIG_L] = 230;
- values[Ids.ID_AELIG_U] = 198;
- values[Ids.ID_AGRAVE_L] = 224;
- values[Ids.ID_AGRAVE_U] = 192;
- values[Ids.ID_ALEFSYM] = 8501;
- values[Ids.ID_ALPHA_L] = 945;
- values[Ids.ID_ALPHA_U] = 913;
- values[Ids.ID_AMP] = 38;
- values[Ids.ID_AND] = 8743;
- values[Ids.ID_ANG] = 8736;
- values[Ids.ID_ARING_L] = 229;
- values[Ids.ID_ARING_U] = 197;
- values[Ids.ID_ASYMP] = 8776;
- values[Ids.ID_ATILDE_L] = 227;
- values[Ids.ID_ATILDE_U] = 195;
- values[Ids.ID_AUML_L] = 228;
- values[Ids.ID_AUML_U] = 196;
- values[Ids.ID_BDQUO] = 8222;
- values[Ids.ID_BETA_L] = 946;
- values[Ids.ID_BETA_U] = 914;
- values[Ids.ID_BRVBAR] = 166;
- values[Ids.ID_BULL] = 8226;
- values[Ids.ID_CAP] = 8745;
- values[Ids.ID_CCEDIL_L] = 231;
- values[Ids.ID_CCEDIL_U] = 199;
- values[Ids.ID_CEDIL] = 184;
- values[Ids.ID_CENT] = 162;
- values[Ids.ID_CHI_L] = 967;
- values[Ids.ID_CHI_U] = 935;
- values[Ids.ID_CIRC] = 710;
- values[Ids.ID_CLUBS] = 9827;
- values[Ids.ID_CONG] = 8773;
- values[Ids.ID_COPY] = 169;
- values[Ids.ID_CRARR] = 8629;
- values[Ids.ID_CUP] = 8746;
- values[Ids.ID_CURREN] = 164;
- values[Ids.ID_DAGGER_L] = 8224;
- values[Ids.ID_DAGGER_U] = 8225;
- values[Ids.ID_DARR_L] = 8595;
- values[Ids.ID_DARR_U] = 8659;
- values[Ids.ID_DEG] = 176;
- values[Ids.ID_DELTA_L] = 948;
- values[Ids.ID_DELTA_U] = 916;
- values[Ids.ID_DIAMS] = 9830;
- values[Ids.ID_DIVIDE] = 247;
- values[Ids.ID_EACUTE_L] = 233;
- values[Ids.ID_EACUTE_U] = 201;
- values[Ids.ID_ECIRC_L] = 234;
- values[Ids.ID_ECIRC_U] = 202;
- values[Ids.ID_EGRAVE_L] = 232;
- values[Ids.ID_EGRAVE_U] = 200;
- values[Ids.ID_EMPTY] = 8709;
- values[Ids.ID_EMSP] = 8195;
- values[Ids.ID_ENSP] = 8194;
- values[Ids.ID_EPSILON_L] = 949;
- values[Ids.ID_EPSILON_U] = 917;
- values[Ids.ID_EQUIV] = 8801;
- values[Ids.ID_ETA_L] = 951;
- values[Ids.ID_ETA_U] = 919;
- values[Ids.ID_ETH_L] = 240;
- values[Ids.ID_ETH_U] = 208;
- values[Ids.ID_EUML_L] = 235;
- values[Ids.ID_EUML_U] = 203;
- values[Ids.ID_EURO] = 8364;
- values[Ids.ID_EXIST] = 8707;
- values[Ids.ID_FNOF] = 402;
- values[Ids.ID_FORALL] = 8704;
- values[Ids.ID_FRAC12] = 189;
- values[Ids.ID_FRAC14] = 188;
- values[Ids.ID_FRAC34] = 190;
- values[Ids.ID_FRASL] = 8260;
- values[Ids.ID_GAMMA_L] = 947;
- values[Ids.ID_GAMMA_U] = 915;
- values[Ids.ID_GE] = 8805;
- values[Ids.ID_GT] = 62;
- values[Ids.ID_HARR_L] = 8596;
- values[Ids.ID_HARR_U] = 8660;
- values[Ids.ID_HEARTS] = 9829;
- values[Ids.ID_HELLIP] = 8230;
- values[Ids.ID_IACUTE_L] = 237;
- values[Ids.ID_IACUTE_U] = 205;
- values[Ids.ID_ICIRC_L] = 238;
- values[Ids.ID_ICIRC_U] = 206;
- values[Ids.ID_IEXCL] = 161;
- values[Ids.ID_IGRAVE_L] = 236;
- values[Ids.ID_IGRAVE_U] = 204;
- values[Ids.ID_IMAGE] = 8465;
- values[Ids.ID_INFIN] = 8734;
- values[Ids.ID_INT] = 8747;
- values[Ids.ID_IOTA_L] = 953;
- values[Ids.ID_IOTA_U] = 921;
- values[Ids.ID_IQUEST] = 191;
- values[Ids.ID_ISIN] = 8712;
- values[Ids.ID_IUML_L] = 239;
- values[Ids.ID_IUML_U] = 207;
- values[Ids.ID_KAPPA_L] = 954;
- values[Ids.ID_KAPPA_U] = 922;
- values[Ids.ID_LAMBDA_L] = 955;
- values[Ids.ID_LAMBDA_U] = 923;
- values[Ids.ID_LANG] = 9001;
- values[Ids.ID_LAQUO] = 171;
- values[Ids.ID_LARR_L] = 8592;
- values[Ids.ID_LARR_U] = 8656;
- values[Ids.ID_LCEIL] = 8968;
- values[Ids.ID_LDQUO] = 8220;
- values[Ids.ID_LE] = 8804;
- values[Ids.ID_LFLOOR] = 8970;
- values[Ids.ID_LOWAST] = 8727;
- values[Ids.ID_LOZ] = 9674;
- values[Ids.ID_LRM] = 8206;
- values[Ids.ID_LSAQUO] = 8249;
- values[Ids.ID_LSQUO] = 8216;
- values[Ids.ID_LT] = 60;
- values[Ids.ID_MACR] = 175;
- values[Ids.ID_MDASH] = 8212;
- values[Ids.ID_MICRO] = 181;
- values[Ids.ID_MIDDOT] = 183;
- values[Ids.ID_MINUS] = 8722;
- values[Ids.ID_MU_L] = 956;
- values[Ids.ID_MU_U] = 924;
- values[Ids.ID_NABLA] = 8711;
- values[Ids.ID_NBSP] = 160;
- values[Ids.ID_NDASH] = 8211;
- values[Ids.ID_NE] = 8800;
- values[Ids.ID_NI] = 8715;
- values[Ids.ID_NOT] = 172;
- values[Ids.ID_NOTIN] = 8713;
- values[Ids.ID_NSUB] = 8836;
- values[Ids.ID_NTILDE_L] = 241;
- values[Ids.ID_NTILDE_U] = 209;
- values[Ids.ID_NU_L] = 957;
- values[Ids.ID_NU_U] = 925;
- values[Ids.ID_OACUTE_L] = 243;
- values[Ids.ID_OACUTE_U] = 211;
- values[Ids.ID_OCIRC_L] = 244;
- values[Ids.ID_OCIRC_U] = 212;
- values[Ids.ID_OELIG_L] = 339;
- values[Ids.ID_OELIG_U] = 338;
- values[Ids.ID_OGRAVE_L] = 242;
- values[Ids.ID_OGRAVE_U] = 210;
- values[Ids.ID_OLINE] = 8254;
- values[Ids.ID_OMEGA_L] = 969;
- values[Ids.ID_OMEGA_U] = 937;
- values[Ids.ID_OMICRON_L] = 959;
- values[Ids.ID_OMICRON_U] = 927;
- values[Ids.ID_OPLUS] = 8853;
- values[Ids.ID_OR] = 8744;
- values[Ids.ID_ORDF] = 170;
- values[Ids.ID_ORDM] = 186;
- values[Ids.ID_OSLASH_L] = 248;
- values[Ids.ID_OSLASH_U] = 216;
- values[Ids.ID_OTILDE_L] = 245;
- values[Ids.ID_OTILDE_U] = 213;
- values[Ids.ID_OTIMES] = 8855;
- values[Ids.ID_OUML_L] = 246;
- values[Ids.ID_OUML_U] = 214;
- values[Ids.ID_PARA] = 182;
- values[Ids.ID_PART] = 8706;
- values[Ids.ID_PERMIL] = 8240;
- values[Ids.ID_PERP] = 8869;
- values[Ids.ID_PHI_L] = 966;
- values[Ids.ID_PHI_U] = 934;
- values[Ids.ID_PIV] = 982;
- values[Ids.ID_PI_L] = 960;
- values[Ids.ID_PI_U] = 928;
- values[Ids.ID_PLUSMN] = 177;
- values[Ids.ID_POUND] = 163;
- values[Ids.ID_PRIME_L] = 8242;
- values[Ids.ID_PRIME_U] = 8243;
- values[Ids.ID_PROD] = 8719;
- values[Ids.ID_PROP] = 8733;
- values[Ids.ID_PSI_L] = 968;
- values[Ids.ID_PSI_U] = 936;
- values[Ids.ID_QUOT] = 34;
- values[Ids.ID_RADIC] = 8730;
- values[Ids.ID_RANG] = 9002;
- values[Ids.ID_RAQUO] = 187;
- values[Ids.ID_RARR_L] = 8594;
- values[Ids.ID_RARR_U] = 8658;
- values[Ids.ID_RCEIL] = 8969;
- values[Ids.ID_RDQUO] = 8221;
- values[Ids.ID_REAL] = 8476;
- values[Ids.ID_REG] = 174;
- values[Ids.ID_RFLOOR] = 8971;
- values[Ids.ID_RHO_L] = 961;
- values[Ids.ID_RHO_U] = 929;
- values[Ids.ID_RLM] = 8207;
- values[Ids.ID_RSAQUO] = 8250;
- values[Ids.ID_RSQUO] = 8217;
- values[Ids.ID_SBQUO] = 8218;
- values[Ids.ID_SCARON_L] = 353;
- values[Ids.ID_SCARON_U] = 352;
- values[Ids.ID_SDOT] = 8901;
- values[Ids.ID_SECT] = 167;
- values[Ids.ID_SHY] = 173;
- values[Ids.ID_SIGMAF] = 962;
- values[Ids.ID_SIGMA_L] = 963;
- values[Ids.ID_SIGMA_U] = 931;
- values[Ids.ID_SIM] = 8764;
- values[Ids.ID_SPADES] = 9824;
- values[Ids.ID_SUB] = 8834;
- values[Ids.ID_SUBE] = 8838;
- values[Ids.ID_SUM] = 8721;
- values[Ids.ID_SUP] = 8835;
- values[Ids.ID_SUP1] = 185;
- values[Ids.ID_SUP2] = 178;
- values[Ids.ID_SUP3] = 179;
- values[Ids.ID_SUPE] = 8839;
- values[Ids.ID_SZLIG] = 223;
- values[Ids.ID_TAU_L] = 964;
- values[Ids.ID_TAU_U] = 932;
- values[Ids.ID_THERE4] = 8756;
- values[Ids.ID_THETASYM] = 977;
- values[Ids.ID_THETA_L] = 952;
- values[Ids.ID_THETA_U] = 920;
- values[Ids.ID_THINSP] = 8201;
- values[Ids.ID_THORN_L] = 254;
- values[Ids.ID_THORN_U] = 222;
- values[Ids.ID_TILDE] = 732;
- values[Ids.ID_TIMES] = 215;
- values[Ids.ID_TRADE] = 8482;
- values[Ids.ID_UACUTE_L] = 250;
- values[Ids.ID_UACUTE_U] = 218;
- values[Ids.ID_UARR_L] = 8593;
- values[Ids.ID_UARR_U] = 8657;
- values[Ids.ID_UCIRC_L] = 251;
- values[Ids.ID_UCIRC_U] = 219;
- values[Ids.ID_UGRAVE_L] = 249;
- values[Ids.ID_UGRAVE_U] = 217;
- values[Ids.ID_UML] = 168;
- values[Ids.ID_UPSIH] = 978;
- values[Ids.ID_UPSILON_L] = 965;
- values[Ids.ID_UPSILON_U] = 933;
- values[Ids.ID_UUML_L] = 252;
- values[Ids.ID_UUML_U] = 220;
- values[Ids.ID_WEIERP] = 8472;
- values[Ids.ID_XI_L] = 958;
- values[Ids.ID_XI_U] = 926;
- values[Ids.ID_YACUTE_L] = 253;
- values[Ids.ID_YACUTE_U] = 221;
- values[Ids.ID_YEN] = 165;
- values[Ids.ID_YUML_L] = 255;
- values[Ids.ID_YUML_U] = 376;
- values[Ids.ID_ZETA_L] = 950;
- values[Ids.ID_ZETA_U] = 918;
- values[Ids.ID_ZWJ] = 8205;
- values[Ids.ID_ZWNJ] = 8204;
- }
-
- /**
- */
- public EntityCollection() {
- super(names, STRICT_CASE);
- }
-
- /**
- * Create an entity declaration.
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- * @param attrName java.lang.String
- */
- protected CMNode create(String entityName) {
- int id = getID(entityName);
- if (id == ID_UNKNOWN)
- return null;
-
- String value = String.valueOf(values[id]);
- HTMLEntityDeclImpl dec = new HTMLEntityDeclImpl(entityName, value);
-
- return dec;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.java
deleted file mode 100644
index 505d6622d7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLAttrDeclImpl.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.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Implementation class of {@link <code>HTMLAttributeDeclaration</code>} interface.<br>
- */
-class HTMLAttrDeclImpl extends CMNodeImpl implements HTMLAttributeDeclaration {
-
- private HTMLCMDataTypeImpl type = null;
- private int usage = 0;
-
- /**
- */
- public HTMLAttrDeclImpl(String attrName, HTMLCMDataTypeImpl valueType, int valueUsage) {
- super(attrName);
- this.type = valueType;
-
- switch (valueUsage) {
- case OPTIONAL :
- case REQUIRED :
- case FIXED :
- case PROHIBITED :
- this.usage = valueUsage;
- break;
- default :
- // should warn...
- this.usage = OPTIONAL; // fall back
- break;
- }
- }
-
- /**
- * getAttrName method
- * @return java.lang.String
- */
- public String getAttrName() {
- return getNodeName();
- }
-
- /**
- * getAttrType method
- * @return CMDataType
- */
- public CMDataType getAttrType() {
- return type;
- }
-
- /**
- * @deprecated in superclass
- */
- public String getDefaultValue() {
- if (type.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_DEFAULT)
- return null;
- return type.getImpliedValue();
- }
-
- /**
- * @deprecated in superclass
- */
- public Enumeration getEnumAttr() {
- Vector v = new Vector(Arrays.asList(type.getEnumeratedValues()));
- return v.elements();
- }
-
- /**
- * getNodeType method
- * @return int
- *
- * Returns one of :
- * ELEMENT_DECLARATION, ATTRIBUTE_DECLARATION, GROUP, ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ATTRIBUTE_DECLARATION;
- }
-
- /**
- * @return int
- */
- public int getUsage() {
- return usage;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- return super.getProperty(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java
deleted file mode 100644
index 64931b6dbf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMDataTypeImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLCMDataTypeImpl extends CMNodeImpl implements HTMLCMDataType {
-
- private int impliedValueKind = IMPLIED_VALUE_NONE;
- private String impliedValue = null;
- private final static String[] emptyArray = new String[0];
- private String[] enumValues = emptyArray;
- private String instanceValue = null;
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName) {
- super(typeName);
- }
-
- /**
- * HTMLCMDataTypeImpl constructor comment.
- * @param nm java.lang.String
- */
- public HTMLCMDataTypeImpl(String typeName, String instanceValue) {
- super(typeName);
- this.instanceValue = instanceValue;
- }
-
- /**
- * 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 instanceValue;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMDataType
- */
- public String getDataTypeName() {
- return getNodeName();
- }
-
- /**
- * getTypeName method
- * @return java.lang.String[]
- *
- */
- public String[] getEnumeratedValues() {
- return enumValues;
- }
-
- /**
- * getTypeName method
- * @return java.lang.String
- *
- * Returns the implied value or null if none exists.
- */
- public String getImpliedValue() {
- return impliedValue;
- }
-
- /**
- * getImpliedValueKind method
- * @return int
- *
- * Returns one of :
- * IMPLIED_VALUE_NONE, IMPLIED_VALUE_FIXED, IMPLIED_VALUE_DEFAULT.
- */
- public int getImpliedValueKind() {
- return impliedValueKind;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.DATA_TYPE;
- }
-
- /**
- */
- void setEnumValues(String[] values) {
- enumValues = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- enumValues[i] = values[i];
- }
- }
-
- /**
- * package scope.
- */
- void setImpliedValue(int kind, String value) {
- switch (kind) {
- case IMPLIED_VALUE_FIXED :
- case IMPLIED_VALUE_DEFAULT :
- impliedValueKind = kind;
- impliedValue = value;
- break;
- case IMPLIED_VALUE_NONE :
- default :
- impliedValueKind = IMPLIED_VALUE_NONE;
- impliedValue = null; // maybe a null string?
- break;
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.java
deleted file mode 100644
index a1e555acf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLCMNode.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.core.internal.contentmodel.chtml;
-
-
-/**
- * In HTML Documents, name and value of an attribute/element/entity
- * should be treated ignoring theirs case. However, in XML documents,
- * they should be distinguished with sensitiveness of their case.
- * CMNode is basically designed to represent DTDs or Schemas for XML
- * documents. So, it doesn't have interfaces to retrieve such information.
- * However, declarations in the HTML CM should provide such information.
- * This intermediate interface is intended to provide whether ignore cases
- * or not.<br>
- */
-interface HTMLCMNode extends org.eclipse.wst.xml.core.internal.contentmodel.CMNode {
-
- /**
- * Returns <code>true</code>, if declaration is for HTML attribute/element/entity.
- * Otherwise, returns <code>false</code>.
- * @return boolean
- */
- boolean shouldIgnoreCase();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java
deleted file mode 100644
index 759294d57b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLElemDeclImpl.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * Base class for all Hed???? classes.
- */
-abstract class HTMLElemDeclImpl extends CMContentImpl implements HTMLElementDeclaration, HTMLPropertyDeclaration {
-
- // DTD
- protected CMNamedNodeMapImpl attributes = null;
- protected String typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- /** Never access this field directly. Instead, use getComplexTypeDefinition method. */
- private ComplexTypeDefinition typeDefinition = null;
- protected CMGroupImpl inclusion = null;
- protected CMGroupImpl exclusion = null;
- // advanced information
- protected CMNamedNodeMap prohibitedAncestors = null;
- protected int correctionType = CORRECT_NONE;
- protected int formatType = FORMAT_HTML;
- protected int layoutType = LAYOUT_NONE;
- protected int omitType = OMIT_NONE;
- protected boolean keepSpaces = false;
- protected boolean indentChild = false;
- protected ElementCollection elementCollection = null;
- protected AttributeCollection attributeCollection = null;
- protected final static CMNamedNodeMap EMPTY_MAP = new CMNamedNodeMap() {
- public int getLength() {
- return 0;
- }
-
- public CMNode getNamedItem(String name) {
- return null;
- }
-
- public CMNode item(int index) {
- return null;
- }
-
- public Iterator iterator() {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- };
-
- /**
- * HTMLElemDeclImpl constructor.
- * In the HTML DTD, an element declaration has no specification
- * for its occurrence. Occurrence is specifed in content model, like
- * <code>(LI)+</code>. To avoid confusion (and complexity),
- * occurrence of an element declaration is always 1 (it means, min = 1 and
- * max = 1). Instead, occurrence of CMGroup represents actual occurrence
- * of the content.
- * <br>
- * @param name java.lang.String
- */
- public HTMLElemDeclImpl(String elementName, ElementCollection collection) {
- super(elementName, 1, 1);
- elementCollection = collection;
- attributeCollection = collection.getAttributeCollection();
- }
-
- /**
- */
- protected abstract void createAttributeDeclarations();
-
- private ComplexTypeDefinition createComplexTypeDefinition() {
- if (typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_CDATA) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_EMPTY) || typeDefinitionName.equals(ComplexTypeDefinitionFactory.CTYPE_PCDATA))
- return null;
-
- ComplexTypeDefinitionFactory factory = ComplexTypeDefinitionFactory.getInstance();
- if (factory == null)
- return null; // fatal error.
-
- ComplexTypeDefinition def = factory.createTypeDefinition(typeDefinitionName, elementCollection);
- return def;
- }
-
- /**
- * Get an attribute declaration.
- */
- public HTMLAttributeDeclaration getAttributeDeclaration(String attrName) {
- if (attributes == null) {
- createAttributeDeclarations();
- if (attributes == null)
- return null; // fail to create
- }
-
- CMNode cmnode = attributes.getNamedItem(attrName);
- if (cmnode == null) {
- return null;
- }
- else {
- return (HTMLAttributeDeclaration) cmnode; // already exists.
- }
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getAttributes() {
- if (attributes == null)
- createAttributeDeclarations(); // lazy eval.
- return attributes;
- }
-
- /**
- * Get an instance of complex type definition.
- */
- private ComplexTypeDefinition getComplexTypeDefinition() {
- if (typeDefinition == null)
- typeDefinition = createComplexTypeDefinition();
- return typeDefinition;
- }
-
- /**
- * Content.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and always return null.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMContent getContent() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContent() : null;
- }
-
- /**
- * Content type.<br>
- * Element declarations which type is EMPTY or CDATA (maybe PCDATA)
- * <strong>MUST</strong> override this method and return an appropriate type.
- * This default implementation always tries to create a complex type definition
- * instance and access to it.
- * <br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- ComplexTypeDefinition def = getComplexTypeDefinition(); // lazy eval.
- return (def != null) ? def.getContentType() : CMElementDeclaration.CDATA;
- }
-
- /**
- * @see HTMLElementDeclaration#getCorrectionType
- */
- public int getCorrectionType() {
- return correctionType;
- }
-
- /**
- * HTML element doesn't have any data type. So, this method always
- * returns <code>null</code>.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMDataType getDataType() {
- return null;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public String getElementName() {
- return getNodeName();
- }
-
- /**
- * Exclusion.
- * Almost elements don't have a exclusion.
- * Only classes those have exclusion should override this method.
- */
- public CMContent getExclusion() {
- return null;
- }
-
- /**
- * Default format type is <code>FORMAT_HTML</code>.<br>
- */
- public int getFormatType() {
- return formatType;
- }
-
- /**
- * Inclusion.
- * Almost elements don't have a inclusion.
- * Only classes those have inclusion should override this method.
- */
- public CMContent getInclusion() {
- return null;
- }
-
- /**
- */
- public int getLayoutType() {
- return layoutType;
- }
-
- /**
- * Line break hint is strongly related to layout type.
- * Indeed, in the C++DOM, it is determined from layout type only.
- * So, this implementation, as the default implementation for all declarations,
- * also determines from layout type only.<br>
- * @return int
- */
- public int getLineBreakHint() {
- switch (getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- return HTMLElementDeclaration.BREAK_AFTER_START;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- return HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END;
- default :
- return HTMLElementDeclaration.BREAK_NONE;
- }
- }
-
- /**
- * No HTML element has local elements. So, this method always
- * returns an empty map.
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public CMNamedNodeMap getLocalElements() {
- return EMPTY_MAP;
- }
-
- /**
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMNode
- */
- public int getNodeType() {
- return CMNode.ELEMENT_DECLARATION;
- }
-
- /**
- */
- public int getOmitType() {
- return omitType;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- return EMPTY_MAP;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return true;
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null);
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return false;
- return pp.supports(this);
- }
-
- }
-
- /**
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(true);
- }
- else if (propertyName.equals(HTMLCMProperties.CONTENT_HINT)) {
- ComplexTypeDefinition def = getComplexTypeDefinition();
- return (def != null) ? def.getPrimaryCandidate() : null;
- }
- else {
- PropertyProvider pp = PropertyProviderFactory.getProvider(propertyName);
- if (pp == null)
- return null;
- return pp.get(this);
- }
- }
-
- /**
- * Return element names which terminates this element.<br>
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return null;
- }
-
- /**
- * return true when the element is a JSP element.
- */
- public boolean isJSP() {
- return false;
- }
-
- /**
- * In some elements, such as APPLET, a source generator should indent child
- * elements that their parents. That is, a source generator should generate
- * source of APPLET and PARAMS like this:
- * <PRE>
- * &lt;APPLET ...&gt;
- * &lt;PARAM ... &gt;
- * &lt;PARAM ... &gt;
- * &lt;/APPLET&gt;
- * <PRE>
- * @return boolean
- */
- public boolean shouldIndentChildSource() {
- return indentChild;
- }
-
- /**
- * Most of elements can compact spaces in their child text nodes.
- * Some special elements should keep them in their source.
- * @return boolean
- */
- public boolean shouldKeepSpaces() {
- return keepSpaces;
- }
-
- /**
- * @return boolean
- */
- public boolean shouldTerminateAt(HTMLElementDeclaration nextElement) {
- Iterator i = getTerminators();
- if (i == null)
- return false;
- String nextName = nextElement.getElementName();
- while (i.hasNext()) {
- if (nextName.equals(i.next()))
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java
deleted file mode 100644
index c63d2a8e70..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HTMLEntityDeclImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLEntityDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-
-
-/**
- */
-class HTMLEntityDeclImpl extends CMNodeImpl implements HTMLEntityDeclaration {
-
- private java.lang.String value = null;
-
- /**
- * CMEntityDeclImpl constructor comment.
- * @param entityName java.lang.String; Entity name.
- * @param entityValue java.lang.String; Value string.
- */
- public HTMLEntityDeclImpl(String entityName, String entityValue) {
- super(entityName);
- value = entityValue;
- }
-
- /**
- * getName method
- * @return java.lang.String
- */
- public String getName() {
- return getNodeName();
- }
-
- /**
- * Get CMNode type.<br>
- * @return int; Always return ENTITY_DECLARATION.
- */
- public int getNodeType() {
- return CMNode.ENTITY_DECLARATION;
- }
-
- /**
- * getValue method
- * @return java.lang.String
- */
- public String getValue() {
- return value;
- }
-
- /**
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- return super.supports(propertyName);
- }
-
- /**
- * Entities in HTML documents are always treated with ignoring cases.
- * Because no special entities are defined in JSP 1.0, this method
- * can always return <code>true</code>.<br>
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return new Boolean(true);
- return super.getProperty(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java
deleted file mode 100644
index 455ca28f7f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedA.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * A.
- */
-final class HedA extends HedInlineContainer {
-
- /**
- */
- public HedA(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.A, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
- }
-
- /**
- * %attrs;
- * (charset %Charset; #IMPLIED)
- * (type %ContentType; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (href %URI; #IMPLIED)
- * (hreflang %LanguageCode; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (rel %LinkTypes; #IMPLIED)
- * (rev %LinkTypes; #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (directkey %Character; #IMPLIED)
- * (shape %Shape; rect)
- * (coords %Coords; #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_HREF,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>A</code> has the exclusion.
- * It is <code>A</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode a = elementCollection.getNamedItem(CHTMLNamespace.ElementName.A);
- if (a != null)
- exclusion.appendChild(a);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.A,};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.java
deleted file mode 100644
index 55579d8b87..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedADDRESS.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * ADDRESS.
- */
-final class HedADDRESS extends HTMLElemDeclImpl {
-
- /**
- */
- public HedADDRESS(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.ADDRESS, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_ADDRESS;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.java
deleted file mode 100644
index ab2c8161be..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBASE.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.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * BASE.
- */
-final class HedBASE extends HedEmpty {
-
- /**
- */
- public HedBASE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BASE, collection);
- // LAYOUT_HIDDEN.
- // Because, BASE is GROUP_HIDDEN in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * BASE.
- * (href %URI; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_HREF,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.java
deleted file mode 100644
index 818156e29b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBLOCKQUOTE.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * BLOCKQUOTE.
- */
-final class HedBLOCKQUOTE extends HedFlowContainer {
-
- /**
- */
- public HedBLOCKQUOTE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BLOCKQUOTE, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (cite %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java
deleted file mode 100644
index 992288f2cf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBODY.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * BODY.
- */
-final class HedBODY extends HedFlowContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.HEAD, CHTMLNamespace.ElementName.BODY, CHTMLNamespace.ElementName.HTML};
-
- /**
- */
- public HedBODY(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BODY, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_BOTH;
- }
-
- /**
- * %attrs;
- * %bodycolors;
- * (onload %Script; #IMPLIED)
- * (onunload %Script; #IMPLIED)
- * (background %URI; #IMPLIED)
- * (marginwidth %Pixels; #IMPLIED) ... D205514
- * (marginheight %Pixels; #IMPLIED) .. D205514
- * (topmargin, CDATA, #IMPLIED) ...... D205514
- * (bottommargin, CDATA, #IMPLIED) ... D205514
- * (leftmargin, CDATA, #IMPLIED) ..... D205514
- * (rightmargin, CDATA, #IMPLIED) .... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %bodycolors;
- attributeCollection.getBodycolors(attributes);
-
- }
-
- /**
- * BODY has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.java
deleted file mode 100644
index 30ef48ba45..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedBR.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.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-
-
-
-/**
- * BR.
- */
-final class HedBR extends HedEmpty {
-
- /**
- */
- public HedBR(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.BR, collection);
- // LAYOUT_BREAK.
- // Because, BR is GROUP_BREAK in the C++DOM/DTDParser.cpp.
- layoutType = LAYOUT_BREAK;
- }
-
- /**
- * BR.
- * %coreattrs;
- * (clear (left | all | right | none) none)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %coreattrs;
- attributeCollection.getCore(attributes);
- // clear
- HTMLAttributeDeclaration attr = attributeCollection.getDeclaration(CHTMLNamespace.ATTR_NAME_CLEAR);
- if (attr != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_CLEAR, attr);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.java
deleted file mode 100644
index c2c60d69ab..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedCENTER.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.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * CENTER.
- */
-final class HedCENTER extends HedFlowContainer {
-
- /**
- */
- public HedCENTER(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.CENTER, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.java
deleted file mode 100644
index a5da292dd3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDD.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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * DD.
- */
-final class HedDD extends HedFlowContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.DT, CHTMLNamespace.ElementName.DD};
-
- /**
- */
- public HedDD(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DD, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java
deleted file mode 100644
index adb56c2df7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDIV.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DIV.
- */
-final class HedDIV extends HedFlowContainer {
-
- /**
- */
- public HedDIV(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DIV, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * %align;
- * %reserved;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // %align;
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
- // %reserved; ... empty
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.java
deleted file mode 100644
index c09c9ac095..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDL.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * DL.
- */
-final class HedDL extends HTMLElemDeclImpl {
-
- /**
- */
- public HedDL(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DL, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_DEFINITION_LIST;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-
- /**
- * %arrays;
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.java
deleted file mode 100644
index e12c4c4c07..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedDT.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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * DT.
- */
-final class HedDT extends HedInlineContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.DT, CHTMLNamespace.ElementName.DD};
-
- /**
- */
- public HedDT(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.DT, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- }
-
- /**
- * DT has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.java
deleted file mode 100644
index 92c30da559..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedEmpty.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for EMPTY type element declarations.
- */
-abstract class HedEmpty extends HTMLElemDeclImpl {
-
- /**
- */
- public HedEmpty(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_EMPTY;
- // EMPTY type has no end tag.
- omitType = OMIT_END_MUST;
- }
-
- /**
- * Content.<br>
- * EMPTY type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.EMPTY;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java
deleted file mode 100644
index 599ca9a2ae..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFORM.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- * FORM.
- */
-final class HedFORM extends HedFlowContainer {
-
- /**
- */
- public HedFORM(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.FORM, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs;
- * (action %URI; #REQUIRED)
- * (method (GET|POST) GET)
- * (enctype %ContentType; "application/x-www-form-urlencoded")
- * (accept %ContentTypes; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (onsubmit %Script; #IMPLIED)
- * (onreset %Script; #IMPLIED)
- * (target %FrameTarget; #IMPLIED)
- * (accept-charset %Charsets; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_ACTION, CHTMLNamespace.ATTR_NAME_METHOD, CHTMLNamespace.ATTR_NAME_ENCTYPE, CHTMLNamespace.ATTR_NAME_NAME,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * Exclusion.
- * <code>FORM</code> has the exclusion.
- * It is <code>FORM</code> itself.
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null; // fatal
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- CMNode form = elementCollection.getNamedItem(CHTMLNamespace.ElementName.FORM);
- if (form != null)
- exclusion.appendChild(form);
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.FORM, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.java
deleted file mode 100644
index 99f307b1d7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedFlowContainer.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.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for (%flow;)* containers.
- */
-abstract class HedFlowContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedFlowContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_FLOW_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.java
deleted file mode 100644
index 2366dce8d1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHEAD.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * HTML.
- */
-final class HedHEAD extends HTMLElemDeclImpl {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.HEAD, CHTMLNamespace.ElementName.BODY, CHTMLNamespace.ElementName.HTML};
-
- /**
- */
- public HedHEAD(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.HEAD, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HEAD;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HEAD</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%i18n;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>profile</td><td>URI</td><td>#IMPLIED</td><td>N/A</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- }
-
- /**
- * HEAD has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.java
deleted file mode 100644
index ed65ab335b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHR.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * HR.
- */
-final class HedHR extends HedEmpty {
-
- /**
- */
- public HedHR(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.HR, collection);
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * %attrs
- * (align (left|center|right) #IMPLIED) ... should be defined locally.
- * (noshade (noshade) #IMPLIED)
- * (size %Pixels; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (color %Color; #IMPLIED) ... D205514
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (align (left|center|right) #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {CHTMLNamespace.ATTR_VALUE_LEFT, CHTMLNamespace.ATTR_VALUE_CENTER, CHTMLNamespace.ATTR_VALUE_RIGHT};
- atype.setEnumValues(values);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_ALIGN, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {CHTMLNamespace.ATTR_NAME_NOSHADE, CHTMLNamespace.ATTR_NAME_SIZE, CHTMLNamespace.ATTR_NAME_WIDTH,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java
deleted file mode 100644
index a6243d2eb4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHTML.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLAttributeDeclaration;
-
-
-/**
- * HTML.
- */
-final class HedHTML extends HTMLElemDeclImpl {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.HTML};
-
- /**
- */
- public HedHTML(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.HTML, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_HTML;
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_BOTH;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>HTML</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td><code>%i18n;</code></td><td>-</td><td>-</td><td>-</td>
- * <td>{@link PDCMDocImpl#getAttrDeclarationsI18n}</td>
- * </tr>
- * <tr>
- * <td>version</td><td>CDATA</td><td>#FIXED</td>
- * <td>{@link HTML_VERSION_TRANSITIONAL}</td><td>deplecated in HTML4.01</td>
- * </tr>
- * </tbody>
- * </table><br>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- // version
- HTMLAttributeDeclaration adec = attributeCollection.getDeclaration(CHTMLNamespace.ATTR_NAME_VERSION);
- if (adec != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_VERSION, adec);
- }
-
- /**
- * HTML has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java
deleted file mode 100644
index 398e97a025..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedHeading.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * H[1-6].
- */
-final class HedHeading extends HedInlineContainer {
-
- /**
- */
- public HedHeading(String elementName, ElementCollection collection) {
- super(elementName, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>H1</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- * <br>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl attr = AttributeCollection.createAlignForParagraph();
- if (attr != null)
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.java
deleted file mode 100644
index ae95384594..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedIMG.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * IMG.
- */
-final class HedIMG extends HedEmpty {
-
- /**
- */
- public HedIMG(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.IMG, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * IMG.
- * %attrs;
- * (src %URI; #REQUIRED): should be defined locally.
- * (alt %Text; #REQUIRED)
- * (longdesc %URI; #IMPLIED)
- * (name CDATA #IMPLIED)
- * (height %Length; #IMPLIED)
- * (width %Length; #IMPLIED)
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (align %IAlign; #IMPLIED): should be defined locally.
- * (border %Pixels; #IMPLIED)
- * (hspace %Pixels; #IMPLIED)
- * (vspace %Pixels; #IMPLIED)
- * (mapfile %URI; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (src %URI; #REQUIRED): should be defined locally.
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- atype = new HTMLCMDataTypeImpl(CMDataType.URI);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SRC, atype, CMAttributeDeclaration.REQUIRED);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SRC, attr);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_ALT, CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_HEIGHT, CHTMLNamespace.ATTR_NAME_WIDTH, CHTMLNamespace.ATTR_NAME_BORDER, CHTMLNamespace.ATTR_NAME_HSPACE, CHTMLNamespace.ATTR_NAME_VSPACE,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
-
- // align (local); should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.PRE};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java
deleted file mode 100644
index bf0951ccce..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedINPUT.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * INPUT.
- */
-final class HedINPUT extends HedEmpty {
-
- /**
- */
- public HedINPUT(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.INPUT, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- * INPUT.
- * %attrs;
- * (type %InputType; TEXT) ... should be defined locally.
- * (name CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- * (checked (checked) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (size CDATA #IMPLIED) ... should be defined locally.
- * (maxlength NUMBER #IMPLIED)
- * (src %URI; #IMPLIED)
- * (alt CDATA #IMPLIED) ... should be defined locally.
- * (usemap %URI; #IMPLIED)
- * (ismap (ismap) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (accept %ContentTypes; #IMPLIED)
- * (align %IAlign; #IMPLIED) ... should be defined locally.
- * (istyle CDATA #IMPLIED)
- * <<D215684
- * (width CDATA; #IMPLIED)
- * (height CDATA; #IMPLIED)
- * (border CDATA; #IMPLIED)
- * D215684
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- HTMLCMDataTypeImpl atype = null;
- HTMLAttrDeclImpl attr = null;
- // (type %InputType; TEXT) ... should be defined locally.
- // NOTE: %InputType is ENUM;
- // (text | password | checkbox | radio | submit | reset |
- // file | hidden | image | button)
- atype = new HTMLCMDataTypeImpl(CMDataType.ENUM);
- String[] values = {CHTMLNamespace.ATTR_VALUE_TEXT, CHTMLNamespace.ATTR_VALUE_PASSWORD, CHTMLNamespace.ATTR_VALUE_CHECKBOX, CHTMLNamespace.ATTR_VALUE_RADIO, CHTMLNamespace.ATTR_VALUE_SUBMIT, CHTMLNamespace.ATTR_VALUE_RESET, CHTMLNamespace.ATTR_VALUE_HIDDEN,};
- atype.setEnumValues(values);
- atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, CHTMLNamespace.ATTR_VALUE_TEXT);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_TYPE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_TYPE, attr);
-
- // (size CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SIZE, attr);
-
- // (alt CDATA #IMPLIED) ... should be defined locally.
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_ALT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALT, attr);
-
- // (align %IAlign; #IMPLIED) ... should be defined locally.
- attr = AttributeCollection.createAlignForImage();
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, attr);
-
- // the rest.
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_VALUE, CHTMLNamespace.ATTR_NAME_CHECKED, CHTMLNamespace.ATTR_NAME_SIZE, CHTMLNamespace.ATTR_NAME_MAXLENGTH, CHTMLNamespace.ATTR_NAME_SRC, CHTMLNamespace.ATTR_NAME_ALT, CHTMLNamespace.ATTR_NAME_ALIGN, CHTMLNamespace.ATTR_NAME_ISTYLE,
- //<<D215684
- CHTMLNamespace.ATTR_NAME_WIDTH, CHTMLNamespace.ATTR_NAME_HEIGHT, CHTMLNamespace.ATTR_NAME_BORDER
- //<D215684
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.java
deleted file mode 100644
index 99f14c90a6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedInlineContainer.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.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for (%inline;)* containers.
- */
-abstract class HedInlineContainer extends HTMLElemDeclImpl {
-
- /**
- * HedInlineContainer.
- * @param elementName java.lang.String
- * @param collection ElementCollection
- */
- public HedInlineContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_INLINE_CONTAINER;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.java
deleted file mode 100644
index 6a3a344f4d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedLI.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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * LI.
- */
-final class HedLI extends HedFlowContainer {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.LI};
-
- /**
- */
- public HedLI(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.LI, collection);
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END_DEFAULT;
- }
-
- /**
- * %attrs;
- * (type %LIStyle; #IMPLIED) ... should be defined locally.
- * (value NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- * LI has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.java
deleted file mode 100644
index 9e457c7963..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedListItemContainer.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.core.internal.contentmodel.chtml;
-
-
-
-/**
- * Base class for list item container declarations.
- * - OL, UL, MENU, DIR.
- */
-abstract class HedListItemContainer extends HTMLElemDeclImpl {
-
- /**
- */
- public HedListItemContainer(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_LI_CONTAINER;
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- indentChild = true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java
deleted file mode 100644
index 581d954ad5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMENU.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * MENU/DIR.
- */
-final class HedMENU extends HedListItemContainer {
-
- /**
- */
- public HedMENU(String elementName, ElementCollection collection) {
- super(elementName, collection);
- }
-
- /**
- * MENU/DIR.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- * Exclusion.
- * <code>MENU/DIR</code> has the exclusion.
- * It is <code>%block;</code>.
- * %block; is:
- * P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
- * NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
- * TABLE | FIELDSET | ADDRESS.
- * %heading; is: H1 | H2 | H3 | H4 | H5 | H6.
- * %list; is : UL | OL | DIR | MENU.
- * %preformatted; is PRE.
- * <br>
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // %block;
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {CHTMLNamespace.ElementName.P, CHTMLNamespace.ElementName.H1, CHTMLNamespace.ElementName.H2, CHTMLNamespace.ElementName.H3, CHTMLNamespace.ElementName.H4, CHTMLNamespace.ElementName.H5, CHTMLNamespace.ElementName.H6, CHTMLNamespace.ElementName.UL, CHTMLNamespace.ElementName.OL, CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU, CHTMLNamespace.ElementName.PRE, CHTMLNamespace.ElementName.DL, CHTMLNamespace.ElementName.DIV, CHTMLNamespace.ElementName.CENTER, CHTMLNamespace.ElementName.BLOCKQUOTE, CHTMLNamespace.ElementName.FORM, CHTMLNamespace.ElementName.HR, CHTMLNamespace.ElementName.ADDRESS};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java
deleted file mode 100644
index 882eca9843..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedMETA.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * META.
- */
-final class HedMETA extends HedEmpty {
-
- /**
- */
- public HedMETA(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.META, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * META.
- * %i18n;
- * (http-equiv NAME #IMPLIED)
- * (name NAME #IMPLIED) ... should be defined locally.
- * (content CDATA #REQUIRED)
- * (scheme CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
-
- // (name NAME #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(HTMLCMDataType.NAME);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_NAME, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_NAME, attr);
-
- // 249493
- atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
- attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_CONTENT, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_CONTENT, attr);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_HTTP_EQUIV,
- // CHTMLNamespace.ATTR_NAME_CONTENT
- };
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.java
deleted file mode 100644
index b2583d0a20..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOL.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.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * OL.
- */
-final class HedOL extends HedListItemContainer {
-
- /**
- */
- public HedOL(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.OL, collection);
- }
-
- /**
- * OL.
- * (type %OLStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- * (start NUMBER #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.java
deleted file mode 100644
index 84a081d473..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedOPTION.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-/**
- * OPTION.
- */
-final class HedOPTION extends HedPcdata {
-
- private static String[] terminators = {CHTMLNamespace.ElementName.OPTION};
-
- /**
- */
- public HedOPTION(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.OPTION, collection);
- layoutType = LAYOUT_HIDDEN;
- omitType = OMIT_END;
- }
-
- /**
- * OPTION.
- * %attrs;
- * (selected (selected) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (label %Text; #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_SELECTED, CHTMLNamespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-
- /**
- * OPTION has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- return Arrays.asList(terminators).iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.java
deleted file mode 100644
index eb056eb56e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedP.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.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * P.
- */
-final class HedP extends HedInlineContainer {
-
- private static Collection terminators = null;
-
- /**
- */
- public HedP(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.P, collection);
- correctionType = CORRECT_EMPTY;
- layoutType = LAYOUT_BLOCK;
- omitType = OMIT_END;
- }
-
- /**
- * Create all attribute declarations.
- * This method is called once in the constructor of the super class.
- * The <code>P</code> element may have the following attributes:
- * <table>
- * <tbody>
- * <tr>
- * <th>NAME</th><th>TYPE</th><th>USAGE</th><th>DEFAULT (INITIAL) VALUE</th><th>MEMO</th>
- * </tr>
- * <tr>
- * <td>%attrs;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * <tr>
- * <td>%align;</td><td>-</td><td>-</td><td>-</td><td>-</td>
- * </tr>
- * </tbody>
- * </table>
- * <p><b>%align;</b> means <code>align (left|center|right|justify) #IMPLIED</code>.
- * Unfortunately, this <code>align</code> is different from one in
- * <code>IMG</code> or <code>TABLE</code>. So, the attribute declaration
- * of <code>align</code> should be localy created and it shouldn't be registered
- * in a <code>HCMDocImpl</code> instance.</p>
- * <p>However, %align is used in sevaral times. I wouldn't write same code
- * in many times. So, I add a new utility method into <code>CMUtil</code>
- * to create the attribute declaration.</p>
- * <br>
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // align
- HTMLAttrDeclImpl adec = AttributeCollection.createAlignForParagraph();
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_ALIGN, adec);
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
- return prohibitedAncestors;
- }
-
- /**
- * Return names of terminators.
- * <code>P</code> has terminators.
- * @return java.util.Iterator
- */
- protected Iterator getTerminators() {
- if (terminators != null)
- return terminators.iterator();
- //<<D217982
- terminators = new Vector();
- terminators.addAll(elementCollection.getNamesOfBlock());
- terminators.add(CHTMLNamespace.ElementName.LI);
- terminators.add(CHTMLNamespace.ElementName.DT);
- terminators.add(CHTMLNamespace.ElementName.DD);
- //D217982
- return terminators.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java
deleted file mode 100644
index 99f597589f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPRE.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * PRE.
- */
-final class HedPRE extends HedInlineContainer {
-
- /**
- * PRE element should keep spaces in its source.
- */
- public HedPRE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.PRE, collection);
- // CORRECT_EMPTY - GROUP_COMPACT
- correctionType = CORRECT_EMPTY;
-
- keepSpaces = true;
- }
-
- /**
- * %attrs;
- * (width NUMBER #IMPLIED) ... should be defined locally.
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
- // (width NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_WIDTH, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_WIDTH, attr);
- }
-
- /**
- * Exclusion.
- * <code>PRE</code> has the exclusion.
- * It is <code>%pre.exclusion;</code>.
- * %pre.exclusion is:
- * IMG | OBJECT | APPLET | BIG | SMALL | SUB | SUP | FONT | BASEFONT
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
- String[] names = {CHTMLNamespace.ElementName.IMG,};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
-
- return exclusion;
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.java
deleted file mode 100644
index 15b13c334e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedPcdata.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.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- * Base class for PCDATA type element declarations.<br>
- */
-abstract class HedPcdata extends HTMLElemDeclImpl {
-
- /**
- */
- public HedPcdata(String elementName, ElementCollection collection) {
- super(elementName, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_PCDATA;
- }
-
- /**
- * Content.<br>
- * PCDATA type always returns <code>null</code>.
- * <br>
- * @return org.eclipse.wst.xml.core.internal.contentmodel.CMContent
- */
- public CMContent getContent() {
- return null;
- }
-
- /**
- * Content type.<br>
- * @see org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration
- */
- public int getContentType() {
- return CMElementDeclaration.PCDATA;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java
deleted file mode 100644
index cbd0bb80a2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSELECT.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- * SELECT.
- */
-final class HedSELECT extends HTMLElemDeclImpl {
-
- /**
- */
- public HedSELECT(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SELECT, collection);
- typeDefinitionName = ComplexTypeDefinitionFactory.CTYPE_SELECT;
- layoutType = LAYOUT_OBJECT;
- indentChild = true;
- }
-
- /**
- * %attrs;
- * %reserved;
- * (name CDATA #IMPLIED)
- * (size NUMBER #IMPLIED) ... should be defined locally.
- * (multiple (multiple) #IMPLIED)
- * (disabled (disabled) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- // (size NUMBER #IMPLIED) ... should be defined locally.
- HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
- HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(CHTMLNamespace.ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
- attributes.putNamedItem(CHTMLNamespace.ATTR_NAME_SIZE, attr);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_MULTIPLE,};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java
deleted file mode 100644
index b0e0bd37c7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIBase.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-
-
-
-
-/**
- * Base class for SSI declarations.
- */
-abstract class HedSSIBase extends HedEmpty {
-
- /**
- */
- public HedSSIBase(String elementName, ElementCollection collection) {
- super(elementName, collection);
- layoutType = LAYOUT_OBJECT;
- }
-
- /**
- */
- public int getFormatType() {
- return HTMLElementDeclaration.FORMAT_SSI;
- }
-
- /**
- */
- public boolean supports(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return true;
- return super.supports(propName);
- }
-
- /*
- */
- public Object getProperty(String propName) {
- if (propName.equals(HTMLCMProperties.IS_SSI))
- return new Boolean(true);
- return super.getProperty(propName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.java
deleted file mode 100644
index d5e92e341d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIConfig.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.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:CONFIG.
- */
-final class HedSSIConfig extends HedSSIBase {
-
- /**
- */
- public HedSSIConfig(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_CONFIG, collection);
- }
-
- /**
- * SSI:CONFIG.
- * (errmsg CDATA #IMPLIED)
- * (sizefmt CDATA #IMPLIED)
- * (timefmt CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_ERRMSG, CHTMLNamespace.ATTR_NAME_SIZEFMT, CHTMLNamespace.ATTR_NAME_TIMEFMT};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.java
deleted file mode 100644
index 3cf3f7c2bf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIEcho.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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:ECHO.
- */
-final class HedSSIEcho extends HedSSIBase {
-
- /**
- */
- public HedSSIEcho(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_ECHO, collection);
- }
-
- /**
- * SSI:ECHO
- * (var CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_VAR};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.java
deleted file mode 100644
index e97cb5d6b7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIExec.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:EXEC.
- */
-final class HedSSIExec extends HedSSIBase {
-
- /**
- */
- public HedSSIExec(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_EXEC, collection);
- }
-
- /**
- * SSI:EXEC
- * (cgi %URI; #IMPLIED)
- * (cmd CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_CGI, CHTMLNamespace.ATTR_NAME_CMD};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.java
deleted file mode 100644
index 75eaf9d1c1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFlastmod.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:FLASTMOD.
- */
-final class HedSSIFlastmod extends HedSSIBase {
-
- /**
- */
- public HedSSIFlastmod(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_FLASTMOD, collection);
- }
-
- /**
- * SSI:FLASTMOD
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.java
deleted file mode 100644
index 3fbf3c11fd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIFsize.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:FSIZE.
- */
-final class HedSSIFsize extends HedSSIBase {
-
- /**
- */
- public HedSSIFsize(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_FSIZE, collection);
- }
-
- /**
- * SSI:FSIZE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.java
deleted file mode 100644
index 4788b5e161..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIInclude.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:INCLUDE.
- */
-final class HedSSIInclude extends HedSSIBase {
-
- /**
- */
- public HedSSIInclude(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_INCLUDE, collection);
- }
-
- /**
- * SSI:INCLUDE
- * (file %URI; #IMPLIED)
- * (virtual %URI #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_FILE, CHTMLNamespace.ATTR_NAME_VIRTUAL};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java
deleted file mode 100644
index 0064a4f0cd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSIPrintenv.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * SSI:PRINTENV.
- */
-final class HedSSIPrintenv extends HedSSIBase {
-
- /**
- */
- public HedSSIPrintenv(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_PRINTENV, collection);
- }
-
- /**
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
- }
-
- /**
- * SSI:PRINTENV has no attributes. So, this method should
- * always return <code>null</code>.
- * Note: Since somebody doesn't expect null is returned, return the empty attribute
- * like a custom tag which doesn't have attributes
- */
- public CMNamedNodeMap getAttributes() {
- return super.getAttributes();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.java
deleted file mode 100644
index e1a8e1d627..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedSSISet.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * SSI:SET.
- */
-final class HedSSISet extends HedSSIBase {
-
- /**
- */
- public HedSSISet(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.SSI_SET, collection);
- }
-
- /**
- * SSI:SET
- * (var CDATA #IMPLIED)
- * (value CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- String[] names = {CHTMLNamespace.ATTR_NAME_VAR, CHTMLNamespace.ATTR_NAME_VALUE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java
deleted file mode 100644
index bef9535cf1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTEXTAREA.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-/**
- * TEXTAREA.
- */
-final class HedTEXTAREA extends HedPcdata {
-
- /**
- * TEXTAREA should keep spaces in its source.
- */
- public HedTEXTAREA(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.TEXTAREA, collection);
- layoutType = LAYOUT_OBJECT;
-
- keepSpaces = true;
- }
-
- /**
- * TEXTAREA.
- * %attrs;
- * %reserved; ... empty
- * (name CDATA #IMPLIED)
- * (rows NUMBER #REQUIRED)
- * (cols NUMBER #REQUIRED)
- * (disabled (disabled) #IMPLIED)
- * (readonly (readonly) #IMPLIED)
- * (tabindex NUMBER #IMPLIED)
- * (accesskey %Character; #IMPLIED)
- * (onfocus %Script; #IMPLIED)
- * (onblur %Script; #IMPLIED)
- * (onselect %Script; #IMPLIED)
- * (onchange %Script; #IMPLIED)
- * (istyle CDATA #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- String[] names = {CHTMLNamespace.ATTR_NAME_NAME, CHTMLNamespace.ATTR_NAME_ROWS, CHTMLNamespace.ATTR_NAME_COLS, CHTMLNamespace.ATTR_NAME_ISTYLE};
- attributeCollection.getDeclarations(attributes, Arrays.asList(names).iterator());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java
deleted file mode 100644
index 007bf35282..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedTITLE.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-
-
-import java.util.Arrays;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-
-/**
- * TITLE.
- */
-final class HedTITLE extends HedPcdata {
-
- /**
- */
- public HedTITLE(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.TITLE, collection);
- layoutType = LAYOUT_HIDDEN;
- }
-
- /**
- * TITLE.
- * %i18n;
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %i18n;
- attributeCollection.getI18n(attributes);
- }
-
- /**
- * Exclusion.
- * <code>TITLE</code> has the exclusion.
- * It is <code>%head.misc;</code>.
- * %head.misc; is <code>SCRIPT|STYLE|META|LINK|OBJECT</code>.
- * <br>
- */
- public CMContent getExclusion() {
- if (exclusion != null)
- return exclusion; // already created.
- if (elementCollection == null)
- return null;
-
- // (SCRIPT|STYLE|META|LINK|OBJECT)
- exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
-
- String[] names = {CHTMLNamespace.ElementName.META,};
- elementCollection.getDeclarations(exclusion, Arrays.asList(names).iterator());
- return exclusion;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.java
deleted file mode 100644
index 15ddbc1451..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/HedUL.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.wst.html.core.internal.contentmodel.chtml;
-
-
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-
-/**
- * UL.
- */
-final class HedUL extends HedListItemContainer {
-
- /**
- */
- public HedUL(ElementCollection collection) {
- super(CHTMLNamespace.ElementName.UL, collection);
- }
-
- /**
- * UL.
- * (type %ULStyle; #IMPLIED) ... should be defined locally.
- * (compact (compact) #IMPLIED)
- */
- protected void createAttributeDeclarations() {
- if (attributes != null)
- return; // already created.
- if (attributeCollection == null)
- return; // fatal
-
- attributes = new CMNamedNodeMapImpl();
-
- // %attrs;
- attributeCollection.getAttrs(attributes);
-
- }
-
- /**
- */
- public CMNamedNodeMap getProhibitedAncestors() {
- if (prohibitedAncestors != null)
- return prohibitedAncestors;
-
- String[] names = {CHTMLNamespace.ElementName.DIR, CHTMLNamespace.ElementName.MENU};
- prohibitedAncestors = elementCollection.getDeclarations(names);
-
- return prohibitedAncestors;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.java
deleted file mode 100644
index 6ed567daaf..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProvider.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.core.internal.contentmodel.chtml;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-
-
-
-/**
- * PropertyProvider class.
- * This class is intended to be used in HTMLElementDeclaration instances.
- */
-interface PropertyProvider {
-
- boolean supports(HTMLElementDeclaration edecl);
-
- Object get(HTMLElementDeclaration edecl);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java
deleted file mode 100644
index 2c7b1b939c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/chtml/PropertyProviderFactory.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.chtml;
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLPropertyDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.annotation.AnnotationMap;
-
-/**
- * The factory object of PropertyProvider.
- */
-final class PropertyProviderFactory {
-
-
- /**
- * DefaultProvider is intended to be used for unknown properties.
- * It always returns null value for any properties.
- */
- class DefaultProvider implements PropertyProvider {
- public DefaultProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return false;
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- return null;
- }
- }
-
- abstract class AbstractElementPropertyProvider implements PropertyProvider {
- protected AbstractElementPropertyProvider() {
- super();
- }
-
- public boolean supports(HTMLElementDeclaration edecl) {
- return (edecl != null);
- }
-
- public Object get(HTMLElementDeclaration edecl) {
- if (!(edecl instanceof HTMLPropertyDeclaration))
- return null;
- return getElementProperty((HTMLPropertyDeclaration)edecl);
- }
-
- abstract protected Object getElementProperty(HTMLPropertyDeclaration decl);
- }
-
- /*
- * "tagInfo"
- * gets documentation for the element
- */
- class PPTagInfo extends AbstractElementPropertyProvider {
- private final static String htmlAnnotationLoc = "data/htmref.xml"; //$NON-NLS-1$
- protected AnnotationMap fAnnotationMap = null;
-
- public PPTagInfo() {
- super();
- }
-
- /**
- * Gets the annotationMap.
- * @return Returns a AnnotationMap
- */
- protected AnnotationMap getAnnotationMap() {
- if (fAnnotationMap == null) {
- fAnnotationMap = new AnnotationMap();
- try {
- fAnnotationMap.load(htmlAnnotationLoc, HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
- }
- catch (Exception e) {
- // no annotation available
- }
- }
- return fAnnotationMap;
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (decl instanceof HTMLElementDeclaration) {
- return getAnnotationMap().getProperty(((HTMLElementDeclaration)decl).getElementName(), "tagInfo"); //$NON-NLS-1$
- } else {
- return null;
- }
- }
- }
-
- /*
- * "shouldKeepSpace"
- */
- class PPShouldKeepSpace extends AbstractElementPropertyProvider {
- public PPShouldKeepSpace() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldKeepSpaces());
- }
- }
-
- /*
- * "shouldIndentChildSource"
- */
- class PPShouldIndentChildSource extends AbstractElementPropertyProvider {
- public PPShouldIndentChildSource() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.shouldIndentChildSource());
- }
- }
-
- /*
- * "terminators"
- */
- class PPTerminators extends AbstractElementPropertyProvider {
- public PPTerminators() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- if (decl == null)
- return null;
- if (! (decl instanceof HTMLElemDeclImpl)) return null;
- return ((HTMLElemDeclImpl)decl).getTerminators();
- }
- }
-
- /*
- * "prohibitedAncestors"
- */
- class PPProhibitedAncestors extends AbstractElementPropertyProvider {
- public PPProhibitedAncestors() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getProhibitedAncestors();
- }
- }
-
- /*
- * "isJSP"
- */
- class PPIsJSP extends AbstractElementPropertyProvider {
- public PPIsJSP() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(decl.isJSP());
- }
- }
-
- /*
- * "isXHTML"
- * HTMLElementDeclaration itself never represent any XHTML element declaration.
- * So, this property must be always false.
- */
- class PPIsXHTML extends AbstractElementPropertyProvider {
- public PPIsXHTML() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "isSSI"
- * Each declaration class for SSI elements must provide this property itself,
- * and then return true. Other declaration must always return false.
- */
- class PPIsSSI extends AbstractElementPropertyProvider {
- public PPIsSSI() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return new Boolean(false);
- }
- }
-
- /*
- * "lineBreakHint"
- */
- class PPLineBreakHint extends AbstractElementPropertyProvider {
- public PPLineBreakHint() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String hint = HTMLCMProperties.Values.BREAK_NONE;
- switch (decl.getLineBreakHint()) {
- case HTMLElementDeclaration.BREAK_AFTER_START :
- hint = HTMLCMProperties.Values.BREAK_AFTER_START;
- break;
- case HTMLElementDeclaration.BREAK_BEFORE_START_AND_AFTER_END :
- hint = HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END;
- break;
- case HTMLElementDeclaration.BREAK_NONE :
- // nothing to do
- default :
- break;
- }
- return hint;
- }
- }
-
- /*
- * "layoutType"
- */
- class PPLayoutType extends AbstractElementPropertyProvider {
- public PPLayoutType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.LAYOUT_NONE;
- switch (decl.getLayoutType()) {
- case HTMLElementDeclaration.LAYOUT_BLOCK :
- type = HTMLCMProperties.Values.LAYOUT_BLOCK;
- break;
- case HTMLElementDeclaration.LAYOUT_BREAK :
- type = HTMLCMProperties.Values.LAYOUT_BREAK;
- break;
- case HTMLElementDeclaration.LAYOUT_HIDDEN :
- type = HTMLCMProperties.Values.LAYOUT_HIDDEN;
- break;
- case HTMLElementDeclaration.LAYOUT_OBJECT :
- type = HTMLCMProperties.Values.LAYOUT_OBJECT;
- break;
- case HTMLElementDeclaration.LAYOUT_WRAP :
- type = HTMLCMProperties.Values.LAYOUT_WRAP;
- break;
- case HTMLElementDeclaration.LAYOUT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "omitType"
- */
- class PPOmitType extends AbstractElementPropertyProvider {
- public PPOmitType() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- String type = HTMLCMProperties.Values.OMIT_NONE;
- switch (decl.getOmitType()) {
- case HTMLElementDeclaration.OMIT_BOTH :
- type = HTMLCMProperties.Values.OMIT_BOTH;
- break;
- case HTMLElementDeclaration.OMIT_END :
- type = HTMLCMProperties.Values.OMIT_END;
- break;
- case HTMLElementDeclaration.OMIT_END_DEFAULT :
- type = HTMLCMProperties.Values.OMIT_END_DEFAULT;
- break;
- case HTMLElementDeclaration.OMIT_END_MUST :
- type = HTMLCMProperties.Values.OMIT_END_MUST;
- break;
- case HTMLElementDeclaration.OMIT_NONE :
- // nothing to do.
- default :
- break;
- }
- return type;
- }
- }
-
- /*
- * "inclusion"
- */
- class PPInclusion extends AbstractElementPropertyProvider {
- public PPInclusion() {
- super();
- }
-
- protected Object getElementProperty(HTMLPropertyDeclaration decl) {
- return decl.getInclusion();
- }
- }
-
- public static PropertyProvider getProvider(String propName) {
- PropertyProviderFactory factory = getInstance();
- PropertyProvider pp = (PropertyProvider) factory.registry.get(propName);
- if (pp != null)
- return pp;
-
- pp = factory.create(propName);
- if (pp == null)
- return factory.defaultProvider;
-
- factory.registry.put(propName, pp);
- return pp;
- }
-
- private static PropertyProviderFactory instance = null;
-
- private synchronized static PropertyProviderFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new PropertyProviderFactory();
- return instance;
- }
-
- private Hashtable registry = new Hashtable();
- private PropertyProvider defaultProvider = new DefaultProvider();
-
- private PropertyProviderFactory() {
- super();
- }
-
- private PropertyProvider create(String propName) {
- PropertyProvider pp = null;
- if (propName.equals(HTMLCMProperties.IS_JSP))
- pp = new PPIsJSP();
- else if (propName.equals(HTMLCMProperties.IS_XHTML))
- pp = new PPIsXHTML();
- else if (propName.equals(HTMLCMProperties.IS_SSI))
- pp = new PPIsSSI();
- else if (propName.equals(HTMLCMProperties.LAYOUT_TYPE))
- pp = new PPLayoutType();
- else if (propName.equals(HTMLCMProperties.LINE_BREAK_HINT))
- pp = new PPLineBreakHint();
- else if (propName.equals(HTMLCMProperties.PROHIBITED_ANCESTORS))
- pp = new PPProhibitedAncestors();
- else if (propName.equals(HTMLCMProperties.SHOULD_KEEP_SPACE))
- pp = new PPShouldKeepSpace();
- else if (propName.equals(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE))
- pp = new PPShouldIndentChildSource();
- else if (propName.equals(HTMLCMProperties.TERMINATORS))
- pp = new PPTerminators();
- else if (propName.equals(HTMLCMProperties.TAGINFO))
- pp = new PPTagInfo();
- else if (propName.equals(HTMLCMProperties.OMIT_TYPE))
- pp = new PPOmitType();
- else if (propName.equals(HTMLCMProperties.INCLUSION))
- pp = new PPInclusion();
-
- return pp;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java
deleted file mode 100644
index 949941f877..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/ssi/SSICMDocumentFactory.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contentmodel.ssi;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- * CMDocument factory for SSI documents.
- */
-public final class SSICMDocumentFactory {
-
- private final static String PREFIX = "SSI";//$NON-NLS-1$
- private final static String DOC_TYPE_NAME = "SSI";//$NON-NLS-1$
-
- static class CMNamespaceImpl implements CMNamespace {
- public CMNamespaceImpl() {
- super();
- }
-
- public String getPrefix() {
- return PREFIX;
- }
-
- public String getURI() {
- return ""; //$NON-NLS-1$
- }
-
- public String getNodeName() {
- return DOC_TYPE_NAME;
- }
-
- public int getNodeType() {
- return CMNode.NAME_SPACE;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- }
-
- static class CMDocImpl implements CMDocument {
- private static CMDocument hcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-
- static class Elements implements CMNamedNodeMap {
- private static String[] names = {HTML40Namespace.ElementName.SSI_CONFIG, HTML40Namespace.ElementName.SSI_ECHO, HTML40Namespace.ElementName.SSI_EXEC, HTML40Namespace.ElementName.SSI_FSIZE, HTML40Namespace.ElementName.SSI_FLASTMOD, HTML40Namespace.ElementName.SSI_INCLUDE, HTML40Namespace.ElementName.SSI_PRINTENV, HTML40Namespace.ElementName.SSI_SET};
- private Hashtable map = new Hashtable();
-
- public Elements() {
- CMNamedNodeMap elems = hcm.getElements();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- CMElementDeclaration dec = (CMElementDeclaration) elems.getNamedItem(name);
- if (dec != null)
- map.put(name, dec);
- }
- }
-
- public int getLength() {
- return map.size();
- }
-
- public CMNode getNamedItem(String name) {
- String cooked = getCanonicalName(name);
- if (!map.containsKey(cooked))
- return null;
- return (CMNode) map.get(cooked);
- }
-
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- Object node = iter.next();
- if (--index < 0)
- return (CMNode) node;
- }
- return null;
- }
-
- public Iterator iterator() {
- return map.values().iterator();
- }
-
- private String getCanonicalName(String rawName) {
- return rawName.toUpperCase();
- }
- }
-
- static private Elements elements = new Elements();
-
-
- public CMDocImpl() {
- super();
- }
-
- public String getNodeName() {
- return ""; //$NON-NLS-1$
- }
-
- public int getNodeType() {
- return CMNode.DOCUMENT;
- }
-
- public CMNamedNodeMap getElements() {
- return elements;
- }
-
- public CMNamedNodeMap getEntities() {
- return null;
- }
-
- public CMNamespace getNamespace() {
- return ssins;
- }
-
- public Object getProperty(String propertyName) {
- return null;
- }
-
- public boolean supports(String propertyName) {
- return false;
- }
- }
-
- private static CMNamespace ssins = new CMNamespaceImpl();
- private static CMDocument mycm = new CMDocImpl();
-
- private SSICMDocumentFactory() {
- super();
- }
-
- public static CMDocument getCMDocument() {
- return mycm;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java
deleted file mode 100644
index 4c7a41b31e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentProperties.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentproperties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Properties constants used by HTML. Clients should only read and modify the
- * HTML properties programmatically using this class.
- *
- * @since 1.1
- */
-public class HTMLContentProperties {
- static final String HTMLCORE_ID = HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- private static final String PROJECT_KEY = "<project>"; //$NON-NLS-1$
-
- /**
- * The default document type to use when none is specified.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String DOCUMENT_TYPE = "document-type"; //$NON-NLS-1$
-
- /**
- * Generates a preference key based on resourcePath
- *
- * @param resourcePath
- * the path the key will be based off of
- * @return preference key based on resourcePath (basically the
- * resourcePath without the filename); PROJECT_KEY if resourcePath
- * is null
- */
- static String getKeyFor(IPath resourcePath) {
- String key = PROJECT_KEY;
- if (resourcePath != null && resourcePath.segmentCount() > 1) {
- key = resourcePath.removeFirstSegments(1).toString();
- }
- return key;
- }
-
- /**
- * Get the preferences node associated with the given project scope and
- * preference key (subNode) If create is true, the preference node will be
- * created if one does not already exist
- *
- * @param project
- * the project the preference node is under
- * @param preferenceKey
- * the subnode/category the preference node is located in
- * @param create
- * if true, a preference node will be created if one does not
- * already exist
- * @return Preferences associated with the given project scope and
- * preference key. null if one could not be found and create is
- * false
- */
- static Preferences getPreferences(IProject project, String preferenceKey, boolean create) {
- if (create)
- // create all nodes down to the one we are interested in
- return new ProjectScope(project).getNode(HTMLCORE_ID).node(preferenceKey);
- // be careful looking up for our node so not to create any nodes as
- // side effect
- Preferences node = Platform.getPreferencesService().getRootNode().node(ProjectScope.SCOPE);
- try {
- // TODO once bug 90500 is fixed, should be as simple as this:
- // String path = project.getName() + IPath.SEPARATOR +
- // ResourcesPlugin.PI_RESOURCES + IPath.SEPARATOR +
- // ENCODING_PREF_NODE;
- // return node.nodeExists(path) ? node.node(path) : null;
- // for now, take the long way
- if (!node.nodeExists(project.getName()))
- return null;
- node = node.node(project.getName());
- if (!node.nodeExists(HTMLCORE_ID))
- return null;
- node = node.node(HTMLCORE_ID);
- if (!node.nodeExists(preferenceKey))
- return null;
- return node.node(preferenceKey);
- }
- catch (BackingStoreException e) {
- // nodeExists failed
- Logger.log(Logger.WARNING_DEBUG, "Could not retrieve preference node", e); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Returns the value for the given key in the given context.
- *
- * @param key
- * The property key
- * @param resource
- * The current context or <code>null</code> if no context is
- * available and the workspace setting should be taken. Note
- * that passing <code>null</code> should be avoided.
- * @param recurse
- * whether the parent should be queried till property is found
- * @return Returns the current value for the key.
- * @since 1.1
- */
- public static String getProperty(String key, IResource resource, boolean recurse) {
- String val = null;
- // boolean preferenceFound = false;
- if (resource != null) {
- IProject project = resource.getProject();
- if (project != null) {
- Preferences preferences = getPreferences(project, key, false);
- if (preferences != null) {
- val = internalGetProperty(resource, recurse, preferences);
- // preferenceFound = true;
- }
- }
- }
- // Workbench preference may not be needed so leave out for now
- // // no preferences found - for performance reasons,
- // // short-circuit
- // // lookup by falling back to workspace's default
- // // setting
- // if (!preferenceFound)
- // val = getWorkbenchPreference(key);
- return val;
- }
-
- private static String internalGetProperty(IResource resource, boolean recurse, Preferences preferences) {
- String value = preferences.get(getKeyFor(resource.getFullPath()), null);
- if (value == null && resource != resource.getProject() && recurse) {
- value = preferences.get(getKeyFor(null), null);
- }
-
- // Workbench preference may not be needed so leave out for now
- // // ensure we default to the workspace preference if none is found
- // return value == null ? getWorkbenchPreference(key) : value;
- return value;
- }
-
- /**
- * Sets the value for the given key in the given context.
- *
- * @param key
- * The property key
- * @param resource
- * The current context. Note context cannot be
- * <code>null</code>.
- * @param value
- * The value to set for the key. If value is <code>null</code>
- * the key is removed from properties.
- * @since 1.1
- */
- public static void setProperty(String key, IResource resource, String value) throws CoreException {
- if (resource != null) {
- IProject project = resource.getProject();
- if (project != null) {
- Preferences preferences = getPreferences(project, key, true);
- if (value == null || value.trim().length() == 0)
- preferences.remove(getKeyFor(resource.getFullPath()));
- else
- preferences.put(getKeyFor(resource.getFullPath()), value);
- try {
- // save changes
- preferences.flush();
- }
- catch (BackingStoreException e) {
- throw new CoreException(new Status(IStatus.ERROR, HTMLCORE_ID, IStatus.ERROR, "Unable to set property", e)); //$NON-NLS-1$
- }
- }
- }
- // Workbench preference may not be needed so leave out for now
- // just set a preference in the instance scope
- // if (!preferenceFound) {
- // setWorkbenchPreference(key);
- // }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java
deleted file mode 100644
index 41f03c8a94..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentproperties/HTMLContentPropertiesManager.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contentproperties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class HTMLContentPropertiesManager {
- public HTMLContentPropertiesManager() {
- super();
- fResourceChangeListener = new ResourceChangeListener();
- fJob = new ContentPropertiesManagerJob();
- }
-
- private static HTMLContentPropertiesManager _instance = null;
- private IResourceChangeListener fResourceChangeListener;
- ContentPropertiesManagerJob fJob;
-
- /**
- * This job implementation is used to allow the resource change listener
- * to schedule operations that need to modify the workspace.
- */
- private class ContentPropertiesManagerJob extends Job {
- private static final int PROPERTIES_UPDATE_DELAY = 500;
- private List asyncChanges = new ArrayList();
-
- public ContentPropertiesManagerJob() {
- super(HTMLCoreMessages.HTMLContentPropertiesManager_Updating);
- setSystem(true);
- setPriority(Job.INTERACTIVE);
- }
-
- public void addChanges(Set newChanges) {
- if (newChanges.isEmpty())
- return;
- synchronized (asyncChanges) {
- asyncChanges.addAll(newChanges);
- asyncChanges.notify();
- }
- schedule(PROPERTIES_UPDATE_DELAY);
- }
-
- public IProject getNextChange() {
- synchronized (asyncChanges) {
- return asyncChanges.isEmpty() ? null : (IProject) asyncChanges.remove(asyncChanges.size() - 1);
- }
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- MultiStatus result = new MultiStatus(HTMLContentProperties.HTMLCORE_ID, IResourceStatus.FAILED_SETTING_CHARSET, HTMLCoreMessages.HTMLContentPropertiesManager_Updating, null);
- monitor = monitor == null ? new NullProgressMonitor() : monitor;
- try {
- monitor.beginTask(HTMLCoreMessages.HTMLContentPropertiesManager_Updating, asyncChanges.size());
- try {
- IProject next;
- while ((next = getNextChange()) != null) {
- // just exit if the system is shutting down or has
- // been shut down
- // it is too late to change the workspace at this
- // point anyway
- if (Platform.getBundle("org.eclipse.osgi").getState() != Bundle.ACTIVE) //$NON-NLS-1$
- return Status.OK_STATUS;
- try {
- // save the preferences nodes
- if (next.isAccessible()) {
- // save document type preferences
- Preferences projectPrefs = HTMLContentProperties.getPreferences(next, HTMLContentProperties.DOCUMENT_TYPE, false);
- if (projectPrefs != null)
- projectPrefs.flush();
- }
- }
- catch (BackingStoreException e) {
- // we got an error saving
- String detailMessage = NLS.bind(HTMLCoreMessages.HTMLContentPropertiesManager_Problems_Updating, next.getFullPath());
- result.add(new Status(1 << (IResourceStatus.FAILED_SETTING_CHARSET % 100 / 33), ResourcesPlugin.PI_RESOURCES, IResourceStatus.FAILED_SETTING_CHARSET, detailMessage, e));
- }
- }
- monitor.worked(1);
- }
- catch (OperationCanceledException e) {
- throw e;
- }
- }
- finally {
- monitor.done();
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
- */
- public boolean shouldRun() {
- synchronized (asyncChanges) {
- return !asyncChanges.isEmpty();
- }
- }
- }
-
- class ResourceChangeListener implements IResourceChangeListener {
- private void processEntryChanges(IResourceDelta projectDelta, Set projectsToSave) {
- // check each resource with web content setting to see if it has
- // been moved/deleted
- boolean resourceChanges = false;
-
- // project affected
- IProject currentProject = (IProject) projectDelta.getResource();
-
- resourceChanges = processPreferences(currentProject, HTMLContentProperties.DOCUMENT_TYPE, projectDelta, projectsToSave);
-
- // if there was a preference key change, need to save preferences
- if (resourceChanges)
- projectsToSave.add(currentProject);
- }
-
- /**
- * Goes through all the resource-dependent preferences associated with
- * currentProject & key and updates the preference keys if needed
- * based on projectDelta
- *
- * @param currentProject
- * current project of the preferences to be looked at
- * @param key
- * current key/subcategory of the preferences to be looked
- * at
- * @param projectDelta
- * the changes to process the preference keys against
- * @param projectsToSave
- * the projects that need to be updated/saved
- * @return true if currentProject's preferences were modified
- */
- private boolean processPreferences(IProject currentProject, String key, IResourceDelta projectDelta, Set projectsToSave) {
- boolean resourceChanges = false;
-
- // get the project-key preference node
- Preferences projectPrefs = HTMLContentProperties.getPreferences(currentProject, key, false);
- if (projectPrefs == null)
- // no preferences for this project-key, just bail
- return false;
- String[] affectedResources;
- try {
- affectedResources = projectPrefs.keys();
- }
- catch (BackingStoreException e) {
- // problems with the project scope... we gonna miss the
- // changes (but will log)
- Logger.log(Logger.WARNING_DEBUG, "Problem retreiving JSP Fragment preferences", e); //$NON-NLS-1$
- return false;
- }
-
- // go through each preference key (which is really a file name)
- for (int i = 0; i < affectedResources.length; i++) {
- // see if preference key/file name was file that was changed
- IResourceDelta memberDelta = projectDelta.findMember(new Path(affectedResources[i]));
- // no changes for the given resource
- if (memberDelta == null)
- continue;
- if (memberDelta.getKind() == IResourceDelta.REMOVED) {
- resourceChanges = true;
- // remove the setting for the original location
- String currentValue = projectPrefs.get(affectedResources[i], null);
- projectPrefs.remove(affectedResources[i]);
- if ((memberDelta.getFlags() & IResourceDelta.MOVED_TO) != 0) {
- // if moving, copy the setting for the new location
- IProject targetProject = ResourcesPlugin.getWorkspace().getRoot().getProject(memberDelta.getMovedToPath().segment(0));
- Preferences targetPrefs = HTMLContentProperties.getPreferences(targetProject, key, true);
- targetPrefs.put(HTMLContentProperties.getKeyFor(memberDelta.getMovedToPath()), currentValue);
- if (targetProject != currentProject)
- projectsToSave.add(targetProject);
- }
- }
- }
- return resourceChanges;
- }
-
- /**
- * For any change to the encoding file or any resource with encoding
- * set, just discard the cache for the corresponding project.
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- if (delta == null)
- return;
- IResourceDelta[] projectDeltas = delta.getAffectedChildren();
- // process each project in the delta
- Set projectsToSave = new HashSet();
- for (int i = 0; i < projectDeltas.length; i++)
- // nothing to do if a project has been added/removed/moved
- if (projectDeltas[i].getKind() == IResourceDelta.CHANGED && (projectDeltas[i].getFlags() & IResourceDelta.OPEN) == 0)
- processEntryChanges(projectDeltas[i], projectsToSave);
- fJob.addChanges(projectsToSave);
- }
- }
-
- public synchronized static void startup() {
- _instance = new HTMLContentPropertiesManager();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(_instance.fResourceChangeListener, IResourceChangeEvent.POST_CHANGE);
- }
-
- public synchronized static void shutdown() {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(_instance.fResourceChangeListener);
- _instance = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
deleted file mode 100644
index 66b6bc2b66..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/AbstractResourceEncodingDetector.java
+++ /dev/null
@@ -1,261 +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.core.internal.contenttype;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-
-public abstract class AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- protected EncodingMemento fEncodingMemento;
-
- protected boolean fHeaderParsed;
-
- protected Reader fReader;
-
- /**
- *
- */
- public AbstractResourceEncodingDetector() {
- super();
- }
-
- /**
- * Note: once this instance is created, trace info still needs to be
- * appended by caller, depending on the context its created.
- */
- private void createEncodingMemento(String detectedCharsetName) {
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
- fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
- // TODO: if detectedCharset and spec default is
- // null, need to use "work
- // bench based" defaults.
- fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
- }
-
- /**
- * convience method all subclasses can use (but not override)
- *
- * @param detectedCharsetName
- * @param reason
- */
- final protected void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- final protected void ensureInputSet() {
- if (fReader == null) {
- throw new IllegalStateException("input must be set before use"); //$NON-NLS-1$
- }
- }
-
- /**
- * This method can return null, if invalid charset name (in which case
- * "appropriateDefault" should be used, if a name is really need for some
- * "save anyway" cases).
- *
- * @param detectedCharsetName
- * @return
- */
- private String getAppropriateJavaCharset(String detectedCharsetName) {
- String result = null;
- // 1. Check explicit mapping overrides from
- // property file -- its here we pick up "rules" for cases
- // that are not even in Java
- result = CodedIO.checkMappingOverrides(detectedCharsetName);
- // 2. Use the "canonical" name from JRE mappings
- // Note: see Charset JavaDoc, the name you get one
- // with can be alias,
- // the name you get back is "standard" name.
- Charset javaCharset = null;
- try {
- javaCharset = Charset.forName(detectedCharsetName);
- }
- catch (UnsupportedCharsetException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- catch (IllegalCharsetNameException e) {
- // only set invalid, if result is same as detected -- they won't
- // be equal if
- // overridden
- if (result != null && result.equals(detectedCharsetName)) {
- fEncodingMemento.setInvalidEncoding(detectedCharsetName);
- }
- }
- // give priority to java cononical name, if present
- if (javaCharset != null) {
- result = javaCharset.name();
- // but still allow overrides
- result = CodedIO.checkMappingOverrides(result);
- }
- return result;
- }
-
- public String getEncoding() throws IOException {
- return getEncodingMemento().getDetectedCharsetName();
- }
-
- // to ensure consist overall rules used, we'll mark as
- // final,
- // and require subclasses to provide certain pieces of
- // the
- // implementation
- public EncodingMemento getEncodingMemento() throws IOException {
- ensureInputSet();
- if (!fHeaderParsed) {
- parseInput();
- // we keep track of if header's already been
- // parse, so can make
- // multiple 'get' calls, without causing
- // reparsing.
- fHeaderParsed = true;
- // Note: there is a "hidden assumption" here
- // that an empty
- // string in content should be treated same as
- // not present.
- }
- if (fEncodingMemento == null) {
- handleSpecDefault();
- }
- if (fEncodingMemento == null) {
- // safty net
- fEncodingMemento = new NullMemento();
- }
- return fEncodingMemento;
- }
-
- /**
- * This is to return a default encoding -- as specified by an industry
- * content type spec -- when not present in the stream, for example, XML
- * specifies UTF-8, JSP specifies ISO-8859-1. This method should return
- * null if there is no such "spec default".
- */
- abstract public String getSpecDefaultEncoding();
-
- public EncodingMemento getSpecDefaultEncodingMemento() {
- resetAll();
- EncodingMemento result = null;
- String enc = getSpecDefaultEncoding();
- if (enc != null) {
- createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT);
- fEncodingMemento.setAppropriateDefault(enc);
- result = fEncodingMemento;
- }
- return result;
- }
-
- private void handleSpecDefault() {
- String encodingName;
- encodingName = getSpecDefaultEncoding();
- if (encodingName != null) {
- // createEncodingMemento(encodingName,
- // EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
- fEncodingMemento = new EncodingMemento();
- fEncodingMemento.setJavaCharsetName(encodingName);
- fEncodingMemento.setAppropriateDefault(encodingName);
- }
- }
-
- /**
- * Every subclass must provide a way to parse the input. This method has
- * several critical responsibilities:
- * <li>set the fEncodingMemento field appropriately, according to the
- * results of the parse of fReader.</li>
- * <li>set fHarderParsed to true, to avoid wasted re-parsing.</li>
- */
- abstract protected void parseInput() throws IOException;
-
- /**
- *
- */
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fEncodingMemento = null;
- }
-
- /**
- *
- */
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossible, since we know ByteReader
- // supports marking
- throw new Error(e);
- }
- }
-
- /**
- *
- */
- public void set(IStorage iStorage) throws CoreException {
- resetAll();
- InputStream inputStream = iStorage.getContents();
- InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- resettableStream.mark(CodedIO.MAX_MARK_SIZE);
- set(resettableStream);
- // TODO we'll need to "remember" IFile, or
- // get its (or its project's) settings, in case
- // those are needed to handle cases when the
- // encoding is not in the file stream.
- }
-
- /**
- * Note: this is not part of interface to help avoid confusion ... it
- * expected this Reader is a well formed character reader ... that is, its
- * all ready been determined to not be a unicode marked input stream. And,
- * its assumed to be in the correct position, at position zero, ready to
- * read first character.
- */
- public void set(Reader reader) {
- resetAll();
- fReader = reader;
- if (!fReader.markSupported()) {
- fReader = new BufferedReader(fReader);
- }
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index bfca51af2a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,109 +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.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-
-/**
- * This is an "adapter" class, simply to get in input stream to act like a
- * reader. We could not use InputStreamReader directly because its internal
- * buffers are not controllable, and it sometimes pulls too much out of input
- * stream (even when it wasn't needed for our purposes).
- *
- * The use of this class is highly specialized and by not means meant to be
- * general purpose. Its use is restricted to those cases where the input
- * stream can be regarded as ascii just long enough to determine what the real
- * encoding should be.
- */
-
-public class ByteReader extends Reader {
-
-
- public static final int DEFAULT_BUFFER_SIZE = CodedIO.MAX_BUF_SIZE;
-
- protected byte[] fBuffer;
-
- protected InputStream fInputStream;
-
- protected ByteReader() {
- super();
- }
-
- public ByteReader(InputStream inputStream) {
- this(inputStream, DEFAULT_BUFFER_SIZE);
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- }
-
- public ByteReader(InputStream inputStream, int size) {
- this.fInputStream = inputStream;
- if (!inputStream.markSupported()) {
- throw new IllegalArgumentException("ByteReader is required to have a resettable stream"); //$NON-NLS-1$
- }
- this.fBuffer = new byte[size];
-
- }
-
- public void close() throws IOException {
- this.fInputStream.close();
- }
-
- public void mark(int readAheadLimit) {
- this.fInputStream.mark(readAheadLimit);
- }
-
- public boolean markSupported() {
- return true;
- }
-
- public int read() throws IOException {
- int b0 = this.fInputStream.read();
- return (b0 & 0x00FF);
- }
-
- public int read(char ch[], int offset, int length) throws IOException {
- if (length > this.fBuffer.length) {
- length = this.fBuffer.length;
- }
-
- int count = this.fInputStream.read(this.fBuffer, 0, length);
-
- for (int i = 0; i < count; i++) {
- int b0 = this.fBuffer[i];
- // the 0x00FF is to "lose" the negative bits filled in the byte to
- // int conversion
- // (and which would be there if cast directly from byte to char).
- char c0 = (char) (b0 & 0x00FF);
- ch[offset + i] = c0;
- }
- return count;
- }
-
- public boolean ready() throws IOException {
- return this.fInputStream.available() > 0;
- }
-
- public void reset() throws IOException {
- this.fInputStream.reset();
- }
-
- public long skip(long n) throws IOException {
- return this.fInputStream.skip(n);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.java
deleted file mode 100644
index 376d2f8793..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/ContentDescriberForHTML.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.html.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescriber;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IContentDescriptionExtended;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-
-/**
- *
- * ContentDescriberForHTML
- *
- * A few design principles to remember with content describers:
- * <ul>
- * <li>Remember not to store values/data in the descriptions array of properties,
- * especially not large objects! and even no value that is already the default value,
- * since those description properties are cached per session, so can add up in memory.
- * <li>Remember that a ContentDescriber instance becomes a "root object" in the
- * ContentDescriberManager (that is, always in memory, never GC'd), so it should
- * not have any instance or state data since it would always become stale and
- * "hold on" to objects unneccessarily.
- * </ul>
- */
-
-public final class ContentDescriberForHTML implements ITextContentDescriber {
-
- final private static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK, IContentDescriptionExtended.DETECTED_CHARSET, IContentDescriptionExtended.UNSUPPORTED_CHARSET, IContentDescriptionExtended.APPROPRIATE_DEFAULT};
-
- public int describe(InputStream contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.INDETERMINATE;
-
- if (description == null) {
- result = computeValidity(contents);
- }
- else {
- calculateSupportedOptions(contents, description);
- // assummming we should return same 'validity' value we did
- // when called before. (technically, could be a performance issue
- // in future, so might want to check if any 'ol value would
- // be ok here.
- result = computeValidity(contents);
- }
-
- return result;
- }
-
- public int describe(Reader contents, IContentDescription description) throws IOException {
- int result = IContentDescriber.INDETERMINATE;
-
- if (description == null) {
- result = computeValidity(contents);
- }
- else {
- calculateSupportedOptions(contents, description);
- // assummming we should return same 'validity' value we did
- // when called before. (technically, could be a performance issue
- // in future, so might want to check if hard coded 'valid' would
- // be ok here.
- result = computeValidity(contents);
- }
-
- return result;
- }
-
- public QualifiedName[] getSupportedOptions() {
-
- return SUPPORTED_OPTIONS;
- }
-
- private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- /**
- * @param contents
- * @param description
- * @throws IOException
- */
- private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException {
- if (isRelevent(description)) {
- IResourceCharsetDetector detector = getDetector();
- detector.set(contents);
- handleCalculations(description, detector);
- }
- }
-
- private int computeValidity(InputStream inputStream) {
- // currently no contents specific check for valid HTML contents
- // (this may change once we add XHTML content type)
- return IContentDescriber.INDETERMINATE;
- }
-
- private int computeValidity(Reader reader) {
- // currently no contents specific check for valid HTML contents
- // (this may change once we add XHTML content type)
- return IContentDescriber.INDETERMINATE;
- }
-
- private IResourceCharsetDetector getDetector() {
-
- return new HTMLResourceEncodingDetector();
-
- }
-
- /**
- * @param description
- * @param detector
- * @throws IOException
- */
- private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
-
- EncodingMemento encodingMemento = ((HTMLResourceEncodingDetector) detector).getEncodingMemento();
- // TODO: I need to verify to see if this BOM work is always done
- // by text type.
- Object detectedByteOrderMark = encodingMemento.getUnicodeBOM();
- if (detectedByteOrderMark != null) {
- Object existingByteOrderMark = description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- // not sure why would ever be different, so if is different, may
- // need to "push" up into base.
- if (!detectedByteOrderMark.equals(existingByteOrderMark))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, detectedByteOrderMark);
- }
-
-
- if (!encodingMemento.isValid()) {
- /*
- * note: after setting here, its the mere presence of
- * IContentDescriptionExtended.UNSUPPORTED_CHARSET in the
- * resource's description that can be used to determine if invalid
- * in those cases, the "detected" property contains an
- * "appropriate default" to use.
- */
- description.setProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET, encodingMemento.getInvalidEncoding());
- description.setProperty(IContentDescriptionExtended.APPROPRIATE_DEFAULT, encodingMemento.getAppropriateDefault());
- }
-
- Object detectedCharset = encodingMemento.getDetectedCharsetName();
- Object javaCharset = encodingMemento.getJavaCharsetName();
-
- // we always include detected, if its different than java
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-
- if (javaCharset != null) {
- Object existingCharset = description.getProperty(IContentDescription.CHARSET);
- if (javaCharset.equals(existingCharset)) {
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
- }
- else {
- // we may need to add what we found, but only need to add
- // if different from default.the
- Object defaultCharset = detector.getSpecDefaultEncoding();
- if (defaultCharset != null) {
- if (!defaultCharset.equals(javaCharset)) {
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- else {
- // assuming if there is no spec default, we always need to
- // add, I'm assuming
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- }
-
- }
-
- private void handleDetectedSpecialCase(IContentDescription description, Object detectedCharset, Object javaCharset) {
- // since equal, we don't need to add, but if our detected version is
- // different than
- // javaCharset, then we should add it. This will happen, for example,
- // if there's
- // differences in case, or differences due to override properties
- if (detectedCharset != null) {
- // if (!detectedCharset.equals(javaCharset)) {
- // description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET,
- // detectedCharset);
- // }
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- // else if
- // (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
- // result = true;
- return result;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
deleted file mode 100644
index be7f3a05eb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/EncodingGuesser.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-/**
- *
- * This is ported from PageDesigner's hpbcom/Kanji.cpp's
- * Kanji::guess_kanji_code(),
- *
- */
-public class EncodingGuesser {
- private static final int ASCII = 0; // ASCII
- // ISO-2022-JP
- private static final int ASCII_IN = 8; // This is after ISO2022's change
- // Shift-JIS
- private static final int EUC_HALFKANA = 6; // This is Half Kana in EUC-JP
- private static final int EUC_JP = 3; // This is EUC-JP
- private static final int ISO2022_JP = 4; // This is ISO-2022-JP
- private static final int JIS_HALFKANA = 7; // THis is Half Kana in
- private static final byte KT_EUC1 = 0x40;
- private static final byte KT_EUC2 = (byte) 0x80;
- // ASCII
- private static final byte KT_JIN = 0x01;
- private static final byte KT_JOUT = 0x02;
- // private static final byte KT_ESC = 0x04;
- // private static final byte KT_JIS = 0x08;
- private static final byte KT_SFT1 = 0x10;
- private static final byte KT_SFT2 = 0x20;
- private static final byte ktype[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, /* !"#$%&' *//* " */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* ()*+,-./ */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 01234567 */
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, /* 89:; <=>? */
- 0x29, 0x28, 0x2b, 0x28, 0x28, 0x28, 0x28, 0x28, /* @ABCDEFG */
- 0x2a, 0x28, 0x2a, 0x28, 0x28, 0x28, 0x28, 0x28, /* HIJKLMNO */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* PQRSTUVW */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* XYZ[\]^_ */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* abcdefg */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* hijklmno */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, /* pqrstuvw */
- 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00, /* xyz{|}~ */
- 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 80 */
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, /* 90 */
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* A0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* B0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* C0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, /* D0 */
- (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xe0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* E0 */
- (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, /* F0 */
- (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xf0, (byte) 0xc0, (byte) 0xc0, 0x00,};
- // private static final int ISO8859_1 = 1; // ISO-1
- private static final int SHIFT_JIS = 2; // This is Shift-JIS
- private static final int SJIS_HALFKANA = 5; // This is Half Kana in
-
- /**
- * Currently, only Japanese encodings are supported.
- */
- private static final int UNKNOWN = -1; // Unknown
-
- /**
- * @return java.lang.String
- * @param code
- * int
- *
- * Convert private int to IANA Encoding name.
- */
- private static String convertToIANAEncodingName(int code) {
- String encoding = null;
-
- switch (code) {
- case SHIFT_JIS :
- case SJIS_HALFKANA :
- encoding = "Shift_JIS";//$NON-NLS-1$
- break;
- case EUC_JP :
- case EUC_HALFKANA :
- encoding = "EUC-JP";//$NON-NLS-1$
- break;
- case ISO2022_JP :
- case JIS_HALFKANA :
- encoding = "ISO-2022-JP";//$NON-NLS-1$
- default :
- break;
- }
-
- return encoding;
- }
-
- /**
- * Return guessed Java Encoding name target: bytes to be inspected length:
- * length of target
- */
- public static String guessEncoding(byte[] target, int length) {
- int code = UNKNOWN;
-
- // Currently, only Japanese is supported.
- String system_ctype = java.util.Locale.getDefault().getLanguage();
- String jp_ctype = java.util.Locale.JAPANESE.getLanguage();
- if (system_ctype.compareTo(jp_ctype) == 0) {
- // Ok, I'm under ja_JP.
- code = ASCII;
- int pos = 0;
- while ((code == ASCII) && (length > 0)) {
- int ch1 = target[pos];
- ch1 = ch1 & 0x000000FF;
- int ch2 = (length >= 2) ? target[pos + 1] : 0;
- ch2 = ch2 & 0x000000FF;
- int ch3 = (length >= 3) ? target[pos + 2] : 0;
- ch3 = ch3 & 0x000000FF;
- code = guessJapaneseKanjiCode(ch1, ch2, ch3, 0);
- pos++;
- length--;
- }
- switch (code) {
- case ISO2022_JP :
- case JIS_HALFKANA :
- code = ISO2022_JP;
- break;
- case EUC_JP :
- code = EUC_JP;
- break;
- default :
- code = SHIFT_JIS;
- }
- }
- return (convertToIANAEncodingName(code));
- }
-
- /**
- * Guess the encoding. halfkana_flag = 0x01 ( detect SJIS half kana )
- * halfkana_flag = 0x02 ( detect EUC half kana )
- */
- private static int guessJapaneseKanjiCode(int ch1, int ch2, int ch3, int halfkana_flag) {
- boolean sjis_hankaku_flag = ((halfkana_flag & 0x01) != 0) ? true : false;
- boolean euc_hankaku_flag = ((halfkana_flag & 0x02) != 0) ? true : false;
-
- if (ch1 == 0)
- return UNKNOWN;
- if (sjis_hankaku_flag && ch1 >= 0xa1 && ch1 <= 0xdf)
- return SJIS_HALFKANA;
- else if (euc_hankaku_flag && ch1 == 0x8e && ch2 >= 0xa1 && ch2 <= 0xdf)
- return EUC_HALFKANA;
- else if (((ktype[ch1] & KT_SFT1) != 0) && ((ktype[ch2] & KT_SFT2) != 0))
- return SHIFT_JIS;
- else if (((ktype[ch1] & KT_EUC1) != 0) && ((ktype[ch2] & KT_EUC2) != 0))
- return EUC_JP;
- else if (ch1 == 0x1b && ((ktype[ch2] & KT_JIN) != 0))
- return ISO2022_JP;
- else if (ch1 >= 0xa1 && ch1 <= 0xdf)
- return SJIS_HALFKANA;
- else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ch3 == 0x49/* 'I' */)
- return JIS_HALFKANA;
- else if (ch1 == 0x1b && ch2 == 0x28/* '(' */&& ((ktype[ch3] & KT_JOUT) != 0))
- return ASCII_IN;
-
- return ASCII;
- }
-
- public EncodingGuesser() {
- super();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
deleted file mode 100644
index dc68f674ca..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizer.java
+++ /dev/null
@@ -1,1690 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/* The following code was generated by JFlex 1.2.2 on 1/27/04 6:41 PM */
-
-/*nlsXXX*/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-import org.eclipse.wst.xml.core.internal.contenttype.XMLHeadTokenizerConstants;
-
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.informatik.tu-muenchen.de/~kleing/jflex/">JFlex</a> 1.2.2
- * on 1/27/04 6:41 PM from the specification file
- * <tt>file:/D:/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jflex</tt>
- */
-public class HTMLHeadTokenizer {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int ST_META_TAG = 4;
- 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;
-
- /**
- * 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\22\1\0\1\40\2\0" + "\1\44\1\0\1\43\5\0\1\34\1\0\1\42\13\0\1\45\1\12" + "\1\10\1\31\1\13\1\0\1\21\1\0\1\24\1\26\1\17\1\0" + "\1\30\1\32\1\27\2\0\1\16\1\15\1\23\1\25\1\33\1\35" + "\2\0\1\20\1\36\1\37\1\0\1\14\1\41\7\0\1\21\1\0" + "\1\24\1\26\1\17\1\0\1\30\1\32\1\27\2\0\1\16\1\15" + "\1\23\1\25\1\33\1\35\2\0\1\20\1\36\1\37\1\0\1\14" + "\1\41\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;
-
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
-
-
- private boolean hasMore = true;
- private final static int MAX_TO_SCAN = 8000;
- 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;
-
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning
- * of a line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- // its a little wasteful to "throw away" first char array generated
- // by class init (via auto generated code), but we really do want
- // a small buffer for our head parsers.
- if (yy_buffer.length != MAX_TO_SCAN) {
- yy_buffer = new char[MAX_TO_SCAN];
- }
-
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- }
- else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
-
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
-
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public HTMLHeadTokenizer(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 HTMLHeadTokenizer(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 < 174) {
- 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 :
- case 18 :
- 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 15 :
- 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 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 17;
- break yy_forNext;
- case 26 :
- yy_isFinal = true;
- yy_state = 18;
- break yy_forNext;
- case 34 :
- yy_isFinal = true;
- yy_state = 19;
- 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 :
- case 18 :
- yy_isFinal = true;
- yy_state = 21;
- break yy_forNext;
- case 7 :
- yy_isFinal = true;
- yy_state = 22;
- break yy_forNext;
- case 32 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 23;
- break yy_forNext;
- case 35 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 24;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 20;
- break yy_forNext;
- }
-
- case 5 :
- switch (yy_input) {
- case 7 :
- case 9 :
- case 10 :
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 26;
- break yy_forNext;
- case 11 :
- case 34 :
- yy_isFinal = true;
- yy_state = 27;
- break yy_forNext;
- case 32 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 28;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 25;
- break yy_forNext;
- }
-
- case 6 :
- switch (yy_input) {
- case 7 :
- case 9 :
- case 10 :
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 26;
- break yy_forNext;
- case 34 :
- yy_isFinal = true;
- yy_state = 27;
- break yy_forNext;
- case 35 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 28;
- break yy_forNext;
- case 36 :
- yy_isFinal = true;
- yy_state = 29;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 25;
- break yy_forNext;
- }
-
- case 7 :
- switch (yy_input) {
- case 10 :
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 26;
- break yy_forNext;
- case 34 :
- yy_isFinal = true;
- yy_state = 27;
- break yy_forNext;
- case 11 :
- yy_isFinal = true;
- yy_state = 29;
- break yy_forNext;
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 30;
- break yy_forNext;
- case 32 :
- case 35 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 31;
- break yy_forNext;
- case 37 :
- yy_isFinal = true;
- yy_state = 32;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 25;
- 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 13 :
- yy_state = 36;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 13 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 37;
- break yy_forNext;
- case 10 :
- yy_state = 38;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 14 :
- switch (yy_input) {
- case 13 :
- yy_state = 36;
- break yy_forNext;
- case 11 :
- yy_state = 39;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 15 :
- switch (yy_input) {
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 40;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 16 :
- switch (yy_input) {
- case 19 :
- yy_state = 41;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 18 :
- switch (yy_input) {
- case 16 :
- yy_state = 42;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 19 :
- switch (yy_input) {
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 43;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 21 :
- switch (yy_input) {
- case 6 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 21;
- break yy_forNext;
- case 7 :
- yy_state = 44;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 20;
- break yy_forNext;
- }
-
- case 22 :
- switch (yy_input) {
- case 6 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 21;
- break yy_forNext;
- case 7 :
- yy_state = 44;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 20;
- break yy_forNext;
- }
-
- case 27 :
- switch (yy_input) {
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 45;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 29 :
- switch (yy_input) {
- case 25 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 46;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 32 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 32;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 35 :
- switch (yy_input) {
- case 5 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 47;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 36 :
- switch (yy_input) {
- case 15 :
- yy_state = 48;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 37 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 37;
- break yy_forNext;
- case 10 :
- yy_state = 38;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 38 :
- switch (yy_input) {
- case 11 :
- yy_state = 39;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 39 :
- switch (yy_input) {
- case 12 :
- yy_state = 49;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 41 :
- switch (yy_input) {
- case 20 :
- yy_state = 50;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 42 :
- switch (yy_input) {
- case 16 :
- yy_state = 51;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 44 :
- switch (yy_input) {
- case 6 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 21;
- break yy_forNext;
- case 7 :
- yy_state = 44;
- break yy_forNext;
- default :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 20;
- break yy_forNext;
- }
-
- case 48 :
- switch (yy_input) {
- case 16 :
- yy_state = 52;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 49 :
- switch (yy_input) {
- case 13 :
- yy_state = 53;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 50 :
- switch (yy_input) {
- case 21 :
- yy_state = 54;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 51 :
- switch (yy_input) {
- case 27 :
- yy_state = 55;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 52 :
- switch (yy_input) {
- case 17 :
- yy_state = 56;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 53 :
- switch (yy_input) {
- case 14 :
- yy_state = 57;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 54 :
- switch (yy_input) {
- case 22 :
- yy_state = 58;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 55 :
- switch (yy_input) {
- case 28 :
- yy_state = 59;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 56 :
- switch (yy_input) {
- case 18 :
- yy_isFinal = true;
- yy_noLookAhead = true;
- yy_state = 60;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 57 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 61;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 58 :
- switch (yy_input) {
- case 23 :
- yy_state = 62;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 59 :
- switch (yy_input) {
- case 15 :
- yy_state = 63;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 61 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 61;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 62 :
- switch (yy_input) {
- case 19 :
- yy_state = 64;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 63 :
- switch (yy_input) {
- case 29 :
- yy_state = 65;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 64 :
- switch (yy_input) {
- case 24 :
- yy_state = 66;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 65 :
- switch (yy_input) {
- case 30 :
- yy_state = 67;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 66 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 66;
- break yy_forNext;
- case 8 :
- yy_isFinal = true;
- yy_state = 68;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 67 :
- switch (yy_input) {
- case 23 :
- yy_state = 69;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 68 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 68;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 69 :
- switch (yy_input) {
- case 31 :
- yy_state = 70;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 70 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 70;
- break yy_forNext;
- case 8 :
- yy_state = 71;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 71 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 71;
- break yy_forNext;
- case 20 :
- yy_state = 72;
- break yy_forNext;
- case 32 :
- yy_state = 73;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 72 :
- switch (yy_input) {
- case 21 :
- yy_state = 74;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 73 :
- switch (yy_input) {
- case 20 :
- yy_state = 72;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 74 :
- switch (yy_input) {
- case 19 :
- yy_state = 75;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 75 :
- switch (yy_input) {
- case 16 :
- yy_state = 76;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 76 :
- switch (yy_input) {
- case 15 :
- yy_state = 77;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 77 :
- switch (yy_input) {
- case 19 :
- yy_state = 78;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 78 :
- switch (yy_input) {
- case 16 :
- yy_state = 79;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 79 :
- switch (yy_input) {
- case 28 :
- yy_state = 80;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 80 :
- switch (yy_input) {
- case 16 :
- yy_state = 81;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 81 :
- switch (yy_input) {
- case 33 :
- yy_state = 82;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 82 :
- switch (yy_input) {
- case 27 :
- yy_state = 83;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 83 :
- switch (yy_input) {
- case 15 :
- yy_state = 84;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 84 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 85;
- break yy_forNext;
- case 32 :
- yy_state = 86;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 85 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 85;
- break yy_forNext;
- case 20 :
- yy_state = 87;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 86 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 85;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 87 :
- switch (yy_input) {
- case 21 :
- yy_state = 88;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 88 :
- switch (yy_input) {
- case 19 :
- yy_state = 89;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 89 :
- switch (yy_input) {
- case 16 :
- yy_state = 90;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 90 :
- switch (yy_input) {
- case 15 :
- yy_state = 91;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 91 :
- switch (yy_input) {
- case 19 :
- yy_state = 92;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 92 :
- switch (yy_input) {
- case 16 :
- yy_state = 93;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 93 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_state = 93;
- break yy_forNext;
- case 8 :
- yy_isFinal = true;
- yy_state = 94;
- break yy_forNext;
- default :
- break yy_forAction;
- }
-
- case 94 :
- switch (yy_input) {
- case 6 :
- case 7 :
- case 9 :
- case 18 :
- yy_isFinal = true;
- yy_state = 94;
- 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 26 :
- {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 96 :
- break;
- case 20 :
- case 21 :
- {
- yypushback(1);
- yybegin(UnDelimitedString);
- string.setLength(0);
- }
- case 97 :
- break;
- case 17 :
- {
- yybegin(YYINITIAL);
- if (foundContentTypeValue)
- hasMore = false;
- return HTMLHeadTokenizerConstants.MetaTagEnd;
- }
- case 98 :
- break;
- case 31 :
- {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue;
- }
- case 99 :
- break;
- case 43 :
- {
- yybegin(YYINITIAL);
- if (foundContentTypeValue)
- hasMore = false;
- return HTMLHeadTokenizerConstants.MetaTagEnd;
- }
- case 100 :
- break;
- case 45 :
- {
- yypushback(2);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 101 :
- break;
- case 46 :
- {
- yypushback(2);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.InvalidTerminatedStringValue;
- }
- case 102 :
- break;
- case 61 :
- {
- if (yychar == 0) {
- yybegin(ST_XMLDecl);
- return XMLHeadTokenizerConstants.XMLDeclStart;
- }
- }
- case 103 :
- break;
- case 8 :
- case 9 :
- case 10 :
- case 11 :
- case 12 :
- case 13 :
- case 14 :
- case 15 :
- case 16 :
- case 18 :
- case 19 :
- case 22 :
- {
- if (yychar > MAX_TO_SCAN) {
- hasMore = false;
- return EncodingParserConstants.MAX_CHARS_REACHED;
- }
- }
- case 104 :
- break;
- case 60 :
- {
- yybegin(ST_META_TAG);
- return HTMLHeadTokenizerConstants.MetaTagStart;
- }
- case 105 :
- break;
- case 40 :
- {
- yybegin(YYINITIAL);
- return XMLHeadTokenizerConstants.XMLDeclEnd;
- }
- case 106 :
- break;
- case 94 :
- {
- pushCurrentState();
- yybegin(QuotedAttributeValue);
- foundContentTypeValue = true;
- return HTMLHeadTokenizerConstants.MetaTagContentType;
- }
- case 107 :
- break;
- case 68 :
- {
- pushCurrentState();
- yybegin(QuotedAttributeValue);
- return XMLHeadTokenizerConstants.XMLDelEncoding;
- }
- case 108 :
- break;
- case 33 :
- {
- hasMore = false;
- return EncodingParserConstants.UTF16BE;
- }
- case 109 :
- break;
- case 34 :
- {
- hasMore = false;
- return EncodingParserConstants.UTF16LE;
- }
- case 110 :
- break;
- case 47 :
- {
- hasMore = false;
- return EncodingParserConstants.UTF83ByteBOM;
- }
- case 111 :
- break;
- case 28 :
- {
- popState();
- valueText = string.toString();
- return EncodingParserConstants.StringValue;
- }
- case 112 :
- break;
- case 25 :
- case 27 :
- case 29 :
- case 32 :
- {
- string.append(yytext());
- }
- case 113 :
- break;
- case 24 :
- {
- yybegin(SQ_STRING);
- string.setLength(0);
- }
- case 114 :
- break;
- case 23 :
- {
- yybegin(DQ_STRING);
- string.setLength(0);
- }
- case 115 :
- break;
- case 30 :
- {
- yypushback(1);
- popState();
- valueText = string.toString();
- return EncodingParserConstants.UnDelimitedStringValue;
- }
- case 116 :
- 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++) {
- HTMLHeadTokenizer scanner = null;
- try {
- scanner = new HTMLHeadTokenizer(new java.io.FileReader(argv[i]));
- }
- catch (java.io.FileNotFoundException e) {
- System.out.println("File not found : \"" + argv[i] + "\"");
- System.exit(1);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java HTMLHeadTokenizer <inputfile>");
- System.exit(1);
- }
-
- try {
- do {
- System.out.println(scanner.primGetNextToken());
- }
- while (!scanner.yy_atEOF);
-
- }
- catch (java.io.IOException e) {
- System.out.println("An I/O error occured while scanning :");
- System.out.println(e);
- System.exit(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
deleted file mode 100644
index 938bcde421..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLHeadTokenizerConstants.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-
-public interface HTMLHeadTokenizerConstants {
-
- String MetaTagEnd = "MetaTagEnd"; //$NON-NLS-1$
- String MetaTagStart = "MetaTagStart"; //$NON-NLS-1$
- String MetaTagContentType = "MetaTagContentType"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
deleted file mode 100644
index bff22197a9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HTMLResourceEncodingDetector.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.contenttype;
-
-import java.io.IOException;
-import java.util.regex.Pattern;
-
-import org.eclipse.wst.sse.core.internal.encoding.CodedIO;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.IResourceCharsetDetector;
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-
-public class HTMLResourceEncodingDetector extends AbstractResourceEncodingDetector implements IResourceCharsetDetector {
-
- private HTMLHeadTokenizer fTokenizer;
-
- /**
- * There is no spec defined encoding for HTML (historically), so null is
- * returned.
- */
- public String getSpecDefaultEncoding() {
- return null;
- }
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicodeStream = false;
- if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-8"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUTF83ByteBOMUsed(true);
- }
- else if (tokenType == EncodingParserConstants.UTF16BE) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-16BE"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- }
- else if (tokenType == EncodingParserConstants.UTF16LE) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-16"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- }
- return canHandleAsUnicodeStream;
- }
-
- /**
- * @return Returns the tokenizer.
- */
- private HTMLHeadTokenizer getTokenizer() {
- // TODO: need to work on 'reset' in tokenizer, so new instance isn't
- // always needed
- //if (fTokenizer == null) {
- fTokenizer = new HTMLHeadTokenizer();
- // }
- return fTokenizer;
- }
-
- private boolean isLegalString(String valueTokenType) {
- if (valueTokenType == null)
- return false;
- else
- return valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
- }
-
- protected void parseInput() throws IOException {
- checkInContent();
- if (fEncodingMemento == null) {
- checkHeuristics();
- }
- }
-
- /**
- *
- */
- private void checkHeuristics() throws IOException {
- boolean noHeuristic = false;
- String heuristicEncoding = null;
- try {
- fReader.reset();
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- byte[] bytes = new byte[CodedIO.MAX_MARK_SIZE];
- int nRead = 0;
- for (int i = 0; i < bytes.length; i++) {
- if (fReader.ready()) {
- int oneByte = fReader.read();
- nRead++;
- if (oneByte <= 0xFF) {
- bytes[i] = (byte) oneByte;
- }
- else {
- noHeuristic = true;
- break;
- }
- }
- else {
- break;
- }
- }
- if (!noHeuristic) {
- heuristicEncoding = EncodingGuesser.guessEncoding(bytes, nRead);
- }
- }
- catch (IOException e) {
- // if any IO exception, then not a heuristic case
- }
- finally {
- fReader.reset();
- }
- if (heuristicEncoding != null) {
- createEncodingMemento(heuristicEncoding, EncodingMemento.GUESSED_ENCODING_FROM_STREAM);
- }
-
- }
-
- private void checkInContent() throws IOException {
- HTMLHeadTokenizer tokenizer = getTokenizer();
- tokenizer.reset(fReader);
- HeadParserToken token = null;
- String tokenType = null;
- String contentTypeValue = null;
- do {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (canHandleAsUnicodeStream(tokenType)) {
- // side effect of canHandle is to create appropriate
- // memento
- }
- else if (tokenType == HTMLHeadTokenizerConstants.MetaTagContentType) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- contentTypeValue = valueToken.getText();
-
- }
- }
- }
-
- }
- while (tokenizer.hasMoreTokens());
- if (contentTypeValue != null) {
- parseContentTypeValue(contentTypeValue);
- }
- }
-
- private void parseContentTypeValue(String contentType) {
- String charset = null;
- 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()) {
- charset = parts[0].substring(eqpos);
- charset = charset.trim();
- }
- }
- }
- }
- else {
- //fContentType = parts[0];
- }
- }
- if (parts.length > 1) {
- charset = parts[1];
- }
-
- if (charset != null && charset.length() > 0) {
- createEncodingMemento(charset, EncodingMemento.FOUND_ENCODING_IN_CONTENT);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index ffd0406733..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/HeadParserToken.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-public class HeadParserToken {
- private int fStart;
-
- private String fText;
- private String fType;
-
- protected HeadParserToken() {
- super();
- }
-
- public HeadParserToken(String type, int start, String text) {
- this();
- fType = type;
- fStart = start;
- fText = text;
-
- }
-
- public String getText() {
- return fText;
- }
-
- public String getType() {
- return fType;
- }
-
- public String toString() {
- return ("text: " + fText + " offset: " + fStart + " type: " + fType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
deleted file mode 100644
index 5006745bf3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.contenttype;
-
-/*
- *
- * A non-resizable class implementing the behavior of java.util.Stack, but
- * directly for the <code> integer </code> primitive.
- */
-import java.util.EmptyStackException;
-
-public class IntStack {
- private int[] list = null;
-
- private int size = 0;
-
- public IntStack() {
- this(100);
- }
-
- public IntStack(int maxdepth) {
- super();
- list = new int[maxdepth];
- initialize();
- }
-
- public void clear() {
- initialize();
- }
-
- public boolean empty() {
- return size == 0;
- }
-
- public int get(int slot) {
- return list[slot];
- }
-
- private void initialize() {
- for (int i = 0; i < list.length; i++)
- list[i] = -1;
- }
-
- /**
- * Returns the int at the top of the stack without removing it
- *
- * @return int at the top of this stack.
- * @exception EmptyStackException
- * when empty.
- */
- public int peek() {
- if (size == 0)
- throw new EmptyStackException();
- return list[size - 1];
- }
-
- /**
- * Removes and returns the int at the top of the stack
- *
- * @return int at the top of this stack.
- * @exception EmptyStackException
- * when empty.
- */
- public int pop() {
- int value = peek();
- list[size - 1] = -1;
- size--;
- return value;
- }
-
- /**
- * Pushes an item onto the top of this stack.
- *
- * @param newValue -
- * the int to be pushed onto this stack.
- * @return the <code>newValue</code> argument.
- */
- public int push(int newValue) {
- if (size == list.length) {
- throw new StackOverflowError();
- }
- list[size++] = newValue;
- return newValue;
- }
-
- public int size() {
- return list.length;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java
deleted file mode 100644
index 5e22af0a61..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contenttype/NullMemento.java
+++ /dev/null
@@ -1,37 +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.core.internal.contenttype;
-
-import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento;
-import org.eclipse.wst.sse.core.internal.encoding.NonContentBasedEncodingRules;
-
-
-
-/**
- * This class can be used in place of an EncodingMemento (its super class),
- * when there is not in fact ANY encoding information. For example, when a
- * structuredDocument is created directly from a String
- */
-public class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java
deleted file mode 100644
index 7dbc200de0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DOMStyleModelImpl.java
+++ /dev/null
@@ -1,67 +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
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
-import org.w3c.dom.Document;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DOMStyleModelImpl extends DOMModelImpl {
- public DOMStyleModelImpl() {
- // remember, the document is created in super constructor,
- // via internalCreateDocument
- super();
- }
-
- public void releaseFromEdit() {
- releaseStyleSheets();
- super.releaseFromEdit();
- }
-
- /**
- */
- public void releaseFromRead() {
- releaseStyleSheets();
- super.releaseFromRead();
- }
-
- private void releaseStyleSheets() {
- if (!isShared()) {
- Document doc = getDocument();
- if (doc instanceof DocumentStyleImpl) {
- ((DocumentStyleImpl) doc).releaseStyleSheets();
- }
- }
- }
-
- /**
- * createDocument method
- * @return org.w3c.dom.Document
- */
- protected Document internalCreateDocument() {
- DocumentStyleImpl document = new DocumentStyleImpl();
- document.setModel(this);
- return document;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
deleted file mode 100644
index ff46210422..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/DocumentStyleImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.DocumentCSS;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- * @author davidw
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DocumentStyleImpl extends DocumentImpl implements IDOMDocument, DocumentCSS {
- public DocumentStyleImpl() {
- super();
- }
-
- protected DocumentStyleImpl(DocumentImpl that) {
- super(that);
- }
-
- public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName) {
- INodeAdapter adapter = getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter == null)
- return null;
- return ((IStyleSheetListAdapter) adapter).getOverrideStyle(element, pseudoName);
- }
-
- public StyleSheetList getStyleSheets() {
- INodeAdapter adapter = getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter == null)
- return null;
- return ((IStyleSheetListAdapter) adapter).getStyleSheets();
- }
-
- protected void releaseStyleSheets() {
- INodeAdapter adapter = getExistingAdapter(IStyleSheetListAdapter.class);
- if (adapter == null)
- return;
- ((IStyleSheetListAdapter) adapter).releaseStyleSheets();
- }
-
- /**
- * createElement method
- * @return org.w3c.dom.Element
- * @param tagName java.lang.String
- */
- public Element createElement(String tagName) throws DOMException {
- checkTagNameValidity(tagName);
-
- ElementStyleImpl element = new ElementStyleImpl();
- element.setOwnerDocument(this);
- element.setTagName(tagName);
- return element;
- }
-
- /**
- * cloneNode method
- * @return org.w3c.dom.Node
- * @param deep boolean
- */
- public Node cloneNode(boolean deep) {
- DocumentStyleImpl cloned = new DocumentStyleImpl(this);
- if (deep)
- cloned.importChildNodes(this, true);
- return cloned;
- }
-
- protected void setModel(IDOMModel model) {
- super.setModel(model);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java
deleted file mode 100644
index 943218bcac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/ElementStyleImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * Created on Sep 2, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.html.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-import org.w3c.dom.stylesheets.LinkStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-public class ElementStyleImpl extends ElementImpl implements IDOMElement, ElementCSSInlineStyle, LinkStyle {
- public ElementStyleImpl() {
- super();
- }
-
- public ElementStyleImpl(ElementImpl that) {
- super(that);
- }
-
- public StyleSheet getSheet() {
- INodeAdapter adapter = getAdapterFor(IStyleSheetAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleSheetAdapter))
- return null;
- return ((IStyleSheetAdapter) adapter).getSheet();
- }
-
- public CSSStyleDeclaration getStyle() {
- INodeAdapter adapter = getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleDeclarationAdapter))
- return null;
- return ((IStyleDeclarationAdapter) adapter).getStyle();
- }
-
- protected void setOwnerDocument(Document ownerDocument) {
- super.setOwnerDocument(ownerDocument);
- }
-
- protected void setTagName(String tagName) {
- super.setTagName(tagName);
- }
-
- public Node cloneNode(boolean deep) {
- ElementImpl cloned = new ElementStyleImpl(this);
- if (deep)
- cloneChildNodes(cloned, deep);
- return cloned;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
deleted file mode 100644
index 207c2fddc6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLConverter.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.document;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-
-/**
- */
-public class HTMLConverter {
-
- /**
- */
- public HTMLConverter() {
- super();
-
- }
-
- public void cleanupModel(IDOMModel model) {
- if (model == null)
- return;
-
- HTMLCleanupProcessorImpl processor = new HTMLCleanupProcessorImpl();
- IStructuredCleanupPreferences pref = processor.getCleanupPreferences();
-
- // backup options
- boolean compressEmptyElementTags = pref.getCompressEmptyElementTags();
- boolean insertRequiredAttrs = pref.getInsertRequiredAttrs();
- boolean insertMissingTags = pref.getInsertMissingTags();
- boolean quoteAttrValues = pref.getQuoteAttrValues();
- boolean formatSource = pref.getFormatSource();
- int tagNameCase = pref.getTagNameCase();
- int attrNameCase = pref.getAttrNameCase();
-
- // setup options
- pref.setCompressEmptyElementTags(true);
- pref.setInsertRequiredAttrs(true);
- pref.setInsertMissingTags(true);
- pref.setQuoteAttrValues(true);
- pref.setFormatSource(false);
- if (model.getDocument().isXMLType()) { // XHTML
- pref.setTagNameCase(HTMLCorePreferenceNames.LOWER);
- pref.setAttrNameCase(HTMLCorePreferenceNames.LOWER);
- }
- else {
- pref.setTagNameCase(HTMLCorePreferenceNames.ASIS);
- pref.setAttrNameCase(HTMLCorePreferenceNames.ASIS);
- }
-
- processor.cleanupModel(model);
-
- // set back options
- pref.setCompressEmptyElementTags(compressEmptyElementTags);
- pref.setInsertRequiredAttrs(insertRequiredAttrs);
- pref.setInsertMissingTags(insertMissingTags);
- pref.setQuoteAttrValues(quoteAttrValues);
- pref.setFormatSource(formatSource);
- pref.setTagNameCase(tagNameCase);
- pref.setAttrNameCase(attrNameCase);
- }
-
- /**
- * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
- * publicId: publicId for DOCTYPE declaration
- */
- public void convert(IDOMModel model, String declaration, String publicId) {
- if (model == null)
- return;
- setDeclaration(model, declaration, publicId);
- cleanupModel(model);
- }
-
- /**
- * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
- * publicId: publicId for DOCTYPE declaration
- */
- public void convert(InputStream input, OutputStream output, String declaration, String publicId) throws UnsupportedEncodingException, IOException, CoreException {
- IDOMModel model = readModel(input);
- if (model == null)
- return;
- try {
- convert(model, declaration, publicId);
- writeModel(model, output);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
-
- /**
- * declaratoin: "data" for XML declaration, such as "version=\"1.0\""
- * publicId: publicId for DOCTYPE declaration
- */
- public void convert(IFile file, String declaration, String publicId) throws IOException, CoreException {
- IDOMModel model = readModel(file);
- if (model == null)
- return;
- try {
- convert(model, declaration, publicId);
- writeModel(model, file);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
-
- /**
- */
- private static void insertBreak(IDOMModel model, Node node) {
- if (model == null || node == null)
- return;
- if (node.getNodeType() == Node.TEXT_NODE)
- return;
-
- // get delimiter string
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- String delim = structuredDocument.getLineDelimiter();
- if (delim == null || delim.length() == 0)
- return;
-
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Document document = node.getOwnerDocument();
- if (document == null)
- return;
- Text text = document.createTextNode(delim);
- parent.insertBefore(text, node);
- }
-
- /**
- */
- private IDOMModel readModel(InputStream input) throws IOException, UnsupportedEncodingException {
- if (input == null)
- return null;
- // create temporary model
- String id = input.toString() + ".html"; //$NON-NLS-1$
- IModelManager manager = StructuredModelManager.getModelManager();
- IStructuredModel model = manager.getModelForEdit(id, input, null);
- if (!(model instanceof IDOMModel)) {
- if (model == null)
- model.releaseFromEdit();
- return null;
- }
- return (IDOMModel) model;
- }
-
- /**
- */
- private IDOMModel readModel(IFile file) throws IOException, CoreException {
- if (file == null)
- return null;
- IModelManager manager = StructuredModelManager.getModelManager();
- IStructuredModel model = manager.getModelForEdit(file);
- if (!(model instanceof IDOMModel)) {
- if (model != null)
- model.releaseFromEdit();
- return null;
- }
- return (IDOMModel) model;
- }
-
- /**
- */
- public void setDeclaration(IDOMModel model, String declaration, String publicId) {
- if (model == null)
- return;
- IDOMDocument document = model.getDocument();
- if (document == null)
- return;
-
- try {
- model.aboutToChangeModel();
-
- ProcessingInstruction pi = null;
- Node child = document.getFirstChild();
- if (child != null && child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
- String target = child.getNodeName();
- if (target != null && target.equals("xml")) { //$NON-NLS-1$
- pi = (ProcessingInstruction) child;
- child = child.getNextSibling();
- }
- }
- IDOMDocumentType docType = (IDOMDocumentType) document.getDoctype();
-
- if (declaration != null) {
- if (pi != null) {
- pi.setData(declaration);
- }
- else {
- pi = document.createProcessingInstruction("xml", declaration); //$NON-NLS-1$
- document.insertBefore(pi, child);
- insertBreak(model, child);
- }
- }
-
- if (publicId != null) {
- HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
- String name = (entry != null ? entry.getName() : null);
- if (name == null || name.length() == 0)
- name = "HTML"; // default //$NON-NLS-1$
- if (docType != null) {
- if (!name.equals(docType.getName())) { // replace
- Node parent = docType.getParentNode();
- child = docType;
- docType = (IDOMDocumentType) document.createDoctype(name);
- parent.insertBefore(docType, child);
- parent.removeChild(child);
- }
- }
- else {
- docType = (IDOMDocumentType) document.createDoctype(name);
- document.insertBefore(docType, child);
- insertBreak(model, child);
- }
- docType.setPublicId(publicId);
- if (entry != null) {
- String systemId = entry.getSystemId();
- if (systemId != null)
- docType.setSystemId(systemId);
- String namespaceURI = entry.getNamespaceURI();
- if (namespaceURI != null) {
- Element element = document.getDocumentElement();
- if (element != null) {
- element.setAttribute("xmlns", namespaceURI); //$NON-NLS-1$
- }
- }
- }
- }
- }
- finally {
- model.changedModel();
- }
- }
-
- /**
- */
- private void writeModel(IDOMModel model, OutputStream output) throws UnsupportedEncodingException, IOException, CoreException {
- if (model == null || output == null)
- return;
- model.save();
- }
-
- /**
- */
- private void writeModel(IDOMModel model, IFile file) throws IOException, CoreException {
- if (model == null || file == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- //ByteArrayOutputStream output = null;
- ByteArrayInputStream input = null;
- try {
- //output = new
- // ByteArrayOutputStream(structuredDocument.getLength());
- model.save();
- //input = new ByteArrayInputStream(output.toByteArray());
- //file.setContents(input, true, true, null);
- }
- finally {
- // if (output != null)
- // output.close();
- if (input != null)
- input.close();
- }
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
deleted file mode 100644
index 9297a2a784..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapter.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapterImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- */
-public class HTMLDocumentTypeAdapter extends DocumentTypeAdapterImpl implements HTMLDocumentTypeConstants {
-
- private HTMLDocumentTypeAdapterFactory fFactory = null;
- private HTMLDocumentTypeEntry entry = null;
- private boolean isXMLType = false;
- private final static String XML = "xml"; //$NON-NLS-1$
- private final static String XHTML = "xhtml"; //$NON-NLS-1$
- private final static String WML = "wml"; //$NON-NLS-1$
-
-
- /**
- */
- protected HTMLDocumentTypeAdapter() {
- super();
- }
-
- /**
- */
- protected HTMLDocumentTypeAdapter(IDOMDocument document, HTMLDocumentTypeAdapterFactory factory) {
- super(document);
-
- this.fFactory = factory;
-
- // initialize
- documentTypeChanged();
- }
-
- /**
- */
- private void documentTypeChanged() {
- IDOMDocument document = getDocument();
- if (document == null)
- return; // error
- IDOMModel model = document.getModel();
- if (model == null)
- return; // error
-
- IFile file = getFile(model);
-
- // find DOCTYPE delcaration and Public ID
- String publicId = null;
- DocumentType newDocumentType = findDocumentType(document);
- if (newDocumentType != null) {
- publicId = newDocumentType.getPublicId();
- }
- else {
- // lookup default set by contentsettings
- publicId = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, file, true);
- }
-
- // lookup DOCTYPE registry
- HTMLDocumentTypeEntry newEntry = null;
- if (publicId != null) {
- newEntry = HTMLDocumentTypeRegistry.getInstance().getEntry(publicId);
- }
-
- boolean newXMLType = (newEntry != null ? newEntry.isXMLType() : false);
- boolean newWMLType = (newEntry != null ? newEntry.isWMLType() : false);
-
- if (!newXMLType) {
- // find XML declaration
- if (findXMLNode(document) != null) {
- newXMLType = true;
- }
-
- // check file extension
- if (file != null) {
- String ext = file.getFileExtension();
- if (ext != null && ext.equalsIgnoreCase(XHTML)) {
- newXMLType = true;
- }
-
- if (ext != null && ext.equalsIgnoreCase(WML)) {
- newXMLType = true;
- newWMLType = true;
- }
- }
-
- }
-
- if (newEntry == null) {
- // lookup system default
- if (newXMLType && newDocumentType == null) {
- // use default XHTML, if it's XML and no document type
- // declared
- if (newWMLType)
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_WML);
- else
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_XHTML);
-
- }
- else {
- newEntry = HTMLDocumentTypeRegistry.getInstance().getDefaultEntry(HTMLDocumentTypeRegistry.DEFAULT_HTML);
- }
- if (newEntry == null)
- return; // error
- }
-
- if (newDocumentType == null) {
- DocumentType oldDocumentType = getDocumentType();
- if (oldDocumentType == null || oldDocumentType.getName() != newEntry.getName()) {
- // create implicit DocumentType
- DOMImplementation impl = document.getImplementation();
- if (impl != null) {
- String name = newEntry.getName();
- publicId = newEntry.getPublicId();
- String systemId = newEntry.getSystemId();
- newDocumentType = impl.createDocumentType(name, publicId, systemId);
- }
- }
- }
-
- boolean notify = false;
- if (this.entry != null) { // do not notify on initialization
- notify = (newEntry != this.entry || newXMLType != this.isXMLType);
- }
-
- if (newDocumentType != null)
- setDocumentType(newDocumentType);
- this.entry = newEntry;
- this.isXMLType = newXMLType;
-
- if (notify)
- notifyDocumentTypeChanged();
- }
-
- /**
- */
- private IDOMDocumentType findDocumentType(IDOMDocument document) {
- IDOMDocumentType documentType = (IDOMDocumentType) document.getDoctype();
- if (documentType != null && documentType.getExistingAdapter(DocumentTypeAdapter.class) == null) {
- // watch future changes
- documentType.addAdapter(this);
- }
- return documentType;
- }
-
- /**
- */
- private Node findXMLNode(Document document) {
- for (Node child = document.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
- continue;
- String target = child.getNodeName();
- if (target != null && target.equals(XML)) {
- return child;
- }
- }
- return null;
- }
-
- /**
- */
- public int getAttrNameCase() {
- if (isXMLType())
- return LOWER_CASE; // XHTML
- return this.fFactory.getAttrNameCase();
- }
-
- private IFile getFile(IStructuredModel model) {
- IFile result = null;
- String location = model.getBaseLocation();
- if (location != null) {
- IPath path = new Path(location);
- if (path.segmentCount() > 1) {
- result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return result;
- }
-
- /**
- */
- public int getTagNameCase() {
- if (isXMLType())
- return LOWER_CASE; // XHTML
- return this.fFactory.getTagNameCase();
- }
-
- /**
- */
- public boolean hasFeature(String feature) {
- if (feature == null)
- return false;
- if (feature.equals(HTML))
- return true;
- if (feature.equals(SSI))
- return true;
- if (feature.equals(FRAMESET)) {
- if (this.entry == null)
- return false;
- return this.entry.hasFrameset();
- }
- return false;
- }
-
- /**
- */
- public boolean isXMLType() {
- return this.isXMLType;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (notifier == null)
- return;
- if (notifier instanceof IDOMDocument) {
- if (eventType != INodeNotifier.STRUCTURE_CHANGED)
- return;
- }
- else {
- if (eventType != INodeNotifier.CHANGE)
- return;
- }
- documentTypeChanged();
- }
-
- /**
- */
- public void release() {
- super.release();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java
deleted file mode 100644
index 14028b0e54..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeAdapterFactory.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.document;
-
-
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-
-/**
- */
-public class HTMLDocumentTypeAdapterFactory implements INodeAdapterFactory, Preferences.IPropertyChangeListener {
-
- private int tagNameCase = DocumentTypeAdapter.LOWER_CASE;
- private int attrNameCase = DocumentTypeAdapter.LOWER_CASE;
- private Preferences preferences = null;
-
- // for removal later on release()
- private HashMap fDoc2AdapterMap = new HashMap();
-
- /**
- */
- public HTMLDocumentTypeAdapterFactory() {
- super();
- this.preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
-
- if (this.preferences != null) {
- updateCases(); // initialize
- this.preferences.addPropertyChangeListener(this);
- }
- }
-
- /**
- * Method that returns the adapter associated with the given object. It
- * may be a singleton or not ... depending on the needs of the
- * INodeAdapter ... but in general it is recommended for an adapter to be
- * stateless, so the efficiencies of a singleton can be gained.
- *
- * The implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter.
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- INodeAdapter result = null;
- // only adapt IDOMDocument
- if (notifier instanceof IDOMDocument) {
-
- // if already has an adapter, no need to recreate/initialize.
- // Note: this means if "doctype" for DOM changes,
- // theDocumentTypeAdatper for that DOM
- // should be removed (and released) and it will be re-created next
- // time required.
- DocumentTypeAdapter oldAdapter = (DocumentTypeAdapter) notifier.getExistingAdapter(DocumentTypeAdapter.class);
- if (oldAdapter != null) {
- result = oldAdapter;
- }
- else {
-
- // if there already was an adapter
- //if(fAdapter != null)
- // fAdapter.release();
-
- // note, the factory is included in this case to have a central place
- // to come back to for case preferences.
- result = new HTMLDocumentTypeAdapter((IDOMDocument) notifier, this);
- notifier.addAdapter(result);
-
- fDoc2AdapterMap.put(notifier, result);
- }
- }
- return result;
- }
-
- /**
- */
- public int getAttrNameCase() {
- return this.attrNameCase;
- }
-
- /**
- */
- public int getTagNameCase() {
- return this.tagNameCase;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == DocumentTypeAdapter.class);
- }
-
- /**
- */
- public void propertyChange(Preferences.PropertyChangeEvent event) {
- if (event == null)
- return;
- String property = event.getProperty();
- if (property == null)
- return;
-
- if (property.equals(HTMLCorePreferenceNames.TAG_NAME_CASE) || property.equals(HTMLCorePreferenceNames.ATTR_NAME_CASE)) {
- updateCases();
- }
- }
-
- /**
- */
- private void updateCases() {
- this.tagNameCase = DocumentTypeAdapter.LOWER_CASE;
- this.attrNameCase = DocumentTypeAdapter.LOWER_CASE;
-
- if (this.preferences == null)
- return;
-
- int tagCase = this.preferences.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- if (tagCase == HTMLCorePreferenceNames.LOWER)
- this.tagNameCase = DocumentTypeAdapter.LOWER_CASE;
- else if (tagCase == HTMLCorePreferenceNames.UPPER)
- this.tagNameCase = DocumentTypeAdapter.UPPER_CASE;
-
- int attCase = this.preferences.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- if (attCase == HTMLCorePreferenceNames.LOWER)
- this.attrNameCase = DocumentTypeAdapter.LOWER_CASE;
- else if (attCase == HTMLCorePreferenceNames.UPPER)
- this.tagNameCase = DocumentTypeAdapter.UPPER_CASE;
- }
-
- /**
- */
- public void release() {
-
- if(!fDoc2AdapterMap.isEmpty()) {
- Object[] docs = fDoc2AdapterMap.keySet().toArray();
- DocumentTypeAdapter adapter = null;
- for (int i = 0; i < docs.length; i++) {
- adapter = (DocumentTypeAdapter)fDoc2AdapterMap.get(docs[i]);
- adapter.release();
- ((IDOMDocument)docs[i]).removeAdapter(adapter);
- }
- fDoc2AdapterMap.clear();
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=95960
- if (this.preferences != null) {
- this.preferences.removePropertyChangeListener(this);
- }
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return new HTMLDocumentTypeAdapterFactory();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java
deleted file mode 100644
index abc328444d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeConstants.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-public interface HTMLDocumentTypeConstants {
-
- public final static String HTML = "HTML"; //$NON-NLS-1$
- public final static String FRAMESET = "FRAMESET"; //$NON-NLS-1$
- public final static String SSI = "SSI"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java
deleted file mode 100644
index e0a81cdf08..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeEntry.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-public class HTMLDocumentTypeEntry {
-
- private String name;
- private String publicId;
- private String systemId;
- private String namespaceURI;
- private boolean isXMLType;
- private boolean isXHTMLType;
- private boolean isWMLType;
- private boolean hasFrameset;
- private String displayName;
- private boolean isDefaultXHTML;
- private boolean isDefaultWML;
- private static String XHTML_NAME = "html"; //$NON-NLS-1$
- private static String HTML_NAME = "HTML"; //$NON-NLS-1$
- private boolean useInternalModel = false;
-
- /**
- */
- public HTMLDocumentTypeEntry(String name, String publicId, String systemId, String namespaceURI, boolean isXHTMLType, boolean hasFrameset, String displayName, boolean isDefaultXHTML, boolean isDefaultWML, boolean isWMLType) {
- super();
-
- if (name != null && name.length() > 0) {
- this.name = name;
- }
- else {
- if (isXMLType)
- this.name = XHTML_NAME;// need code for wml?
- else
- this.name = HTML_NAME;
- }
- this.publicId = publicId;
- this.systemId = systemId;
- this.namespaceURI = namespaceURI;
- this.isXMLType = isXHTMLType | isWMLType;
- this.hasFrameset = hasFrameset;
- this.displayName = displayName;
- this.isDefaultXHTML = isDefaultXHTML;
- this.isDefaultWML = isDefaultWML;
- this.isXHTMLType = isXHTMLType;
- this.isWMLType = isWMLType;
- }
-
- HTMLDocumentTypeEntry(String name, String publicId, String systemId, String namespaceURI, boolean isXHTMLType, boolean hasFrameset, String displayName, boolean isDefaultXHTML, boolean isDefaultWML, boolean isWMLType, boolean useInternalModel) {
- this(name, publicId, systemId, namespaceURI, isXHTMLType, hasFrameset, displayName, isDefaultXHTML, isDefaultWML, isWMLType);
- this.useInternalModel = useInternalModel;
- }
-
- /**
- */
- public final String getName() {
- return this.name;
- }
-
- /**
- */
- public final String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- /**
- */
- public final String getPublicId() {
- return this.publicId;
- }
-
- /**
- */
- public final String getSystemId() {
- return this.systemId;
- }
-
- /**
- */
- public final boolean isXMLType() {
- return this.isXMLType;
- }
-
- /**
- */
- public final boolean hasFrameset() {
- return this.hasFrameset;
- }
-
- /**
- */
- public final String getDisplayName() {
- return this.displayName;
- }
-
- /**
- */
- public final boolean isDefaultXHTML() {
- return this.isDefaultXHTML;
- }
-
- public final boolean isDefaultWML() {
- return this.isDefaultWML;
- }
-
-
- public final boolean isXHTMLType() {
- return isXHTMLType;
- }
-
- public final boolean isWMLType() {
- return isWMLType;
- }
-
- public final boolean useInternalModel() {
- return useInternalModel;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
deleted file mode 100644
index 3cd71ff2e7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistry.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-/**
- */
-public class HTMLDocumentTypeRegistry {
-
- private static HTMLDocumentTypeRegistry instance = null;
- private Hashtable entries = null;
- private HTMLDocumentTypeEntry defaultEntry = null;
- private HTMLDocumentTypeEntry defaultXHTMLEntry = null;
- private HTMLDocumentTypeEntry defaultWMLEntry = null;
- private HTMLDocumentTypeEntry defaultCHTMLEntry = null;
-
- final static int DEFAULT_HTML = 0;
- final static int DEFAULT_XHTML = 1;
- final static int DEFAULT_WML = 2;
- final static int DEFAULT_CHTML = 3;
-
- public static final String CHTML_PUBLIC_ID = "-//W3C//DTD Compact HTML 1.0 Draft//EN";//$NON-NLS-1$
-
- /**
- */
- private HTMLDocumentTypeRegistry() {
- super();
-
- this.entries = new Hashtable();
- // HTML 4.01
- String name = "HTML";//$NON-NLS-1$
- String publicId = "-//W3C//DTD HTML 4.01 Transitional//EN";//$NON-NLS-1$
- String systemId = "http://www.w3.org/TR/html4/loose.dtd";//$NON-NLS-1$
- String displayName = "HTML 4.01 Transitional"; //$NON-NLS-1$
- this.defaultEntry = new HTMLDocumentTypeEntry(name, publicId, systemId, null, false, false, displayName, false, false, false, true);
- this.entries.put(publicId, this.defaultEntry);
- publicId = "-//W3C//DTD HTML 4.01//EN";//$NON-NLS-1$
- systemId = "http://www.w3.org/TR/html4/strict.dtd";//$NON-NLS-1$
- displayName = "HTML 4.01 Strict"; //$NON-NLS-1$
- this.entries.put(publicId, new HTMLDocumentTypeEntry(name, publicId, systemId, null, false, false, displayName, false, false, false, true));
- publicId = "-//W3C//DTD HTML 4.01 Frameset//EN";//$NON-NLS-1$
- systemId = "http://www.w3.org/TR/html4/frameset.dtd";//$NON-NLS-1$
- displayName = "HTML 4.01 Frameset"; //$NON-NLS-1$
- this.entries.put(publicId, new HTMLDocumentTypeEntry(name, publicId, systemId, null, false, true, displayName, false, false, false, true));
- // CHTML
- name = "HTML";//$NON-NLS-1$
- publicId = CHTML_PUBLIC_ID;
- displayName = "Compact HTML 1.0 Draft"; //$NON-NLS-1$
- this.defaultCHTMLEntry = new HTMLDocumentTypeEntry(name, publicId, null, null, false, false, displayName, false, false, false, true);
- this.entries.put(publicId, this.defaultCHTMLEntry);
-
- HTMLDocumentTypeRegistryReader reader = new HTMLDocumentTypeRegistryReader();
- if (reader != null)
- reader.readRegistry(this);
- }
-
- /**
- */
- void regist(String pid, HTMLDocumentTypeEntry doctype) {
- if (pid == null || doctype == null)
- return;
- this.entries.put(pid, doctype);
- if (this.defaultXHTMLEntry == null) {
- if (doctype.isDefaultXHTML())
- this.defaultXHTMLEntry = doctype;
- }
- if (this.defaultWMLEntry == null) {
- if (doctype.isDefaultWML())
- this.defaultWMLEntry = doctype;
- }
- }
-
- /**
- *
- */
- public HTMLDocumentTypeEntry getDefaultEntry(int type) {
- HTMLDocumentTypeEntry entry = null;
- switch (type) {
- case DEFAULT_XHTML :
- entry = this.defaultXHTMLEntry;
- break;
- case DEFAULT_WML :
- entry = this.defaultWMLEntry;
- break;
- case DEFAULT_CHTML :
- entry = this.defaultCHTMLEntry;
- break;
- case DEFAULT_HTML :
- default :
- entry = this.defaultEntry;
- break;
- }
- return entry;
- }
-
- /**
- *
- */
- public HTMLDocumentTypeEntry getDefaultEntry() {
- return this.defaultEntry;
- }
-
- /**
- */
- public HTMLDocumentTypeEntry getXHTMLDefaultEntry() {
- return this.defaultXHTMLEntry;
- }
-
- /**
- */
- public Enumeration getEntries() {
- return this.entries.elements();
- }
-
- /**
- */
- public HTMLDocumentTypeEntry getEntry(String publicId) {
- if (publicId == null)
- return null;
- return (HTMLDocumentTypeEntry) this.entries.get(publicId);
- }
-
- /**
- */
- public synchronized static HTMLDocumentTypeRegistry getInstance() {
- if (instance == null)
- instance = new HTMLDocumentTypeRegistry();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java
deleted file mode 100644
index 2dbf6ed764..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLDocumentTypeRegistryReader.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.document;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-
-/**
- */
-class HTMLDocumentTypeRegistryReader {
-
- //
- private final static String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
- private final static String EXTENSION_POINT_ID = "documentTypes"; //$NON-NLS-1$
- private final static String TAG_NAME = "documentType"; //$NON-NLS-1$
- private final static String ATT_PID = "publicID"; //$NON-NLS-1$
- private final static String ATT_SID = "systemID"; //$NON-NLS-1$
- private final static String ATT_IS_XHTML = "isXHTML"; //$NON-NLS-1$
- private final static String ATT_IS_WML = "isWML"; //$NON-NLS-1$
- private final static String ATT_HAS_FRAMESET = "hasFrameset"; //$NON-NLS-1$
- private final static String ATT_NSURI = "namespaceURI"; //$NON-NLS-1$
- private final static String ATT_ENAME = "elementName"; //$NON-NLS-1$
- private final static String ATT_DNAME = "displayName"; //$NON-NLS-1$
- private final static String ATT_IS_DEFAULT_XHTML = "defaultXHTML"; //$NON-NLS-1$
- private final static String ATT_IS_DEFAULT_WML = "defaultWML"; //$NON-NLS-1$
- private final static String ATV_TRUE = "true"; //$NON-NLS-1$
- private final static String ATV_NULL_STRING = ""; //$NON-NLS-1$
-
- /**
- */
- HTMLDocumentTypeRegistryReader() {
- super();
- }
-
- /**
- */
- void readRegistry(HTMLDocumentTypeRegistry reg) {
- if (reg == null)
- return;
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint point = registry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
- if (point != null) {
- IConfigurationElement[] elements = point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- HTMLDocumentTypeEntry doctype = readElement(elements[i]);
- // null can be returned if there's an error reading the element
- if (doctype != null) {
- reg.regist(doctype.getPublicId(), doctype);
- }
- }
- }
- }
-
- /**
- */
- private HTMLDocumentTypeEntry readElement(IConfigurationElement element) {
- HTMLDocumentTypeEntry doctype = null;
- String pid = null;
- String sid = null;
- String nsuri = null;
- String root = null;
- boolean xhtml = true;
- boolean frameset = false;
- String dname = null;
- boolean defaultXhtml = false;
- boolean defaultWML = false;
- boolean isWML = false;
-
- if (element.getName().equals(TAG_NAME)) {
- pid = element.getAttribute(ATT_PID);
- // publicID attribute is mandatory.
- if (pid == null || pid.equals(ATV_NULL_STRING))
- return null;
-
- sid = element.getAttribute(ATT_SID);
- nsuri = element.getAttribute(ATT_NSURI);
- root = element.getAttribute(ATT_ENAME);
- xhtml = getBoolean(element, ATT_IS_XHTML);
- frameset = getBoolean(element, ATT_HAS_FRAMESET);
- dname = element.getAttribute(ATT_DNAME);
- defaultXhtml = getBoolean(element, ATT_IS_DEFAULT_XHTML);
- defaultWML = getBoolean(element, ATT_IS_DEFAULT_WML);
- isWML = getBoolean(element, ATT_IS_WML);
- doctype = new HTMLDocumentTypeEntry(root, pid, sid, nsuri, xhtml, frameset, dname, defaultXhtml, defaultWML, isWML);
- }
- return doctype;
- }
-
- /**
- */
- private boolean getBoolean(IConfigurationElement element, String att) {
- String value = element.getAttribute(att);
- if (value != null && value.equals(ATV_TRUE))
- return true;
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
deleted file mode 100644
index 1033d09f3f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapter.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.document;
-
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.document.CMNodeUtil;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * HTMLDocumentImpl class
- */
-public class HTMLModelParserAdapter implements ModelParserAdapter {
- /**
- * note: I made public, temparily, so could be used by JSPLoader
- */
- protected HTMLModelParserAdapter() {
- super();
- }
-
- private boolean shouldTerminateAt(CMElementDeclaration parent, CMElementDeclaration child) {
- if (!parent.supports(HTMLCMProperties.TERMINATORS))
- return false;
- java.util.Iterator i = (java.util.Iterator) parent.getProperty(HTMLCMProperties.TERMINATORS);
- if (i == null)
- return false;
- String nextName = child.getElementName();
- while (i.hasNext()) {
- // NOTE: CMElementDeclaration of child is not always HTMLCMElementDeclaration.
- // It might be one of based on DTD (for XHTML element). So, comparison must
- // be performed ignoring case.
- // -- 3/20/2002
- String terminator = (String) i.next();
- if (terminator == null)
- continue;
- if (nextName.equalsIgnoreCase(terminator))
- return true;
- }
- return false;
- }
-
- /**
- */
- public boolean canContain(Element element, Node child) {
- if (element == null || child == null)
- return false;
- IDOMElement impl = (IDOMElement) element;
-
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- if (!impl.isGlobalTag())
- return true; // non HTML tag
- IDOMElement childElement = (IDOMElement) child;
-
- CMElementDeclaration myDec = CMNodeUtil.getElementDeclaration(element);
- if (myDec == null)
- return true;
- //if (!(myDec instanceof HTMLElementDeclaration)) return true;
- if (myDec.getContentType() == CMElementDeclaration.EMPTY)
- return false;
-
- if (!childElement.isGlobalTag())
- return true; // non HTML tag
- CMElementDeclaration childDec = CMNodeUtil.getElementDeclaration(childElement);
- if (childDec == null)
- return true;
- //if (!(childDec instanceof HTMLElementDeclaration)) return true;
-
- if (myDec instanceof HTMLElementDeclaration) {
- if (((Boolean) ((HTMLElementDeclaration) myDec).getProperty(HTMLCMProperties.IS_JSP)).booleanValue())
- return true;
- }
- if (shouldTerminateAt(myDec, childDec) && !isValidChild(myDec, childDec)) {
- return false;
- }
-
- String tagName = impl.getTagName();
- if (tagName == null)
- return true;
- String childName = childElement.getTagName();
- if (childName == null)
- return true;
- if (!impl.hasStartTag() && !impl.hasEndTag()) {
- // implicit element
- if (tagName.equalsIgnoreCase(childElement.getTagName()))
- return false;
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
- if (!childName.equalsIgnoreCase(HTML40Namespace.ElementName.META) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.TITLE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) && !childName.equalsIgnoreCase(HTML40Namespace.ElementName.ISINDEX)) {
- return false;
- }
- }
-
- Node parent = element.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement parentElement = (IDOMElement) parent;
- if (!parentElement.hasStartTag() && !parentElement.hasEndTag()) {
- if (!canContain(parentElement, child))
- return false;
- }
- }
- return true;
- }
-
- // contexual termination for TABLE content tags
- boolean isTableContent = false;
- if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT)) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return true;
- isTableContent = true;
- }
- else if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TR)) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return true;
- isTableContent = true;
- }
- else if (childName.equalsIgnoreCase(HTML40Namespace.ElementName.TD) || childName.equalsIgnoreCase(HTML40Namespace.ElementName.TH)) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TR) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TBODY) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.THEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TFOOT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return true;
- isTableContent = true;
- }
- if (isTableContent) {
- // TABLE content tags should terminate non TABLE content tags,
- // if in TABLE
- for (Node parent = element.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- break;
- IDOMElement parentElement = (IDOMElement) parent;
- String parentName = parentElement.getTagName();
- if (parentName == null)
- continue;
- if (parentName.equalsIgnoreCase(HTML40Namespace.ElementName.TABLE))
- return false;
- }
- }
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.EMBED)) {
- if (!childName.equalsIgnoreCase(HTML40Namespace.ElementName.NOEMBED))
- return false;
- }
- }
- else if (child.getNodeType() == Node.TEXT_NODE) {
- String tagName = impl.getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ElementName.EMBED)) {
- IDOMText text = (IDOMText) child;
- if (!text.isElementContentWhitespace())
- return false;
- }
- }
- else if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- if (impl.isImplicitTag())
- return false;
- }
-
- return true;
- }
-
- /**
- */
- public boolean canBeImplicitTag(Element element) {
- return false;
- }
-
- /**
- */
- public boolean canBeImplicitTag(Element element, Node child) {
- return false;
- }
-
- /**
- */
- public Element createCommentElement(Document document, String data, boolean isJSPTag) {
- if (document == null || data == null || data.length() == 0)
- return null;
-
- return createMetaElement(document, data, isJSPTag);
- }
-
- /**
- * This routine create an implicit Element for given parent and child,
- * such as HTML, BODY, HEAD, and TBODY for HTML document.
- */
- public Element createImplicitElement(Document document, Node parent, Node child) {
- return null;
- }
-
- /**
- */
- private Element createMetaElement(Document document, String data, boolean isJSPTag) {
- if (data == null || data.length() == 0)
- return null;
-
- TagScanner scanner = new TagScanner(data, 0, true); // one line
- String name = scanner.nextName();
- if (name == null || !name.equalsIgnoreCase(MetaData.METADATA))
- return null;
-
- String type = null;
- boolean isStartSpan = false;
- boolean isEndSpan = false;
- name = scanner.nextName();
- while (name != null) {
- String value = scanner.nextValue();
- if (name.equalsIgnoreCase(MetaData.TYPE)) {
- if (value == null)
- return null;
- if (value.equalsIgnoreCase(MetaData.DESIGNER_CONTROL)) {
- type = MetaData.DESIGNER_CONTROL;
- }
- else if (value.equalsIgnoreCase(MetaData.DYNAMIC_DATA)) {
- type = MetaData.DYNAMIC_DATA;
- }
- else if (value.equalsIgnoreCase(MetaData.AUTHOR_TIME_VISUAL)) {
- type = MetaData.AUTHOR_TIME_VISUAL;
- }
- else if (value.equalsIgnoreCase(MetaData.ANNOTATION)) {
- type = MetaData.ANNOTATION;
- }
- else {
- return null;
- }
- }
- else if (name.equalsIgnoreCase(MetaData.STARTSPAN)) {
- isStartSpan = true;
- }
- else if (name.equalsIgnoreCase(MetaData.ENDSPAN)) {
- if (!isStartSpan)
- isEndSpan = true;
- }
- name = scanner.nextName();
- }
- if (type == null)
- return null;
- if (!isStartSpan && !isEndSpan)
- return null;
- String metaData = null;
- int offset = scanner.getNextOffset(); // skip new line
- if (offset < data.length())
- metaData = data.substring(offset);
- if (metaData == null)
- metaData = new String();
-
- IDOMElement element = (IDOMElement) document.createElement(MetaData.PREFIX + type);
-
- MetaDataAdapter adapter = new MetaDataAdapter(type);
- if (isStartSpan) {
- if (metaData != null)
- adapter.setData(metaData);
- }
- else {
- if (metaData != null)
- adapter.setEndData(metaData);
- }
- element.addAdapter(adapter);
- adapter.setElement(element);
- element.setJSPTag(isJSPTag);
-
- return element;
- }
-
- /**
- */
- public String getFindRootName(String tagName) {
- if (tagName == null)
- return null;
- // tag matching should not beyond TABLE tag except BODY tag
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BODY))
- return null;
- return HTML40Namespace.ElementName.TABLE;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == ModelParserAdapter.class);
- }
-
- /**
- */
- public boolean isEndTag(IDOMElement element) {
- TagAdapter adapter = (TagAdapter) element.getExistingAdapter(TagAdapter.class);
- if (adapter != null)
- return adapter.isEndTag();
- return element.isEndTag();
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // do nothing on notifiy change
- // TODO: this means good candidate for regular platform adapter
- }
-
- private static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
- if (parent == null || child == null)
- return false;
- CMContent content = parent.getContent();
- if (content == null)
- return false;
- return isChild(content, child);
- }
-
- /**
- */
- private static boolean isChild(CMContent content, CMElementDeclaration target) {
- switch (content.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- return isSameDeclaration((CMElementDeclaration) content, target);
- case CMNode.GROUP :
- CMNodeList children = ((CMGroup) content).getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- CMNode child = children.item(i);
- switch (child.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- if (isSameDeclaration((CMElementDeclaration) child, target))
- return true;
- continue; // Go next child.
- case CMNode.GROUP :
- if (isChild((CMContent) child, target))
- return true;
- continue; // Go next child.
- default :
- continue; // Go next child.
- }
- }
- }
- return false;
- }
-
- /**
- */
- private static boolean isSameDeclaration(CMElementDeclaration aDec, CMElementDeclaration otherDec) {
- return aDec.getElementName() == otherDec.getElementName();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.java
deleted file mode 100644
index 397419efd9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/HTMLModelParserAdapterFactory.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.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-
-/**
- */
-public class HTMLModelParserAdapterFactory implements INodeAdapterFactory {
-
- private static HTMLModelParserAdapterFactory instance = null;
-
- /**
- */
- private HTMLModelParserAdapterFactory() {
- super();
- }
-
- /**
- * Method that returns the adapter associated with the given object. It
- * may be a singleton or not ... depending on the needs of the
- * INodeAdapter ... but in general it is recommended for an adapter to be
- * stateless, so the efficiencies of a singleton can be gained.
- *
- * The implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter.
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- INodeAdapter adapter = null;
- if (notifier != null) {
- if (notifier instanceof IDOMDocument) {
- adapter = notifier.getExistingAdapter(ModelParserAdapter.class);
- if (adapter == null) {
- adapter = new HTMLModelParserAdapter();
- notifier.addAdapter(adapter);
- }
- }
- }
- return adapter;
-
- }
-
- /**
- */
- public synchronized static HTMLModelParserAdapterFactory getInstance() {
- if (instance == null)
- instance = new HTMLModelParserAdapterFactory();
- return instance;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == ModelParserAdapter.class);
- }
-
- /**
- */
- public void release() {
- // no state to cleanup
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.java
deleted file mode 100644
index 132e18b995..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaData.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.core.internal.document;
-
-
-
-/**
- */
-public interface MetaData {
-
- static final String METADATA = "METADATA";//$NON-NLS-1$
- static final String TYPE = "type";//$NON-NLS-1$
- static final String STARTSPAN = "startspan";//$NON-NLS-1$
- static final String ENDSPAN = "endspan";//$NON-NLS-1$
- static final String DESIGNER_CONTROL = "DesignerControl";//$NON-NLS-1$
- static final String DYNAMIC_DATA = "DynamicData";//$NON-NLS-1$
- static final String AUTHOR_TIME_VISUAL = "AuthorTimeVisual";//$NON-NLS-1$
- static final String ANNOTATION = "Annotation";//$NON-NLS-1$
- static final String PREFIX = "METADATA:";//$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java
deleted file mode 100644
index 4fc4ca99e9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/MetaDataAdapter.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- */
-public class MetaDataAdapter implements TagAdapter, MetaData {
-
- private IDOMElement element = null;
- private String type = null;
- private String data = null;
- private String endData = null;
-
- /**
- */
- public MetaDataAdapter(String type) {
- super();
-
- if (type != null) {
- if (type.equals(ANNOTATION)) {
- this.type = ANNOTATION;
- }
- else if (type.equals(AUTHOR_TIME_VISUAL)) {
- this.type = AUTHOR_TIME_VISUAL;
- }
- else {
- this.type = type;
- }
- }
- }
-
- /**
- */
- private String getData(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return null;
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null)
- return null;
-
- String data = null;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- String regionType = region.getType();
- if (isCommentText(regionType)) {
- data = flatNode.getText(region);
- break;
- }
- }
- if (data == null)
- return null;
- int length = data.length();
- int offset = 0;
- for (; offset < length; offset++) {
- char c = data.charAt(offset);
- if (c == '\r' || c == '\n') {
- offset++;
- break;
- }
- }
- for (; offset < length; offset++) {
- char c = data.charAt(offset);
- if (c != '\r' && c != '\n') {
- break;
- }
- }
- return data.substring(offset);
- }
-
- private boolean isCommentText(String regionType) {
- boolean result = false;
- result = isDOMComment(regionType) || isNestedContentComment(regionType);
- return result;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
-
- private boolean isNestedContentComment(String regionType) {
- final String JSP_COMMENT_TEXT = "JSP_COMMENT_TEXT"; //$NON-NLS-1$
- return regionType.equals(JSP_COMMENT_TEXT);
- }
-
- private boolean isDOMComment(String regionType) {
- return regionType == DOMRegionContext.XML_COMMENT_TEXT;
- }
-
- public String getData() {
- if (this.element == null)
- return null;
- IStructuredDocumentRegion flatNode = this.element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- if (this.data != null)
- return this.data;
- return getData(flatNode);
- }
-
- /**
- */
- private String getDelimiter(IDOMModel model) {
- String delim = null;
- if (model != null) {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument != null)
- delim = structuredDocument.getLineDelimiter();
- }
- if (delim == null)
- delim = "\r\n";//$NON-NLS-1$
- return delim;
- }
-
- /**
- */
- public String getEndData() {
- if (this.element == null)
- return null;
- IStructuredDocumentRegion flatNode = this.element.getEndStructuredDocumentRegion();
- if (flatNode == null)
- return null;
- if (this.endData != null)
- return this.endData;
- return getData(flatNode);
- }
-
- /**
- */
- public String getEndTag(IDOMElement element) {
- StringBuffer buffer = new StringBuffer();
- if (element.isJSPTag())
- buffer.append("<%--");//$NON-NLS-1$
- else
- buffer.append("<!--");//$NON-NLS-1$
- buffer.append(METADATA);
- buffer.append(' ');
- buffer.append(TYPE);
- buffer.append("=\"");//$NON-NLS-1$
- buffer.append(this.type);
- buffer.append("\" ");//$NON-NLS-1$
- buffer.append(MetaData.ENDSPAN);
- String data = getEndData();
- if (data != null && data.length() > 0) {
- String delim = getDelimiter(element.getModel());
- buffer.append(delim);
- buffer.append(data);
- buffer.append(delim);
- }
- if (element.isJSPTag())
- buffer.append("--%>");//$NON-NLS-1$
- else
- buffer.append("-->");//$NON-NLS-1$
-
- return buffer.toString();
- }
-
- /**
- */
- public String getStartTag(IDOMElement element) {
- StringBuffer buffer = new StringBuffer();
- if (element.isJSPTag())
- buffer.append("<%--");//$NON-NLS-1$
- else
- buffer.append("<!--");//$NON-NLS-1$
- buffer.append(METADATA);
- buffer.append(' ');
- buffer.append(TYPE);
- buffer.append("=\"");//$NON-NLS-1$
- buffer.append(this.type);
- buffer.append("\" ");//$NON-NLS-1$
- buffer.append(MetaData.STARTSPAN);
- String data = getData();
- if (data != null && data.length() > 0) {
- String delim = getDelimiter(element.getModel());
- buffer.append(delim);
- buffer.append(data);
- buffer.append(delim);
- }
- if (element.isJSPTag())
- buffer.append("--%>");//$NON-NLS-1$
- else
- buffer.append("-->");//$NON-NLS-1$
-
- return buffer.toString();
- }
-
- /**
- */
- public String getType() {
- return this.type;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == TagAdapter.class || type == MetaDataAdapter.class);
- }
-
- /**
- */
- public boolean isEndTag() {
- if (this.element == null)
- return false;
- if (this.element.hasStartTag())
- return false;
- if (this.element.hasEndTag())
- return true;
- if (this.data != null)
- return false;
- return (this.endData != null);
- }
-
- /**
- */
- public boolean isRuntimeContainer() {
- return (this.type == ANNOTATION || this.type == AUTHOR_TIME_VISUAL);
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- */
- public void setData(String data) {
- this.data = data;
-
- if (this.element != null)
- this.element.notifyStartTagChanged();
- }
-
- /**
- */
- public void setEndData(String data) {
- this.endData = data;
-
- if (this.element != null)
- this.element.notifyEndTagChanged();
- }
-
- /**
- */
- public void setElement(IDOMElement element) {
- this.element = element;
-
- if (this.element != null) {
- this.element.setCommentTag(true);
- if (this.type != MetaData.ANNOTATION) {
- this.element.setJSPTag(true);
- }
- }
- }
-
- /**
- */
- public void setRuntimeSource(String source) {
- if (source == null)
- return;
- if (this.element == null)
- return;
- if (isRuntimeContainer())
- return;
-
- IDOMModel model = this.element.getModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- int offset = this.element.getStartEndOffset();
- int end = this.element.getEndStartOffset();
- int length = end - offset;
- structuredDocument.replaceText(model, offset, length, source);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java
deleted file mode 100644
index 17e0bb1436..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/TagScanner.java
+++ /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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-/**
- */
-class TagScanner {
-
- private String tag = null;
- private int offset = 0;
- private int length = 0;
- private boolean oneLine = false;
-
- /**
- */
- TagScanner(String tag, int offset) {
- super();
-
- this.tag = tag;
- this.offset = offset;
- if (tag != null)
- this.length = tag.length();
- }
-
- /**
- */
- TagScanner(String tag, int offset, boolean oneLine) {
- this(tag, offset);
-
- this.oneLine = oneLine;
- }
-
- /**
- */
- int getNextOffset() {
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (!isEnd(c))
- break;
- }
- return this.offset;
- }
-
- /**
- */
- int getOffset() {
- return this.offset;
- }
-
- /**
- */
- private final boolean isEnd(char c) {
- return (this.oneLine && (c == '\r' || c == '\n'));
- }
-
- /**
- */
- private static boolean isEqual(char c) {
- return (c == '=');
- }
-
- /**
- */
- private static boolean isQuote(char c) {
- return (c == '"' || c == '\'');
- }
-
- /**
- */
- private static boolean isSpace(char c) {
- return Character.isWhitespace(c);
- }
-
- /**
- */
- private char nextChar() {
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c))
- break;
- if (!isSpace(c))
- return c;
- }
- return 0;
- }
-
- /**
- */
- String nextName() {
- if (this.tag == null)
- return null;
- if (this.offset >= this.length)
- return null;
-
- if (nextChar() == 0)
- return null;
-
- int nameOffset = this.offset;
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c) || isSpace(c))
- break;
- if (isEqual(c) && this.offset > nameOffset)
- break;
- }
- if (this.offset == nameOffset)
- return null;
-
- return this.tag.substring(nameOffset, this.offset);
- }
-
- /**
- */
- String nextValue() {
- if (this.tag == null)
- return null;
- if (this.offset >= this.length)
- return null;
-
- char seperator = nextChar();
- if (!isEqual(seperator))
- return null;
- this.offset++; // skip '='
- char quote = nextChar();
- if (quote == 0)
- return null;
- if (isQuote(quote))
- this.offset++;
- else
- quote = 0;
-
- int valueOffset = this.offset;
- for (; this.offset < this.length; this.offset++) {
- char c = this.tag.charAt(this.offset);
- if (isEnd(c)) {
- quote = 0;
- break;
- }
- if (quote == 0) {
- if (isSpace(c))
- break;
- }
- else {
- if (c == quote)
- break;
- }
- }
- int valueEnd = this.offset;
- if (quote != 0 && this.offset < this.length)
- this.offset++;
- if (valueEnd == valueOffset)
- return null;
-
- return this.tag.substring(valueOffset, valueEnd);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java
deleted file mode 100644
index c6fcf4ad42..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/document/UnknownTagAdapter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.TagAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-
-/**
- */
-public class UnknownTagAdapter implements TagAdapter {
-
- private String startTag = null;
- private String endTag = null;
-
- /**
- */
- public UnknownTagAdapter() {
- super();
- }
-
- /**
- */
- public String getEndTag(IDOMElement element) {
- String tag = null;
- if (this.endTag != null) {
- tag = this.endTag;
- this.endTag = null;
- }
- return tag;
- }
-
- /**
- */
- public String getStartTag(IDOMElement element) {
- String tag = null;
- if (this.startTag != null) {
- tag = this.startTag;
- this.startTag = null;
- }
- return tag;
- }
-
- /**
- */
- public boolean isAdapterForType(Object type) {
- return (type == TagAdapter.class);
- }
-
- /**
- */
- public boolean isEndTag() {
- return false;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- */
- public void setEndTag(String endTag) {
- this.endTag = endTag;
- }
-
- /**
- */
- public void setStartTag(String startTag) {
- this.startTag = startTag;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.java
deleted file mode 100644
index a0242c9e3c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentCharsetDetector.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.core.internal.encoding;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.core.internal.contenttype.HTMLResourceEncodingDetector;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-
-/**
- * This class parses beginning portion of HTML file to get the encoding value
- * in a META tag. Example:
- * <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- *
- * Note: even though, technically, a META tag must come in a <HEAD>tag, we
- * don't check for that, under the assumption that whatever, or whereever, the
- * the first <META>tag is, it is the one intended to be used by the user, and
- * they may just be trying to repair the error. The HTML validator will tell
- * them if its in the wrong location.
- *
- */
-public class HTMLDocumentCharsetDetector extends HTMLResourceEncodingDetector implements IDocumentCharsetDetector {
-
-
- public HTMLDocumentCharsetDetector() {
- super();
- }
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
-
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java
deleted file mode 100644
index 5bd0a78185..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLDocumentLoader.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.encoding;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.html.core.internal.contenttype.EncodingGuesser;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForHTML;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.document.AbstractDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.parser.XMLStructuredDocumentReParser;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLDocumentLoader extends AbstractDocumentLoader {
-
- public HTMLDocumentLoader() {
- super();
- }
-
- /**
- * Convenience method to add tag names using BlockMarker object
- */
- protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
- parser.addBlockMarker(bm);
- }
-
- /**
- * Default encoding. For HTML, there is no spec.
- */
- protected String getSpecDefaultEncoding() {
- return null;
- }
-
- /**
- * @return java.lang.String
- * @param string
- * byte[]
- * @param length
- * int
- *
- * Do automatic encoding detection by guess
- */
- protected String getEncodingNameByGuess(byte[] string, int length) {
- final String ianaEnc = EncodingGuesser.guessEncoding(string, length);
- return ianaEnc;
- }
-
- /*
- * @see AbstractLoader#createNewStructuredDocument()
- */
- protected IEncodedDocument newEncodedDocument() {
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- ((BasicStructuredDocument) structuredDocument).setReParser(new XMLStructuredDocumentReParser());
-
- return structuredDocument;
- }
-
- /*
- * @see IModelLoader#getParser()
- */
- public RegionParser getParser() {
- XMLSourceParser parser = new XMLSourceParser();
- // for the "static HTML" case, we need to initialize
- // Blocktags here.
- addHTMLishTag(parser, "script"); //$NON-NLS-1$
- addHTMLishTag(parser, "style"); //$NON-NLS-1$
- return parser;
- }
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- public List getAdapterFactories() {
- List result = new ArrayList();
- INodeAdapterFactory factory = null;
- factory = StyleAdapterFactory.getInstance();
- result.add(factory);
- factory = HTMLStyleSelectorAdapterFactory.getInstance();
- result.add(factory);
- factory = new HTMLDocumentTypeAdapterFactory();
- result.add(factory);
- factory = HTMLModelParserAdapterFactory.getInstance();
- result.add(factory);
- //
- factory = new ModelQueryAdapterFactoryForHTML();
- result.add(factory);
-
- factory = new PropagatingAdapterFactoryImpl();
- result.add(factory);
-
-
- return result;
- }
-
- protected String getPreferredNewLineDelimiter(IFile file) {
- String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForHTML.ContentTypeID_HTML);
- if (delimiter == null)
- delimiter = super.getPreferredNewLineDelimiter(file);
- return delimiter;
- }
-
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (fDocumentEncodingDetector == null) {
- fDocumentEncodingDetector = new HTMLDocumentCharsetDetector();
- }
- return fDocumentEncodingDetector;
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- // DMW: just added this preload on 8/16/2002
- // I noticed the ProagatingAdapterFactory was being added,
- // that that the ProagatingAdapterAdapter was not being
- // preload adapted -- I'm assuing it ALWAYS has to be.
- IDOMModel domModel = (IDOMModel) structuredModel;
- // 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.
- ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- }
-
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForHTML();
- }
-
- public IDocumentLoader newInstance() {
- return new HTMLDocumentLoader();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java
deleted file mode 100644
index 0f84fc838b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/encoding/HTMLModelLoader.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.encoding;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.html.core.internal.document.DOMStyleModelImpl;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.model.AbstractModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.DebugAdapterFactory;
-import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLModelLoader extends AbstractModelLoader {
-
-
- public HTMLModelLoader() {
- super();
- }
-
- /**
- * Convenience method to add tag names using BlockMarker object
- */
- protected void addHTMLishTag(XMLSourceParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
- parser.addBlockMarker(bm);
- }
-
- public IStructuredModel newModel() {
- DOMStyleModelImpl model = new DOMStyleModelImpl();
- return model;
- }
-
- /**
- * This method must return those factories which must be attached to the
- * structuredModel before content is applied.
- */
- public List getAdapterFactories() {
- List result = new ArrayList();
- INodeAdapterFactory factory = null;
- factory = StyleAdapterFactory.getInstance();
- result.add(factory);
- factory = HTMLStyleSelectorAdapterFactory.getInstance();
- result.add(factory);
- factory = new HTMLDocumentTypeAdapterFactory();
- result.add(factory);
- factory = HTMLModelParserAdapterFactory.getInstance();
- result.add(factory);
- //
- factory = new ModelQueryAdapterFactoryForHTML();
- result.add(factory);
-
- factory = new PropagatingAdapterFactoryImpl();
- result.add(factory);
-
-
- return result;
- }
-
- protected void preLoadAdapt(IStructuredModel structuredModel) {
- super.preLoadAdapt(structuredModel);
- // DMW: just added this preload on 8/16/2002
- // I noticed the ProagatingAdapterFactory was being added,
- // that that the ProagatingAdapterAdapter was not being
- // preload adapted -- I'm assuing it ALWAYS has to be.
- IDOMModel domModel = (IDOMModel) structuredModel;
- // 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.
- ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- if (Debug.debugNotificationAndEvents) {
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
- propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
- } }
-
- public IModelLoader newInstance() {
- return new HTMLModelLoader();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new HTMLDocumentLoader();
- }
- return documentLoaderInstance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java
deleted file mode 100644
index 294906cb59..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/EmbeddedCSSFormatter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.format;
-
-
-
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-
-// nakamori_TODO: check and remove
-
-public class EmbeddedCSSFormatter extends HTMLFormatter {
-
- //private IAdapterFactory factory = new CSSSourceFormatterFactory(CSSSourceFormatter.class, true);
- /**
- */
- protected EmbeddedCSSFormatter() {
- super();
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- IDOMText text = (IDOMText) node;
-
- String source = getCSSContent(node);
- if (source == null) { // fallback
- source = text.getSource();
- }
-
- int offset = text.getStartOffset();
- int length = text.getEndOffset() - offset;
- replaceSource(text.getModel(), offset, length, source);
- setWidth(contraints, source);
- }
-
- /**
- */
- private String getCSSContent(IDOMNode text) {
- ICSSModel model = getCSSModel(text);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
- if (adapter == null)
- return null;
- CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
- StringBuffer buffer = formatter.format(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- /**
- */
- private ICSSModel getCSSModel(IDOMNode text) {
- if (text == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) text.getParentNode();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleSheetAdapter))
- return null;
- IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
- return styleAdapter.getModel();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
deleted file mode 100644
index 67c3a7e0eb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.format;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.format.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-public class HTMLElementFormatter extends HTMLFormatter {
-
- /**
- */
- protected HTMLElementFormatter() {
- super();
- }
-
- /**
- */
- private void compressTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = region.getTextEnd();
- int count = region.getEnd() - offset;
- if (count == 1) {
- String source = flatNode.getFullText(region);
- int start = region.getStart();
- if (source != null && source.charAt(offset - start) == ' ') {
- // nothing to do
- return;
- }
- }
- replaceSource(flatNode, offset, count, " ");//$NON-NLS-1$
- }
-
- /**
- */
- private void formatEndTag(IDOMElement element, HTMLFormatContraints contraints) {
- Node lastChild = element.getLastChild();
-
- if (lastChild != null && lastChild instanceof IDOMElement && lastChild.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
- insertBreakAfter((IDOMElement) lastChild, contraints);
- return;
- }
-
-
- IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion == null)
- return;
-
- if (element.isJSPTag() || element.isCommentTag()) {
- String endTag = endStructuredDocumentRegion.getText();
- if (endTag != null && endTag.length() > 0) {
- setWidth(contraints, endTag);
- }
- return;
- }
-
- ITextRegion prevRegion = null;
- ITextRegionList regions = endStructuredDocumentRegion.getRegions();
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- if (region == null)
- continue;
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTag(regionType)) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_CLOSE) {
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_NAME || isNestedRootTag(prevRegion.getType()))) {
- removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
- }
- }
- prevRegion = region;
- }
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_NAME || isNestedRootTag(prevRegion.getType()))) {
- removeTailingSpaces(endStructuredDocumentRegion, prevRegion);
- }
-
- // BUG123890 (end tag length was already prefactored into
- // formatStartTag so no need to do it here)
- // String newEndTag = endStructuredDocumentRegion.getText();
- // if (newEndTag != null && newEndTag.length() > 0) {
- // setWidth(contraints, newEndTag);
- // }
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- IDOMElement element = (IDOMElement) node;
-
- formatStartTag(element, contraints);
-
- formatChildNodes(element, contraints);
-
- formatEndTag(element, contraints);
- }
-
- /**
- */
- private void formatStartTag(IDOMElement element, HTMLFormatContraints contraints) {
-
- if (element.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
- insertBreakBefore(element, contraints);
- return;
- }
-
- IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion == null)
- return;
-
- // We should format attributes in JSPTag?
- // if (element.isJSPTag() || element.isCommentTag()) {
- if (element.isCommentTag()) {
- String startTag = startStructuredDocumentRegion.getText();
- if (startTag != null && startTag.length() > 0) {
- setWidth(contraints, startTag);
- }
- return;
- }
-
- // first process style attribute
- if (element.isGlobalTag()) {
- Attr attr = element.getAttributeNode("style");//$NON-NLS-1$
- if (attr != null)
- formatStyleAttr(attr);
- }
- boolean insertBreak = false;
- insertBreak = ((IStructuredFormatPreferencesXML) getFormatPreferences()).getSplitMultiAttrs();
-
- if (insertBreak) {
- NamedNodeMap attributes = element.getAttributes();
- if (attributes == null || attributes.getLength() < 2)
- insertBreak = false;
- }
- String breakSpaces = getBreakSpaces(element);
- String indent = getIndent();
- if (indent != null && indent.length() > 0) {
- breakSpaces += indent;
- }
- ITextRegion lastBreakRegion = null;
-
- ITextRegion prevRegion = null;
- ITextRegionList regions = startStructuredDocumentRegion.getRegions();
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- if (region == null)
- continue;
-
- ITextRegion breakRegion = null;
-
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_NAME || isNestedTag(regionType)) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_OPEN) {
- removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
- }
- breakRegion = region;
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
- // attribute name without value
- breakRegion = prevRegion;
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
- }
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- removeTailingSpaces(startStructuredDocumentRegion, prevRegion);
- }
- breakRegion = region;
- }
- else if (regionType == DOMRegionContext.XML_TAG_CLOSE || regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
- // attribute name without value
- breakRegion = prevRegion;
- }
- }
-
- if (breakRegion != null) {
- int end = breakRegion.getTextEnd();
- if (lastBreakRegion != null) {
- int offset = lastBreakRegion.getEnd();
- int count = end - offset;
- if (insertBreak || !isWidthAvailable(contraints, count + 1)) {
- replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- addWidth(contraints, 1);
- }
- addWidth(contraints, count);
- }
- else {
- addWidth(contraints, end);
- }
- lastBreakRegion = breakRegion;
- }
-
- prevRegion = region;
- }
- if (prevRegion != null && (prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME || prevRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS)) {
- // attribute name without value
- int end = prevRegion.getTextEnd();
- if (lastBreakRegion != null) {
- int offset = lastBreakRegion.getEnd();
- int count = end - offset;
- if (insertBreak || !isWidthAvailable(contraints, count + 1)) {
- replaceTailingSpaces(startStructuredDocumentRegion, lastBreakRegion, breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- addWidth(contraints, 1);
- }
- addWidth(contraints, count);
- }
- else {
- addWidth(contraints, end);
- }
- lastBreakRegion = prevRegion;
- }
-
- if (lastBreakRegion != null) {
- int offset = lastBreakRegion.getTextEnd();
- int count = startStructuredDocumentRegion.getLength() - offset;
- if (prevRegion != null && prevRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
- compressTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- count++;
- }
- else {
- removeTailingSpaces(startStructuredDocumentRegion, lastBreakRegion);
- // BUG123890 (pre-factor in end tag)
- count += element.getTagName().length() + 3;
- }
- addWidth(contraints, count);
- }
- else {
- addWidth(contraints, startStructuredDocumentRegion.getLength());
- }
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isNestedTag(String regionType) {
- final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_NAME = "JSP_DIRECTIVE_NAME"; //$NON-NLS-1$
- boolean result = regionType.equals(JSP_ROOT_TAG_NAME) || regionType.equals(JSP_DIRECTIVE_NAME);
- return result;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isNestedRootTag(String regionType) {
- final String JSP_ROOT_TAG_NAME = "JSP_ROOT_TAG_NAME"; //$NON-NLS-1$
- boolean result = regionType.equals(JSP_ROOT_TAG_NAME);
- return result;
- }
-
-
- /**
- */
- private void formatStyleAttr(Attr attr) {
- if (attr == null)
- return;
- String value = getCSSValue(attr);
- if (value == null)
- return;
- String oldValue = ((IDOMNode) attr).getValueSource();
- if (oldValue != null && value.equals(oldValue))
- return;
- attr.setValue(value);
- }
-
- /**
- */
- private ICSSModel getCSSModel(Attr attr) {
- if (attr == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter == null)
- return null;
- if (!(adapter instanceof IStyleDeclarationAdapter))
- return null;
- IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
- return styleAdapter.getModel();
- }
-
- /**
- */
- private String getCSSValue(Attr attr) {
- ICSSModel model = getCSSModel(attr);
- if (model == null)
- return null;
- ICSSNode document = model.getDocument();
- if (document == null)
- return null;
- INodeNotifier notifier = (INodeNotifier) document;
- INodeAdapter adapter = notifier.getAdapterFor(CSSSourceFormatter.class);
- if (adapter == null)
- return null;
- CSSSourceFormatter formatter = (CSSSourceFormatter) adapter;
- StringBuffer buffer = formatter.format(document);
- if (buffer == null)
- return null;
- return buffer.toString();
- }
-
- /**
- */
- private void removeTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region) {
- int offset = region.getTextEnd();
- int count = region.getEnd() - offset;
- if (count <= 0)
- return;
- replaceSource(flatNode, offset, count, null);
- }
-
- /**
- */
- private void replaceTailingSpaces(IStructuredDocumentRegion flatNode, ITextRegion region, String spaces) {
- int offset = region.getTextEnd();
- int count = region.getEnd() - offset;
- if (count == spaces.length()) {
- String source = flatNode.getFullText(region);
- if (source != null && source.endsWith(spaces)) {
- // nothing to do
- return;
- }
- }
- replaceSource(flatNode, offset, count, spaces);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.java
deleted file mode 100644
index c650384853..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatContraintsImpl.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.core.internal.format;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.StructuredFormatContraints;
-
-/**
- * @deprecated
- * Please un-deprecate this if Page Designer thinks they are needed.
- */
-public class HTMLFormatContraintsImpl extends StructuredFormatContraints implements HTMLFormatContraints {
- protected int fAvailableLineWidth;
-
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- public int getAvailableLineWidth() {
- return fAvailableLineWidth;
- }
-
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- public void setAvailableLineWidth(int availableLineWidth) {
- fAvailableLineWidth = availableLineWidth;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.java
deleted file mode 100644
index 0665cc4857..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatProcessorImpl.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.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Node;
-
-public class HTMLFormatProcessorImpl extends FormatProcessorXML {
- protected String getFileExtension() {
- return "html"; //$NON-NLS-1$
- }
-
- protected IStructuredFormatter getFormatter(Node node) {
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(node, getFormatPreferences());
-
- return formatter;
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
- ((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java
deleted file mode 100644
index 6333ccfc59..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatter.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.format;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLFormatter implements IStructuredFormatter {
-
- private static final String HTML_NAME = "html";//$NON-NLS-1$
- private static final String BODY_NAME = "BODY";//$NON-NLS-1$
-
- /**
- */
- protected void addWidth(HTMLFormatContraints contraints, int width) {
- if (contraints == null)
- return;
- if (!splitLines() || getLineWidth() < 0)
- return;
-
- int availableWidth = contraints.getAvailableLineWidth() - width;
- if (availableWidth < 0)
- availableWidth = 0;
- contraints.setAvailableLineWidth(availableWidth);
- }
-
- /**
- */
- protected boolean canFormatChild(Node node) {
- while (node != null) {
- if (node.getNodeType() != Node.ELEMENT_NODE)
- return true;
- CMElementDeclaration decl = getElementDeclaration((Element) node);
- if (decl != null) {
- if (decl.getContentType() == CMElementDeclaration.CDATA)
- return false;
- if (decl.supports(HTMLCMProperties.SHOULD_KEEP_SPACE)) {
- boolean shouldKeepSpace = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_KEEP_SPACE)).booleanValue();
- if (shouldKeepSpace)
- return false;
- }
- }
- node = node.getParentNode();
- }
- return false;
- }
-
- /**
- */
- protected boolean canInsertBreakAfter(CMElementDeclaration decl) {
- if (decl == null)
- return false;
- if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- if (hint == null)
- return false;
- return (hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END) || hint.equals(HTMLCMProperties.Values.BREAK_AFTER_START));
- }
-
- /**
- */
- protected boolean canInsertBreakAfter(Node node) {
- if (node == null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- Node next = node.getNextSibling();
-
- if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // do not insert break after unclosed tag
- if (!((IDOMElement) node).isClosed())
- return false;
- }
- return true;
- }
- else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) parent;
- // do not insert break before missing end tag
- if (next == null && element.getEndStructuredDocumentRegion() == null)
- return false;
-
- // insert line break under non-HTML elements including JSP elements
- if (element.getPrefix() != null)
- return true;
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl != null) {
- if (decl.getContentType() == CMElementDeclaration.ELEMENT)
- return true;
- String tagName = element.getTagName();
- // special for direct children under BODY
- if (tagName != null && tagName.equalsIgnoreCase(BODY_NAME))
- return true;
- }
- }
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) node;
- CMElementDeclaration decl = getElementDeclaration(element);
- if (canInsertBreakAfter(decl)) {
- // spcial for BR
- return canFormatChild(parent);
- }
- }
- if (next != null && next.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration decl = getElementDeclaration((Element) next);
- if (canInsertBreakBefore(decl))
- return true;
- }
- return false;
- }
-
- /**
- */
- protected boolean canInsertBreakBefore(CMElementDeclaration decl) {
- if (decl == null)
- return false;
- if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- if (hint == null)
- return false;
- return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
- }
-
- /**
- */
- protected boolean canInsertBreakBefore(Node node) {
- if (node == null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- Node prev = node.getPreviousSibling();
-
- if (parent.getNodeType() == Node.DOCUMENT_NODE) {
- if (prev == null)
- return false;
- return true;
- }
- else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) parent;
- // do not insert break after missing start tag
- if (prev == null && element.getStartStructuredDocumentRegion() == null)
- return false;
-
- // insert line break under non-HTML elements including JSP elements
- if (element.getPrefix() != null)
- return true;
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl != null) {
- if (decl.getContentType() == CMElementDeclaration.ELEMENT)
- return true;
- String tagName = element.getTagName();
- // special for direct children under BODY
- if (tagName != null && tagName.equalsIgnoreCase(BODY_NAME))
- return true;
- }
- }
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration decl = getElementDeclaration((Element) node);
- if (canInsertBreakBefore(decl))
- return true;
- }
- if (prev != null && prev.getNodeType() == Node.ELEMENT_NODE) {
- CMElementDeclaration decl = getElementDeclaration((Element) prev);
- if (canInsertBreakAfter(decl)) {
- // spcial for BR
- return canFormatChild(parent);
- }
- }
- return false;
- }
-
- /**
- */
- public void format(Node node) {
- format(node, getFormatContraints());
- }
-
- /**
- */
- public void format(Node node, IStructuredFormatContraints contraints) {
- if (node instanceof IDOMNode && contraints instanceof HTMLFormatContraints)
- format((IDOMNode) node, (HTMLFormatContraints) contraints);
- }
-
- public void format(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (node.getParentNode() == null)
- return; // do not format removed node
-
- setWidth(contraints, node);
-
- if (canInsertBreakBefore(node))
- insertBreakBefore(node, contraints);
-
- formatNode(node, contraints);
-
- if (canInsertBreakAfter(node))
- insertBreakAfter(node, contraints);
- }
-
- /**
- */
- protected void formatChildNodes(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (!node.hasChildNodes())
- return;
-
- // concat adjacent texts
- node.normalize();
-
- // disable sibling indent during formatting all the children
- boolean indent = false;
- if (contraints != null) {
- indent = contraints.getFormatWithSiblingIndent();
- contraints.setFormatWithSiblingIndent(false);
- }
-
- boolean insertBreak = true;
- IDOMNode child = (IDOMNode) node.getFirstChild();
- while (child != null) {
- if (child.getParentNode() != node)
- break;
- IDOMNode next = (IDOMNode) child.getNextSibling();
-
- if (insertBreak && canInsertBreakBefore(child)) {
- insertBreakBefore(child, contraints);
- }
-
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(child, getFormatPreferences());
- if (formatter != null) {
- if (formatter instanceof HTMLFormatter) {
- HTMLFormatter htmlFormatter = (HTMLFormatter) formatter;
- htmlFormatter.formatNode(child, contraints);
- }
- else {
- formatter.format(child);
- }
- }
-
- if (canInsertBreakAfter(child)) {
- insertBreakAfter(child, contraints);
- insertBreak = false; // not to insert twice
- }
- else {
- insertBreak = true;
- }
-
- child = next;
- }
-
- if (contraints != null)
- contraints.setFormatWithSiblingIndent(indent);
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
-
- if (node.hasChildNodes()) { // container
- formatChildNodes(node, contraints);
- }
- else { // leaf
- IStructuredDocumentRegion flatNode = node.getStartStructuredDocumentRegion();
- if (flatNode != null) {
- String source = flatNode.getText();
- if (source != null && source.length() > 0) {
- setWidth(contraints, source);
- }
- }
- }
- }
-
- /**
- */
- protected String getBreakSpaces(Node node) {
- if (node == null)
- return null;
- StringBuffer buffer = new StringBuffer();
-
- String delim = ((IDOMNode) node).getModel().getStructuredDocument().getLineDelimiter();
- if (delim != null && delim.length() > 0)
- buffer.append(delim);
-
- String indent = getIndent();
- if (indent != null && indent.length() > 0) {
- for (Node parent = node.getParentNode(); parent != null; parent = parent.getParentNode()) {
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- break;
- // ignore omitted tag
- if (((IDOMNode) parent).getStartStructuredDocumentRegion() == null)
- continue;
-
- IDOMElement element = (IDOMElement) parent;
- if (element.getPrefix() != null) {
- String localName = element.getLocalName();
- // special for html:html
- if (localName != null && !localName.equals(HTML_NAME)) {
- buffer.append(indent);
- }
- continue;
- }
-
- CMElementDeclaration decl = getElementDeclaration(element);
- if (decl != null && decl.supports(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)) {
- boolean shouldIndent = ((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_INDENT_CHILD_SOURCE)).booleanValue();
- if (shouldIndent)
- buffer.append(indent);
- }
-
- }
- }
-
- return buffer.toString();
- }
-
- /**
- */
- protected String getIndent() {
- return getFormatPreferences().getIndent();
- }
-
- /**
- */
- protected int getLineWidth() {
- return getFormatPreferences().getLineWidth();
- }
-
- /**
- */
- protected CMElementDeclaration getElementDeclaration(Element element) {
- if (element == null)
- return null;
- Document document = element.getOwnerDocument();
- if (document == null)
- return null;
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery == null)
- return null;
- return modelQuery.getCMElementDeclaration(element);
- }
-
- /**
- */
- protected void insertBreakAfter(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (node.getNodeType() == Node.TEXT_NODE)
- return;
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Node next = node.getNextSibling();
-
- String spaces = null;
- if (next == null) { // last spaces
- // use parent indent for the end tag
- spaces = getBreakSpaces(parent);
- }
- else if (next.getNodeType() == Node.TEXT_NODE) {
- if (contraints != null && contraints.getFormatWithSiblingIndent()) {
- IDOMNode text = (IDOMNode) next;
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(text, getFormatPreferences());
- if (formatter instanceof HTMLTextFormatter) {
- HTMLTextFormatter textFormatter = (HTMLTextFormatter) formatter;
- textFormatter.formatText(text, contraints, HTMLTextFormatter.FORMAT_HEAD);
- }
- }
- return;
- }
- else {
- spaces = getBreakSpaces(node);
- }
- if (spaces == null || spaces.length() == 0)
- return;
-
- replaceSource(node.getModel(), node.getEndOffset(), 0, spaces);
- setWidth(contraints, spaces);
- }
-
- /**
- */
- protected void insertBreakBefore(IDOMNode node, HTMLFormatContraints contraints) {
- if (node == null)
- return;
- if (node.getNodeType() == Node.TEXT_NODE)
- return;
- Node parent = node.getParentNode();
- if (parent == null)
- return;
- Node prev = node.getPreviousSibling();
-
- String spaces = null;
- if (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
- if (contraints != null && contraints.getFormatWithSiblingIndent()) {
- IDOMNode text = (IDOMNode) prev;
- IStructuredFormatter formatter = HTMLFormatterFactory.getInstance().createFormatter(text, getFormatPreferences());
- if (formatter instanceof HTMLTextFormatter) {
- HTMLTextFormatter textFormatter = (HTMLTextFormatter) formatter;
- textFormatter.formatText(text, contraints, HTMLTextFormatter.FORMAT_TAIL);
- }
- }
- return;
- }
- else {
- spaces = getBreakSpaces(node);
- }
- if (spaces == null || spaces.length() == 0)
- return;
-
- replaceSource(node.getModel(), node.getStartOffset(), 0, spaces);
- setWidth(contraints, spaces);
- }
-
- /**
- */
- protected boolean isWidthAvailable(HTMLFormatContraints contraints, int width) {
- if (contraints == null)
- return true;
- if (!splitLines() || getLineWidth() < 0)
- return true;
- return (contraints.getAvailableLineWidth() >= width);
- }
-
- /**
- */
- protected boolean keepBlankLines(HTMLFormatContraints contraints) {
- if (contraints == null)
- return true;
- return (!contraints.getClearAllBlankLines());
- }
-
- /**
- */
- protected void replaceSource(IStructuredDocumentRegion flatNode, int offset, int length, String source) {
- if (flatNode == null)
- return;
- IStructuredDocument structuredDocument = flatNode.getParentDocument();
- if (structuredDocument == null)
- return;
- if (source == null)
- source = new String();
- int startOffset = flatNode.getStartOffset();
- if (structuredDocument.containsReadOnly(startOffset + offset, length))
- return;
- // We use 'structuredDocument' as the requester object just so this and the other
- // format-related 'repalceText' (in replaceSource) can use the same requester.
- // Otherwise, if requester is not identical,
- // the undo group gets "broken" into multiple pieces based
- // on the requesters being different. Technically, any unique, common
- // requester object would work.
- structuredDocument.replaceText(structuredDocument, startOffset + offset, length, source);
- }
-
- /**
- */
- protected void replaceSource(IDOMModel model, int offset, int length, String source) {
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- if (source == null)
- source = new String();
- if (structuredDocument.containsReadOnly(offset, length))
- return;
- // We use 'structuredDocument' as the requester object just so this and the other
- // format-related 'repalceText' (in replaceSource) can use the same requester.
- // Otherwise, if requester is not identical,
- // the undo group gets "broken" into multiple pieces based
- // on the requesters being different. Technically, any unique, common
- // requester object would work.
- structuredDocument.replaceText(structuredDocument, offset, length, source);
- }
-
- /**
- */
- protected void setWidth(HTMLFormatContraints contraints, String source) {
- if (contraints == null)
- return;
- if (source == null)
- return;
- int length = source.length();
- if (length == 0)
- return;
-
- if (!splitLines())
- return;
- int lineWidth = getLineWidth();
- if (lineWidth < 0)
- return;
-
- int offset = source.lastIndexOf('\n');
- int offset2 = source.lastIndexOf('\r');
- if (offset2 > offset)
- offset = offset2;
- if (offset >= 0)
- offset++;
-
- int availableWidth = 0;
- if (offset >= 0) {
- availableWidth = lineWidth - (length - offset);
- }
- else {
- availableWidth = contraints.getAvailableLineWidth() - length;
- }
- if (availableWidth < 0)
- availableWidth = 0;
- contraints.setAvailableLineWidth(availableWidth);
- }
-
- /**
- */
- protected void setWidth(HTMLFormatContraints contraints, Node node) {
- if (contraints == null)
- return;
- if (node == null)
- return;
- IStructuredDocument structuredDocument = ((IDOMNode) node).getStructuredDocument();
- if (structuredDocument == null)
- return; // error
-
- if (!splitLines())
- return;
- int lineWidth = getLineWidth();
- if (lineWidth < 0)
- return;
-
- int offset = ((IDOMNode) node).getStartOffset();
- int line = structuredDocument.getLineOfOffset(offset);
- int lineOffset = 0;
- try {
- lineOffset = structuredDocument.getLineOffset(line);
- }
- catch (BadLocationException ex) {
- return; // error
- }
- if (lineOffset > offset)
- return; // error
-
- int availableWidth = lineWidth - (offset - lineOffset);
- if (availableWidth < 0)
- availableWidth = 0;
-
- contraints.setAvailableLineWidth(availableWidth);
- }
-
- /**
- */
- protected boolean splitLines() {
- return true;//getFormatPreferences().getSplitLines();
- }
-
- protected IStructuredFormatPreferences fFormatPreferences = null;
- protected HTMLFormatContraints fFormatContraints = null;
- protected IProgressMonitor fProgressMonitor = null;
-
- //public void format(XMLNode node, FormatContraints formatContraints) {
- // if (formatContraints.getFormatWithSiblingIndent())
- // formatContraints.setCurrentIndent(getSiblingIndent(node));
- //
- // formatNode(node, formatContraints);
- //}
-
- public void setFormatPreferences(IStructuredFormatPreferences formatPreferences) {
- fFormatPreferences = formatPreferences;
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
- ((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-
- public IStructuredFormatContraints getFormatContraints() {
- if (fFormatContraints == null) {
- fFormatContraints = new HTMLFormatContraintsImpl();
-
- fFormatContraints.setAvailableLineWidth(getFormatPreferences().getLineWidth());
- fFormatContraints.setClearAllBlankLines(getFormatPreferences().getClearAllBlankLines());
- }
-
- return fFormatContraints;
- }
-
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
- fProgressMonitor = progressMonitor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.java
deleted file mode 100644
index b17c60ac58..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLFormatterFactory.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.wst.html.core.internal.format;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatPreferences;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatter;
-import org.eclipse.wst.xml.core.internal.provisional.format.IStructuredFormatPreferencesXML;
-import org.eclipse.wst.xml.core.internal.provisional.format.StructuredFormatPreferencesXML;
-import org.w3c.dom.Node;
-
-// nakamori_TODO: check and remove CSS formatting
-
-class HTMLFormatterFactory {
- private static HTMLFormatterFactory fInstance = null;
- protected IStructuredFormatPreferencesXML fFormatPreferences = null;
-
- static synchronized HTMLFormatterFactory getInstance() {
- if (fInstance == null) {
- fInstance = new HTMLFormatterFactory();
- }
- return fInstance;
- }
-
- protected IStructuredFormatter createFormatter(Node node, IStructuredFormatPreferences formatPreferences) {
- IStructuredFormatter formatter = null;
-
- switch (node.getNodeType()) {
- case Node.ELEMENT_NODE :
- formatter = new HTMLElementFormatter();
- break;
- case Node.TEXT_NODE :
- if (isEmbeddedCSS(node)) {
- formatter = new EmbeddedCSSFormatter();
- }
- else {
- formatter = new HTMLTextFormatter();
- }
- break;
- default :
- formatter = new HTMLFormatter();
- break;
- }
-
- // init FormatPreferences
- formatter.setFormatPreferences(formatPreferences);
-
- return formatter;
- }
-
- /**
- */
- private boolean isEmbeddedCSS(Node node) {
- if (node == null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null)
- return false;
- if (parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
- String name = parent.getNodeName();
- if (name == null)
- return false;
- return name.equalsIgnoreCase("STYLE");//$NON-NLS-1$
- }
-
-
- private HTMLFormatterFactory() {
- super();
- }
-
- protected IStructuredFormatPreferencesXML getFormatPreferences() {
- if (fFormatPreferences == null) {
- fFormatPreferences = new StructuredFormatPreferencesXML();
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
- fFormatPreferences.setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
- fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
-
- char indentChar = ' ';
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- if (HTMLCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- fFormatPreferences.setIndent(indent.toString());
- }
- }
-
- return fFormatPreferences;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
deleted file mode 100644
index a152f8241e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLTextFormatter.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.format;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.HTMLFormatContraints;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLTextFormatter extends HTMLFormatter {
-
- public static int FORMAT_ALL = 0;
- public static int FORMAT_HEAD = 1;
- public static int FORMAT_TAIL = 2;
-
- /**
- */
- protected HTMLTextFormatter() {
- super();
- }
-
- /**
- */
- private boolean canFormatText(IDOMText text) {
- if (text == null)
- return false;
-
- IStructuredDocumentRegion flatNode = text.getFirstStructuredDocumentRegion();
- if (flatNode != null) {
- String type = flatNode.getType();
- if (isUnparsedRegion(type))
- return false;
- }
-
- Node parent = text.getParentNode();
- if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
- IDOMElement element = (IDOMElement) parent;
- if (!element.isGlobalTag() && !text.isElementContentWhitespace())
- return false;
- }
-
- return canFormatChild(parent);
- }
-
- private boolean isUnparsedRegion(String type) {
- boolean result = isNestedScannedRegion(type) || isBlockScannedRegion(type);
- return result;
- }
-
- private boolean isBlockScannedRegion(String type) {
- return type == DOMRegionContext.BLOCK_TEXT;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on
- * "nestedContext".
- */
- private boolean isNestedScannedRegion(String type) {
- final String JSP_CONTENT = "JSP_CONTENT"; //$NON-NLS-1$
- return type.equals(JSP_CONTENT);
- }
-
- /**
- */
- private boolean canRemoveHeadingSpaces(IDOMNode node) {
- if (node == null)
- return false;
- if (node.getPreviousSibling() != null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
-
- CMElementDeclaration decl = getElementDeclaration((Element) parent);
- if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
- }
-
- /**
- */
- private boolean canRemoveTailingSpaces(IDOMNode node) {
- if (node == null)
- return false;
- if (node.getNextSibling() != null)
- return false;
- Node parent = node.getParentNode();
- if (parent == null || parent.getNodeType() != Node.ELEMENT_NODE)
- return false;
-
- CMElementDeclaration decl = getElementDeclaration((Element) parent);
- if (decl == null || (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)))
- return false;
- String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT);
- return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END);
- }
-
- /**
- */
- protected void formatNode(IDOMNode node, HTMLFormatContraints contraints) {
- formatText(node, contraints, FORMAT_ALL); // full format
- }
-
- /**
- */
- protected void formatText(IDOMNode node, HTMLFormatContraints contraints, int mode) {
- if (node == null)
- return;
- Node parent = node.getParentNode();
- if (parent == null)
- return;
-
- IDOMText text = (IDOMText) node;
- String source = text.getSource();
-
- if (!canFormatText(text)) {
- setWidth(contraints, source);
- return;
- }
-
- int offset = text.getStartOffset();
- int length = text.getEndOffset() - offset;
-
- // format adjacent text at once
- if (mode == FORMAT_HEAD) {
- Node next = node.getNextSibling();
- while (next != null && next.getNodeType() == Node.TEXT_NODE) {
- IDOMText nextText = (IDOMText) next;
- length += (nextText.getEndOffset() - nextText.getStartOffset());
- String nextSource = nextText.getSource();
- if (nextSource != null && nextSource.length() > 0) {
- if (source == null)
- source = nextSource;
- else
- source += nextSource;
- }
- next = next.getNextSibling();
- }
- }
- else if (mode == FORMAT_TAIL) {
- Node prev = node.getPreviousSibling();
- while (prev != null && prev.getNodeType() == Node.TEXT_NODE) {
- IDOMText prevText = (IDOMText) prev;
- offset = prevText.getStartOffset();
- length += (prevText.getEndOffset() - offset);
- String prevSource = prevText.getSource();
- if (prevSource != null && prevSource.length() > 0) {
- if (source == null)
- source = prevSource;
- else
- source = prevSource + source;
- }
- prev = prev.getPreviousSibling();
- }
- }
-
- SpaceConverter converter = new SpaceConverter(source, keepBlankLines(contraints));
-
- int wordLength = converter.nextWord();
- if (wordLength == 0) { // only spaces
- if (!converter.hasSpaces())
- return; // empty
- boolean removeSpaces = false;
- if (parent.getNodeType() == Node.ELEMENT_NODE) {
- // check if tags are omitted
- IDOMNode element = (IDOMNode) parent;
- if (node.getPreviousSibling() == null && element.getStartStructuredDocumentRegion() == null) {
- removeSpaces = true;
- }
- else if (node.getNextSibling() == null && element.getEndStructuredDocumentRegion() == null) {
- removeSpaces = true;
- }
- }
- if (removeSpaces) {
- converter.replaceSpaces(null);
- }
- else if (!isWidthAvailable(contraints, 2) || canInsertBreakAfter(node) || canInsertBreakBefore(node)) {
- String spaces = null;
- if (node.getNextSibling() == null) { // last spaces
- // use parent indent for the end tag
- spaces = getBreakSpaces(parent);
- }
- else {
- spaces = getBreakSpaces(node);
- }
- converter.replaceSpaces(spaces);
- setWidth(contraints, spaces);
- }
- else if (canRemoveHeadingSpaces(node) || canRemoveTailingSpaces(node)) {
- converter.replaceSpaces(null);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- }
- else {
- String breakSpaces = null;
-
- // format heading spaces
- boolean hasSpaces = converter.hasSpaces();
- if (mode == FORMAT_TAIL) {
- // keep spaces as is
- addWidth(contraints, converter.getSpaceCount());
- }
- else if ((hasSpaces && !isWidthAvailable(contraints, wordLength + 1)) || canInsertBreakBefore(node)) {
- breakSpaces = getBreakSpaces(node);
- converter.replaceSpaces(breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- if (hasSpaces) {
- if (canRemoveHeadingSpaces(node)) {
- converter.replaceSpaces(null);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- }
- }
- addWidth(contraints, wordLength);
-
- // format middle
- wordLength = converter.nextWord();
- while (wordLength > 0) {
- if (mode != FORMAT_ALL) {
- // keep spaces as is
- addWidth(contraints, converter.getSpaceCount());
- }
- else if (!isWidthAvailable(contraints, wordLength + 1)) {
- if (breakSpaces == null)
- breakSpaces = getBreakSpaces(node);
- converter.replaceSpaces(breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- addWidth(contraints, wordLength);
- wordLength = converter.nextWord();
- }
-
- // format tailing spaces
- hasSpaces = converter.hasSpaces();
- if (mode == FORMAT_HEAD) {
- // keep spaces as is
- addWidth(contraints, converter.getSpaceCount());
- }
- else if ((hasSpaces && !isWidthAvailable(contraints, 2)) || canInsertBreakAfter(node)) {
- if (node.getNextSibling() == null) { // last test
- // use parent indent for the end tag
- breakSpaces = getBreakSpaces(parent);
- }
- else {
- if (breakSpaces == null)
- breakSpaces = getBreakSpaces(node);
- }
- converter.replaceSpaces(breakSpaces);
- setWidth(contraints, breakSpaces);
- }
- else {
- if (hasSpaces) {
- if (canRemoveTailingSpaces(node)) {
- converter.replaceSpaces(null);
- }
- else {
- converter.compressSpaces();
- addWidth(contraints, 1);
- }
- }
- }
- }
-
- if (converter.isModified()) {
- source = converter.getSource();
- replaceSource(text.getModel(), offset, length, source);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java
deleted file mode 100644
index a7b6f66bf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/SpaceConverter.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.format;
-
-
-
-final class SpaceConverter {
-
- private String source = null;
- private int length = 0;
- private int startOffset = 0;
- private int endOffset = 0;
- private int spaceCount = 0;
- private int wordCount = 0;
- private StringBuffer buffer = null;
- private int lastOffset = 0;
- private boolean keepBlankLines = false;
-
- /**
- */
- public SpaceConverter(String source) {
- super();
-
- if (source == null) {
- this.source = new String();
- }
- else {
- this.source = source;
- this.length = source.length();
- }
- }
-
- /**
- */
- public SpaceConverter(String source, boolean keepBlankLines) {
- super();
-
- if (source == null) {
- this.source = new String();
- }
- else {
- this.source = source;
- this.length = source.length();
- }
- this.keepBlankLines = keepBlankLines;
- }
-
- /**
- */
- public void compressSpaces() {
- if (this.spaceCount == 0)
- return;
- if (this.spaceCount == 1 && this.source.charAt(this.startOffset) == ' ')
- return;
-
- if (this.buffer == null)
- this.buffer = new StringBuffer();
- if (this.startOffset > this.lastOffset) {
- this.buffer.append(this.source.substring(this.lastOffset, this.startOffset));
- }
-
- this.buffer.append(' ');
-
- this.lastOffset = this.startOffset + this.spaceCount;
- }
-
- /**
- */
- public String getSource() {
- if (this.buffer == null)
- this.buffer = new StringBuffer();
- if (this.length > this.lastOffset) {
- this.buffer.append(this.source.substring(this.lastOffset, this.length));
- }
- return this.buffer.toString();
- }
-
- /**
- */
- public int getSpaceCount() {
- return this.spaceCount;
- }
-
- /**
- */
- public boolean hasSpaces() {
- return (this.spaceCount > 0);
- }
-
- /**
- */
- public boolean isModified() {
- return (this.buffer != null);
- }
-
- /**
- * Add number of the old blank lines to new space string
- */
- private static String mergeBlankLines(String newSpaces, String oldSpaces) {
- if (newSpaces == null || newSpaces.length() == 0)
- return newSpaces;
- if (oldSpaces == null)
- return newSpaces;
-
- // count old new lines
- int newLineCount = 0;
- int oldLength = oldSpaces.length();
- for (int i = 0; i < oldLength; i++) {
- char c = oldSpaces.charAt(i);
- if (c == '\r') {
- newLineCount++;
- if (i + 1 < oldLength) {
- c = oldSpaces.charAt(i + 1);
- if (c == '\n')
- i++;
- }
- }
- else {
- if (c == '\n')
- newLineCount++;
- }
- }
- if (newLineCount < 2)
- return newSpaces; // no blank line
-
- // here assuming newSpaces starts with a new line if any
- String delim = null;
- char d = newSpaces.charAt(0);
- if (d == '\r') {
- if (newSpaces.length() > 1 && newSpaces.charAt(1) == '\n')
- delim = "\r\n";//$NON-NLS-1$
- else
- delim = "\r";//$NON-NLS-1$
- }
- else {
- if (d == '\n')
- delim = "\n";//$NON-NLS-1$
- else
- return newSpaces; // no new line
- }
-
- newLineCount--;
- StringBuffer buffer = new StringBuffer(newSpaces.length() + newLineCount * 2);
- while (newLineCount > 0) {
- buffer.append(delim);
- newLineCount--;
- }
- buffer.append(newSpaces);
- return buffer.toString();
- }
-
- /**
- */
- public int nextWord() {
- if (this.endOffset == this.length) {
- this.startOffset = this.endOffset;
- this.spaceCount = 0;
- this.wordCount = 0;
- return 0;
- }
-
- this.startOffset = this.endOffset;
- int i = this.startOffset;
- for (; i < this.length; i++) {
- if (!Character.isWhitespace(this.source.charAt(i)))
- break;
- }
- this.spaceCount = i - this.startOffset;
-
- int wordOffset = i;
- for (; i < this.length; i++) {
- if (Character.isWhitespace(this.source.charAt(i)))
- break;
- }
- this.wordCount = i - wordOffset;
- this.endOffset = i;
-
- return this.wordCount;
- }
-
- /**
- */
- public void replaceSpaces(String spaces) {
- int spaceLength = (spaces != null ? spaces.length() : 0);
- String oldSpaces = null;
- if (spaceLength == this.spaceCount) {
- if (spaceLength == 0)
- return;
- if (this.startOffset == 0) {
- if (this.source.startsWith(spaces))
- return;
- }
- else if (this.endOffset == this.length) {
- if (this.source.endsWith(spaces))
- return;
- }
- else {
- int textOffset = this.startOffset + this.spaceCount;
- oldSpaces = this.source.substring(this.startOffset, textOffset);
- if (oldSpaces.equals(spaces))
- return;
- }
- }
- if (this.keepBlankLines && this.spaceCount > 0) {
- if (oldSpaces == null) {
- int textOffset = this.startOffset + this.spaceCount;
- oldSpaces = this.source.substring(this.startOffset, textOffset);
- }
- if (oldSpaces != null) {
- spaces = mergeBlankLines(spaces, oldSpaces);
- }
- }
-
- if (this.buffer == null)
- this.buffer = new StringBuffer();
- if (this.startOffset > this.lastOffset) {
- this.buffer.append(this.source.substring(this.lastOffset, this.startOffset));
- }
-
- if (spaceLength > 0)
- this.buffer.append(spaces);
-
- this.lastOffset = this.startOffset + this.spaceCount;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.java
deleted file mode 100644
index aa1be40742..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractCSSModelAdapter.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.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.document.CSSModelImpl;
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-/**
- */
-public abstract class AbstractCSSModelAdapter implements ICSSModelAdapter {
- private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
-
- private Element element = null;
- private ICSSModel model = null;
-
- /**
- */
- AbstractCSSModelAdapter() {
- super();
- }
-
- /**
- */
- protected ICSSModel createModel() {
- // create embedded CSS model (not for external CSS)
- if (getElement() == null)
- return null;
- IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
- ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
- ((CSSModelImpl) newModel).setOwnerDOMNode(getElement());
- return newModel;
- }
-
- /**
- */
- public Element getElement() {
- return this.element;
- }
-
- /**
- */
- protected ICSSModel getExistingModel() {
- return this.model;
- }
-
- /**
- */
- protected void notifyStyleChanged(Element target) {
- INodeNotifier notifier = (INodeNotifier) target;
- if (notifier == null)
- return;
- Collection adapters = notifier.getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof StyleListener) {
- StyleListener listener = (StyleListener) adapter;
- listener.styleChanged();
- }
- }
- }
-
- /**
- */
- void setElement(Element element) {
- this.element = element;
- }
-
- /**
- * check
- * 1. If attributes of element is valid (type,rel ...)
- * 2. If content model supports this element / attribute (future ?)
- */
- protected boolean isValidAttribute() {
- return (getElement() != null);
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- this.model = model;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java
deleted file mode 100644
index 90514836eb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/AbstractStyleSheetAdapter.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004-2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- * Masaki Saitoh (MSAITOH@jp.ibm.com)
- * See Bug 153000 Style Adapters should be lazier
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153000
- *
- ********************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.document.XMLModelNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-import org.w3c.dom.traversal.DocumentTraversal;
-import org.w3c.dom.traversal.NodeFilter;
-import org.w3c.dom.traversal.NodeIterator;
-
-/**
- */
-public abstract class AbstractStyleSheetAdapter extends AbstractCSSModelAdapter implements ICSSStyleListener, IStyleSheetAdapter {
-
- // this variable to hold the class is just a VAJava trick.
- // it improves performance in VAJava by minimizing class loading.
- private final Class StyleSheetAdapterClass = IStyleSheetAdapter.class;
- private Collection styleChangedNodes;
-
- /**
- */
- protected AbstractStyleSheetAdapter() {
- super();
- }
-
- /**
- */
- protected ICSSModel createModel() {
- return createModel(true);
- }
-
- /**
- */
- protected ICSSModel createModel(boolean notify) {
- ICSSModel newModel = super.createModel();
- if (notify && newModel != null) {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
- }
- return newModel;
- }
-
- /**
- */
- public StyleSheet getSheet() {
- ICSSModel model = getModel();
- if (model == null)
- return null;
- return (StyleSheet) model.getDocument();
- }
-
- /**
- * 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 == StyleSheetAdapterClass);
- }
-
- /**
- */
- public void released() {
- ICSSModel currentModel = getModel();
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-
- setElement(null);
- setModel(null);
-
- if (adapter != null)
- adapter.modelReleased(currentModel);
-
- if (currentModel != null)
- currentModel.releaseFromRead();
- }
-
- /**
- */
- public void removed() {
- ICSSModel currentModel = getModel();
-
- setModel(null);
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null)
- adapter.modelRemoved(currentModel);
-
- if (currentModel != null)
- currentModel.releaseFromRead();
- }
-
- /**
- * @param srcModel com.ibm.sed.css.model.interfaces.ICSSModel
- * @param removed com.ibm.sed.css.model.interfaces.ICSSSelector[]
- * @param added com.ibm.sed.css.model.interfaces.ICSSSelector[]
- * @param media java.lang.String
- */
- public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- Element element = getElement();
- if (element == null)
- return; // might released
- Document doc = element.getOwnerDocument();
- if (doc == null)
- return; // error
-
- // to notify GEF tree
- if (doc instanceof INodeNotifier) {
- Collection adapters = ((INodeNotifier) doc).getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof ICSSStyleListener) {
- ((ICSSStyleListener) adapter).styleChanged(srcModel, removed, added, media);
- }
- }
- }
- //
-
- if (styleChangedNodes == null) {
- styleChangedNodes = new HashSet();
- }
-
- try {
- int removedSelNum = removed != null ? removed.length : 0;
- int addedSelNum = added != null ? added.length : 0;
-
- NodeIterator iter = ((DocumentTraversal) doc).createNodeIterator(doc, NodeFilter.SHOW_ELEMENT, null, true);
- Node node;
- while ((node = iter.nextNode()) != null) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element elm = (Element) node;
- boolean match = false;
- int i;
- for (i = 0; i < removedSelNum && !match; i++) {
- match = removed[i].match(elm, null);
- }
- for (i = 0; i < addedSelNum && !match; i++) {
- match = added[i].match(elm, null);
- }
- if (match) {
- if (!styleChangedNodes.contains(elm))
- styleChangedNodes.add(elm);
- // notifyStyleChanged(elm);
- }
- }
- }
- }
- catch (ClassCastException ex) {
- // Document doesn't implement DocumentTraversal...
- }
-
- }
-
- /**
- * @param srcModel com.ibm.sed.css.model.interfaces.ICSSModel
- */
- public void styleUpdate(ICSSModel srcModel) {
- IDOMNode node = (IDOMNode) getElement();
- if (node == null)
- return;
- IDOMModel model = node.getModel();
- if (model == null)
- return;
- XMLModelNotifier notifier = model.getModelNotifier();
- if (notifier == null)
- return;
-
- // before updating, all sub-models should be loaded!
- DocumentStyle document = (DocumentStyle) model.getDocument();
- StyleSheetList styles = document.getStyleSheets();
- if (styles != null) {
- int n = styles.getLength();
- ImportedCollector trav = new ImportedCollector();
- for (int i = 0; i < n; i++) {
- org.w3c.dom.stylesheets.StyleSheet sheet = styles.item(i);
- if (sheet instanceof ICSSNode)
- trav.apply((ICSSNode) sheet);
- }
- }
-
- // flash style changed events
- if (styleChangedNodes != null) {
- Object[] elements = styleChangedNodes.toArray();
- for (int i = 0; elements != null && i < elements.length; i++)
- notifyStyleChanged((Element) elements[i]);
- styleChangedNodes.clear();
- }
-
- // to notify GEF tree
- if (document instanceof INodeNotifier) {
- Collection adapters = ((INodeNotifier) document).getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof ICSSStyleListener) {
- ((ICSSStyleListener) adapter).styleUpdate(srcModel);
- }
- }
- }
-
- notifier.propertyChanged(node);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.java
deleted file mode 100644
index 6572ae64fb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryContext.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.wst.html.core.internal.htmlcss;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.declaration.CSSPropertyContext;
-
-/**
- */
-class CSSQueryContext extends CSSPropertyContext {
-
- /**
- */
- public CSSQueryContext() {
- super();
- }
-
- /**
- */
- public CSSQueryContext(ICSSStyleDeclaration decl) {
- super(decl);
- }
-
- /**
- *
- */
- public void applyFull(ICSSStyleDeclaration decl) {
- if (decl == null)
- return;
- Enumeration keys = fProperties.keys();
- while (keys.hasMoreElements()) {
- Object key = keys.nextElement();
- Object val = fProperties.get(key);
-
- if (val instanceof CSSQueryDeclarationData) {
- ICSSStyleDeclItem declItem = ((CSSQueryDeclarationData) val).getDeclItem();
- if (declItem.getLength() <= 0) {
- ICSSStyleDeclItem itemToRemove = decl.getDeclItemNode(key.toString());
- if (itemToRemove != null) {
- decl.removeDeclItemNode(itemToRemove);
- }
- }
- else {
- decl.setDeclItemNode(declItem);
- }
- }
- else {
- String value = (val instanceof ICSSValue) ? ((ICSSValue) val).getCSSValueText() : val.toString();
-
- if (value == null || value.length() <= 0) {
- ICSSStyleDeclItem itemToRemove = decl.getDeclItemNode(key.toString());
- if (itemToRemove != null) {
- decl.removeDeclItemNode(itemToRemove);
- }
- }
- else {
- decl.setProperty(key.toString(), value, null);
- }
- }
- }
- }
-
- /**
- */
- private boolean check(String propName, boolean important, int specificity) {
- Object current = fProperties.get(propName);
- if (current != null && current instanceof CSSQueryValueData) {
- CSSQueryValueData currentValue = (CSSQueryValueData) current;
- if ((!important && currentValue.important) || (currentValue.getSpecificity() > specificity)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- */
- public void overrideWithExpand(ICSSStyleDeclaration decl, int specificity) {
- if (decl == null)
- return;
-
- CSSLinkConverter conv = new CSSLinkConverter(decl.getOwnerDocument().getModel());
-
- int nProperties = decl.getLength();
- for (int i = 0; i < nProperties; i++) {
- String propName = decl.item(i);
- if (propName != null) {
- String propN = propName.trim().toLowerCase();
- if (propN.length() != 0) {
- PropCMProperty prop = PropCMProperty.getInstanceOf(propN);
- String priority = decl.getPropertyPriority(propName);
- boolean important = priority != null && priority.length() > 0;
- if (prop != null && prop.isShorthand()) {
- // expand shorthand property
- CSSQueryContext context = new CSSQueryContext();
- expandToLeaf(prop, decl.getPropertyValue(propName), context);
-
- Enumeration properties = context.properties();
- while (properties.hasMoreElements()) {
- propN = properties.nextElement().toString();
- if (check(propN, important, specificity)) {
- fProperties.put(propN, new CSSQueryValueData(conv.toAbsolute(context.get(propN)), important, specificity));
- }
- }
- }
- else {
- if (check(propN, important, specificity)) {
- ICSSStyleDeclItem declItem = (ICSSStyleDeclItem) decl.getDeclItemNode(propName).cloneNode(true);
- int nValues = declItem.getLength();
- for (int j = 0; j < nValues; j++) {
- conv.toAbsolute(declItem.item(j));
- }
- declItem.setPriority(null);
- fProperties.put(propN, new CSSQueryDeclarationData(declItem, important, specificity));
- }
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.java
deleted file mode 100644
index a156d20050..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryDeclarationData.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.wst.html.core.internal.htmlcss;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-
-
-
-/**
- */
-public class CSSQueryDeclarationData extends CSSQueryValueData {
-
-
- ICSSStyleDeclItem declItem;
-
- public CSSQueryDeclarationData(ICSSStyleDeclItem declItem, boolean imp, int specificity) {
- super(null, imp, specificity);
- this.declItem = declItem;
- }
-
- /**
- */
- ICSSStyleDeclItem getDeclItem() {
- return declItem;
- }
-
- /**
- */
- public String toString() {
- if (value == null && declItem != null) {
- value = declItem.getCSSValueText();
- }
- return value;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java
deleted file mode 100644
index 04f6b6dfd5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryTraverser.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.AbstractCssTraverser;
-import org.eclipse.wst.css.core.internal.util.CSSStyleDeclarationFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-/**
- */
-public class CSSQueryTraverser extends AbstractCssTraverser {
-
- private Element element;
- private String pseudoName;
- private CSSQueryContext context = null;
- ICSSStyleDeclaration decl = null;
-
- /**
- */
- public ICSSStyleDeclaration getDeclaration() {
- try {
- ICSSStyleDeclaration inlineStyle = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
- if (inlineStyle != null) {
- if (context == null) {
- context = new CSSQueryContext();
- }
- context.overrideWithExpand(inlineStyle, 10000);
- // style attribute's specificity is 100 (in CSS2 spec.) and
- // our implement use 100 as base number (see CSSSelector.java)
- }
- }
- catch (ClassCastException ex) {
- // element is not ElementCSSInlineStyle ???
- }
- if (context == null)
- return null;
-
- if (decl == null)
- decl = CSSStyleDeclarationFactory.getInstance().createStyleDeclaration();
- context.applyFull(decl);
- return decl;
- }
-
- /**
- */
- private void overwriteDeclaration(ICSSStyleDeclaration d, int specificity) {
- if (d == null)
- return;
- if (context == null)
- context = new CSSQueryContext();
- context.overrideWithExpand(d, specificity);
- }
-
- /**
- */
- protected short postNode(ICSSNode node) {
- return TRAV_CONT;
- }
-
- /**
- */
- protected short preNode(ICSSNode node) {
- if (node instanceof ICSSStyleRule) {
- // style rule
- ICSSStyleRule style = (ICSSStyleRule) node;
- ICSSSelectorList list = style.getSelectors();
- int nSelectors = list.getLength();
- int maxSpecificity = -1;
- for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
- // Check each Selector Lists
- ICSSSelector selector = list.getSelector(iSelector);
- int specificity = selector.getSpecificity();
- if (maxSpecificity < specificity && selector.match(element, pseudoName)) {
- maxSpecificity = specificity;
- }
- }
- if (maxSpecificity >= 0) {
- // apply this style to the element
- overwriteDeclaration((ICSSStyleDeclaration) style.getStyle(), maxSpecificity);
- }
- return TRAV_PRUNE;
- }
- return TRAV_CONT;
- }
-
- /**
- */
- private void resetContext() {
- context = null;
- }
-
- /**
- */
- public void setElement(Element element, String pseudoName) {
- this.element = element;
- this.pseudoName = pseudoName;
- resetContext();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.java
deleted file mode 100644
index edd74cd1c8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/CSSQueryValueData.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.html.core.internal.htmlcss;
-
-import org.eclipse.wst.css.core.internal.util.declaration.ValueData;
-
-
-
-/**
- */
-class CSSQueryValueData extends ValueData {
-
- private int specificity;
-
- /**
- */
- public CSSQueryValueData() {
- super();
- }
-
- /**
- */
- public CSSQueryValueData(String val, boolean imp) {
- super(val, imp);
- }
-
- /**
- */
- public CSSQueryValueData(String val, boolean imp, int specificity) {
- super(val, imp);
- this.specificity = specificity;
- }
-
- /**
- */
- int getSpecificity() {
- return specificity;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java
deleted file mode 100644
index 92ceb160e4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLDocumentAdapter.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.htmlcss;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSClassTraverser;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.html.core.internal.contentmodel.JSP11Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-
-
-/**
- */
-public class HTMLDocumentAdapter implements IStyleSheetListAdapter, StyleSheetList {
-
- private Document document = null;
- private Vector styleAdapters = null;
- private Vector oldStyleAdapters = null;
-
- /**
- */
- HTMLDocumentAdapter() {
- super();
- }
-
- /**
- */
- private void addStyleSheet(Element node) {
- IDOMElement element = (IDOMElement) node;
- String tagName = element.getTagName();
- if (tagName == null)
- return;
- boolean isContainer = false;
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || (!element.isGlobalTag() && element.isContainer())) {
- isContainer = true;
- }
- else if (element.isCommentTag()) {
- Node parent = element.getParentNode();
- if (parent == element.getOwnerDocument()) {
- // This condition is too severe, actually do not work for JSF template.
- // But above (! globalTag() && isContainer()) cover JSF template + tpl template
- isContainer = true;
- }
- else if (parent.getNodeType() == Node.ELEMENT_NODE) {
- tagName = ((Element) parent).getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD)) {
- isContainer = true;
- }
- }
- }
-
- else {
- String localName = element.getLocalName();
- if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
- // taglib html tag
- isContainer = true;
- }
- else {
- INodeNotifier notifier = element;
- INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter != null && adapter instanceof IStyleSheetAdapter) {
- this.styleAdapters.addElement(adapter);
- }
- }
- }
- if (isContainer) {
- INodeNotifier notifier = element;
- if (notifier.getExistingAdapter(IStyleSheetListAdapter.class) == null) {
- notifier.addAdapter(this);
- }
- for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- addStyleSheet((Element) child);
- }
- }
- }
-
- /**
- */
- void childReplaced() {
- if (this.styleAdapters == null)
- return;
-
- // backup old adapters to be released on updating in getStyleSheets()
- this.oldStyleAdapters = this.styleAdapters;
- // invalidate the list
- this.styleAdapters = null;
-
- notifyStyleSheetsChanged(this.document);
- }
-
- /**
- */
- public Enumeration getClasses() {
- StyleSheetList sheetList = getStyleSheets();
- int nSheets = sheetList.getLength();
-
- final ArrayList classes = new ArrayList();
-
- CSSClassTraverser traverser = new CSSClassTraverser();
- traverser.setTraverseImported(true);
-
- for (int i = 0; i < nSheets; i++) {
- org.w3c.dom.stylesheets.StyleSheet sheet = sheetList.item(i);
- if (sheet instanceof ICSSNode) {
- traverser.apply((ICSSNode) sheet);
- }
- }
- classes.addAll(traverser.getClassNames());
-
- return new Enumeration() {
- int i = 0;
-
- public boolean hasMoreElements() {
- return i < classes.size();
- }
-
- public Object nextElement() {
- return classes.get(i++);
- }
- };
- }
-
- /**
- */
- private List getValidAdapters() {
- Vector validAdapters = new Vector();
- if (this.styleAdapters != null) {
- Iterator i = this.styleAdapters.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- if (obj instanceof AbstractStyleSheetAdapter && ((AbstractStyleSheetAdapter) obj).isValidAttribute()) {
- validAdapters.add(obj);
- }
- }
- }
- return validAdapters;
- }
-
- /**
- */
- public int getLength() {
- return getValidAdapters().size();
- }
-
- /**
- */
- public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName) {
- StyleSheetList ssl = getStyleSheets();
- int numStyles = ssl.getLength();
-
- CSSQueryTraverser query = new CSSQueryTraverser();
- query.setTraverseImported(true);
- query.setTraverseImportFirst(true);
- query.setElement(element, pseudoName);
-
- for (int i = 0; i < numStyles; i++) {
- // loop for styles (<style> and <link>)
- org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
-
- try {
- query.apply((ICSSNode) ss);
- }
- catch (ClassCastException ex) {
- // I can handle only CSS style
- }
- }
-
- return query.getDeclaration();
- }
-
- /**
- */
- public StyleSheetList getStyleSheets() {
- if (this.styleAdapters == null) {
- if (this.document == null)
- return null;
-
- this.styleAdapters = new Vector();
- for (Node child = this.document.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.ELEMENT_NODE)
- continue;
- addStyleSheet((Element) child);
- }
-
- removeOldStyleSheets();
- }
- return this;
- }
-
- /**
- * 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 == IStyleSheetListAdapter.class);
- }
-
- /**
- */
- public StyleSheet item(int index) {
- if (this.styleAdapters == null)
- return null;
-
- List validAdapters = getValidAdapters();
-
- if (index < 0 || index >= validAdapters.size())
- return null;
- StyleSheet sheet = ((IStyleSheetAdapter) validAdapters.get(index)).getSheet();
- if (sheet == null) {// for LINK element whose link is broken
- ICSSModel model = ((AbstractStyleSheetAdapter) validAdapters.get(index)).createModel();
- sheet = ((model != null) ? (StyleSheet) model.getDocument() : null);
- }
- return sheet;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- Node node = null;
- switch (eventType) {
- case INodeNotifier.ADD :
- node = (Node) newValue;
- break;
- case INodeNotifier.REMOVE :
- node = (Node) oldValue;
- break;
- case INodeNotifier.CHANGE :
- node = (Node) notifier;
- break;
- default :
- break;
- }
- if (node == null || node.getNodeType() != Node.ELEMENT_NODE)
- return;
- IDOMElement element = (IDOMElement) node;
- String tagName = element.getTagName();
- if (tagName == null)
- return;
-
- if (eventType == INodeNotifier.CHANGE) {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE)) {
- refreshAdapters();
- }
- }
- else {
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.HEAD) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK) || tagName.equalsIgnoreCase(HTML40Namespace.ElementName.NOSCRIPT) || tagName.equalsIgnoreCase(JSP11Namespace.ElementName.ROOT) || element.isCommentTag() || (!element.isGlobalTag() && element.isContainer())) {
- childReplaced();
- }
- else if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.BASE)) {
- refreshAdapters();
- }
- else {
- String localName = element.getLocalName();
- if (localName != null && localName.equalsIgnoreCase(HTML40Namespace.ElementName.HTML)) {
- // taglib html tag
- childReplaced();
- }
- }
- }
- }
-
- /**
- * reload LINK / @import if BASE changed
- */
- private void refreshAdapters() {
- Iterator iAdapter = this.styleAdapters.iterator();
- while (iAdapter.hasNext()) {
- Object adapter = iAdapter.next();
- if (adapter instanceof LinkElementAdapter) {
- ((LinkElementAdapter) adapter).refreshSheet();
- }
- else if (adapter instanceof StyleElementAdapter) {
- ICSSModel model = ((StyleElementAdapter) adapter).getModel();
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(model);
- Iterator iRule = trav.getRules().iterator();
- while (iRule.hasNext()) {
- ICSSImportRule rule = (ICSSImportRule) iRule.next();
- rule.refreshStyleSheet();
- }
- }
- }
- }
-
- /**
- */
- private void notifyStyleSheetsChanged(Document target) {
- INodeNotifier notifier = (INodeNotifier) target;
- if (notifier == null)
- return;
- Collection adapters = notifier.getAdapters();
- if (adapters == null)
- return;
- Iterator it = adapters.iterator();
- if (it == null)
- return;
- while (it.hasNext()) {
- INodeAdapter adapter = (INodeAdapter) it.next();
- if (adapter instanceof StyleListener) {
- StyleListener listener = (StyleListener) adapter;
- listener.styleChanged();
- }
- }
- }
-
- /**
- */
- private void releaseOldStyleSheets() {
- if (this.oldStyleAdapters == null)
- return;
- Iterator it = this.oldStyleAdapters.iterator();
- while (it.hasNext()) {
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
- if (adapter == null)
- continue;
- // if the same adapter is in the current list,
- // do not release
- if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
- continue;
- adapter.released();
- }
- this.oldStyleAdapters = null;
- }
-
- /**
- */
- public void releaseStyleSheets() {
- releaseOldStyleSheets();
-
- if (this.styleAdapters == null)
- return;
- Iterator it = this.styleAdapters.iterator();
- while (it.hasNext()) {
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
- if (adapter != null)
- adapter.released();
- }
- this.styleAdapters = null;
- }
-
- /**
- */
- private void removeOldStyleSheets() {
- if (this.oldStyleAdapters == null)
- return;
- Iterator it = this.oldStyleAdapters.iterator();
- while (it.hasNext()) {
- IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
- if (adapter == null)
- continue;
- // if the same adapter is in the current list,
- // do not release
- if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
- continue;
- adapter.removed();
- }
- this.oldStyleAdapters = null;
- }
-
- /**
- */
- void setDocument(Document document) {
- this.document = document;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.java
deleted file mode 100644
index ba347c92f1..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapter.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.wst.html.core.internal.htmlcss;
-
-
-
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Element;
-
-/**
- * Insert the type's description here.
- */
-public class HTMLStyleSelectorAdapter implements IStyleSelectorAdapter {
-
- static private HTMLStyleSelectorAdapter instance;
- private Object toMatch = IStyleSelectorAdapter.class;
-
- public synchronized static HTMLStyleSelectorAdapter getInstance() {
- if (instance == null) {
- instance = new HTMLStyleSelectorAdapter();
- }
- return instance;
- }
-
- public boolean isAdapterForType(Object type) {
- return type == toMatch;
- }
-
- public boolean match(ICSSSimpleSelector selector, Element element, String pseudoName) {
- if (element == null)
- return false;
- int i;
- String key;
-
- // PseudoName
- i = selector.getNumOfPseudoNames();
- if (i > 0) {
- if (pseudoName == null || pseudoName.length() == 0)
- return false;
- for (i = i - 1; i >= 0; i--) {
- if (pseudoName.equalsIgnoreCase(selector.getPseudoName(i))) {
- break;
- }
- }
- if (i < 0)
- return false;
- }
-
- // check tag name
- if (!selector.isUniversal() && !element.getNodeName().equalsIgnoreCase(selector.getName()))
- return false;
-
- // check id
- i = selector.getNumOfIDs();
- if (i > 0) {
- if (i > 1)
- return false;
- key = element.getAttribute("id");//$NON-NLS-1$
- if (key == null)
- return false;
- if (!selector.getID(0).equals(key))
- return false;
- }
-
- // check class
- i = selector.getNumOfClasses();
- if (i > 0) {
- key = element.getAttribute("class");//$NON-NLS-1$
- if (key == null)
- return false;
- StringTokenizer tokenizer = new StringTokenizer(key);
- for (i = i - 1; i >= 0; i--) {
- boolean ok = false;
- while (tokenizer.hasMoreTokens()) {
- if (selector.getClass(i).equals(tokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
-
- // check attributes
- for (i = selector.getNumOfAttributes() - 1; i >= 0; i--) {
- StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
- int countTokens = tokenizer.countTokens();
- if (countTokens > 0) {
- String attrValue = element.getAttribute(tokenizer.nextToken());
- if (attrValue == null)
- return false;
- if (countTokens > 1) {
- String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
- StringTokenizer attrValueTokenizer = null;
- if (token.equals("~")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue);
- }
- else if (token.equals("|")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue, "-");//$NON-NLS-1$
- }
- if (attrValueTokenizer != null) {
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- boolean ok = false;
- while (attrValueTokenizer.hasMoreTokens()) {
- if (token.equals(attrValueTokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
- else {
- if (!attrValue.equals(token))
- return false;
- }
- }
- }
- }
-
- return true;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java
deleted file mode 100644
index 4c66fbf03f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/HTMLStyleSelectorAdapterFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- * Insert the type's description here.
- */
-public class HTMLStyleSelectorAdapterFactory implements INodeAdapterFactory {
-
- private static HTMLStyleSelectorAdapterFactory instance;
- private Object toMatch = IStyleSelectorAdapter.class;
-
- /**
- * CSSModelProvideAdapterFactory constructor comment.
- */
- public HTMLStyleSelectorAdapterFactory() {
- super();
- }
-
- /**
- * Method that returns the adapter associated with the given object.
- * It may be a singleton or not ... depending on the needs of the INodeAdapter ...
- * but in general it is recommended for an adapter to be stateless,
- * so the efficiencies of a singleton can be gained.
- *
- * The implementation of this method should call addAdapter on the adapted
- * object with the correct instance of the adapter.
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSelectorAdapter.class);
- if (adapter != null)
- return adapter;
- adapter = HTMLStyleSelectorAdapter.getInstance();
- notifier.addAdapter(adapter);
- return adapter;
- }
-
- public synchronized static HTMLStyleSelectorAdapterFactory getInstance() {
- if (instance == null)
- instance = new HTMLStyleSelectorAdapterFactory();
- return instance;
- }
-
- /**
- * isFactoryForType method comment.
- */
- public boolean isFactoryForType(Object type) {
- return type == toMatch;
- }
-
- public void release() {
- // default is to do nothing
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
deleted file mode 100644
index 48f34ec4cb..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/LinkElementAdapter.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.htmlcss;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- */
-public class LinkElementAdapter extends AbstractStyleSheetAdapter {
-
- private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
- private boolean replaceModel = true;
- // this variable to hold the class is just a VAJava trick.
- // it improves performance in VAJava by minimizing class loading.
- private final Class ModelProvideAdapterClass = IModelProvideAdapter.class;
-
- /**
- */
- protected LinkElementAdapter() {
- super();
- }
-
- /**
- */
- private void attrReplaced() {
- this.replaceModel = true;
-
- Element element = getElement();
- if (element == null)
- return; // error
- Document document = element.getOwnerDocument();
- if (document == null)
- return; // error
- INodeNotifier notifier = (INodeNotifier) document;
- HTMLDocumentAdapter adapter = (HTMLDocumentAdapter) notifier.getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter == null)
- return;
- adapter.childReplaced();
- }
-
- protected ICSSModel createModel() {
- // create phantom(broken link) external CSS model
- if (getElement() == null)
- return null;
- IStructuredModel baseModel = ((IDOMNode) getElement()).getModel();
- ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(CSS_ID);
-
- // calculate base location and set
- // get resolver in Model
- URIResolver resolver = baseModel.getResolver();
-
- // resolve to absolute url : this need not exact location of css file. It is important that absurl is not null.
- String ref = getElement().getAttribute(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_HREF);
- String absurl = (resolver != null && ref != null) ? resolver.getLocationByURI(ref, true) : null;
- if ((absurl == null) || (absurl.length() == 0)) {
- IPath basePath = new Path(baseModel.getBaseLocation());
- URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
- absurl = helper.toAbsolute(ref == null ? "" : ref);//$NON-NLS-1$
- }
- if ((absurl == null) || (absurl.length() == 0)) {
- absurl = ref;
- }
- if (absurl == null) {
- absurl = "";//$NON-NLS-1$
- }
- newModel.setBaseLocation(absurl);
-
- // set style listener
- newModel.addStyleListener(this);
-
- return newModel;
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = getExistingModel();
- if (this.replaceModel) {
- ICSSModel oldModel = model;
- try {
- model = retrieveModel();
- setModel(model);
-
- // release old model
- if (oldModel != null) {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null)
- adapter.modelRemoved(oldModel);
- }
- }
- finally {
- if (oldModel != null)
- oldModel.releaseFromRead();
- }
- this.replaceModel = false;
- }
- return model;
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (eventType != INodeNotifier.CHANGE)
- return;
- Attr attr = (Attr) changedFeature;
- if (attr == null)
- return;
- String name = attr.getName();
- if (name.equalsIgnoreCase("rel") || //$NON-NLS-1$
- name.equalsIgnoreCase("type") || //$NON-NLS-1$
- name.equalsIgnoreCase("href")) {//$NON-NLS-1$
- attrReplaced();
- }
- }
-
- /**
- */
- public void refreshSheet() {
- if (!replaceModel) {
- removed();
- replaceModel = true;
-
- IDOMNode node = (IDOMNode) getElement();
- if (node != null) {
- node.notify(INodeNotifier.CHANGE, getElement().getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_HREF), null, null, node.getStartOffset());
- }
- }
- }
-
- /**
- */
- public void released() {
- ICSSModel model = getExistingModel();
- if (model != null) {
- try {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
-
- // set element to null first, so that no document wide updates
- setElement(null);
- setModel(null);
-
- if (adapter != null)
- adapter.modelReleased(model);
- }
- finally {
- model.releaseFromRead();
- }
- }
- this.replaceModel = false;
- }
-
- /**
- */
- public void removed() {
- ICSSModel model = getExistingModel();
- if (model != null) {
- try {
- setModel(null);
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null)
- adapter.modelRemoved(model);
- }
- finally {
- model.releaseFromRead();
- }
- }
- this.replaceModel = false;
- }
-
- /**
- */
- protected boolean isValidAttribute() {
- Element element = getElement();
- if (element == null)
- return false;
- String rel = element.getAttribute("rel");//$NON-NLS-1$
- if (rel == null || !rel.equalsIgnoreCase("stylesheet"))//$NON-NLS-1$
- return false;
- String type = element.getAttribute("type");//$NON-NLS-1$
- if (type != null && !type.equalsIgnoreCase("text/css"))//$NON-NLS-1$
- return false;
- String href = element.getAttribute("href");//$NON-NLS-1$
- if (href == null || href.length() == 0)
- return false;
- return true;
- }
-
- /**
- */
- private ICSSModel retrieveModel() {
- if (!isValidAttribute()) {
- return null;
- }
-
- // null,attr check is done in isValidAttribute()
- Element element = getElement();
- String href = element.getAttribute("href");//$NON-NLS-1$
-
- IDOMModel baseModel = ((IDOMNode) element).getModel();
- if (baseModel == null)
- return null;
- Object id = baseModel.getId();
- if (!(id instanceof String))
- return null;
- //String base = (String)id;
-
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(ModelProvideAdapterClass);
-
- URLModelProvider provider = new URLModelProvider();
- try {
- IStructuredModel newModel = provider.getModelForRead(baseModel, href);
- if (newModel == null)
- return null;
- if (!(newModel instanceof ICSSModel)) {
- newModel.releaseFromRead();
- return null;
- }
-
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
-
- return (ICSSModel) newModel;
- }
- catch (UnsupportedEncodingException e) {
- }
- catch (IOException e) {
- }
-
- return null;
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- ICSSModel oldModel = getExistingModel();
- if (model == oldModel)
- return;
- super.setModel(model);
- if (this.replaceModel)
- this.replaceModel = false;
- if (oldModel != null)
- oldModel.removeStyleListener(this);
- if (model != null)
- model.addStyleListener(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java
deleted file mode 100644
index 83318dfa0c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAdapterFactory.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- */
-public class StyleAdapterFactory implements INodeAdapterFactory {
-
- private static StyleAdapterFactory instance = null;
-
- // private static String CSS_CONTENT_TYPE = "text/css";//$NON-NLS-1$
- /**
- */
- private StyleAdapterFactory() {
- super();
- }
-
- /**
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- if (notifier == null)
- return null;
-
- Node node = (Node) notifier;
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_NODE) {
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetListAdapter.class);
- if (adapter != null)
- return adapter;
- HTMLDocumentAdapter newAdapter = new HTMLDocumentAdapter();
- newAdapter.setDocument((Document) node);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
- if (nodeType != Node.ELEMENT_NODE)
- return null;
-
- Element element = (Element) node;
- String tagName = element.getTagName();
- if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) {
- if (!isTagAvailable(element.getOwnerDocument(), HTML40Namespace.ElementName.STYLE)) {
- return null;
- }
- // String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
- // if (type != null && ! type.equalsIgnoreCase(CSS_CONTENT_TYPE)) {
- // return null;
- // }
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetAdapter.class);
- if (adapter != null)
- return adapter;
- StyleElementAdapter newAdapter = new StyleElementAdapter();
- newAdapter.setElement(element);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
- else if (tagName.equalsIgnoreCase(HTML40Namespace.ElementName.LINK)) {
- if (!isTagAvailable(element.getOwnerDocument(), HTML40Namespace.ElementName.LINK)) {
- return null;
- }
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleSheetAdapter.class);
- if (adapter != null)
- return adapter;
- LinkElementAdapter newAdapter = new LinkElementAdapter();
- newAdapter.setElement(element);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
-
- INodeAdapter adapter = notifier.getExistingAdapter(IStyleDeclarationAdapter.class);
- if (adapter != null)
- return adapter;
-
- if (!isAttributeAvailable(element, HTML40Namespace.ATTR_NAME_STYLE)) {
- return null;
- }
- StyleAttrAdapter newAdapter = new StyleAttrAdapter();
- newAdapter.setElement(element);
- notifier.addAdapter(newAdapter);
- return newAdapter;
- }
-
- /**
- */
- public synchronized static StyleAdapterFactory getInstance() {
- if (instance == null)
- instance = new StyleAdapterFactory();
- return instance;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == IStyleSheetAdapter.class || type == IStyleDeclarationAdapter.class || type == IStyleSheetListAdapter.class);
- }
-
- public void release() {
- // default is to do nothing
- }
-
- private static boolean isTagAvailable(Document document, String elementName) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null) {
- CMDocument cmdoc = modelQuery.getCorrespondingCMDocument(document);
- CMNamedNodeMap map = cmdoc.getElements();
- if ((CMElementDeclaration) map.getNamedItem(elementName) != null) {
- return true;
- }
- }
-
- return false;
- }
-
- private static boolean isAttributeAvailable(Element element, String attrName) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (modelQuery != null) {
- CMElementDeclaration decl = modelQuery.getCMElementDeclaration(element);
- if (decl != null) {
- CMNamedNodeMap map = decl.getAttributes();
- if ((CMAttributeDeclaration) map.getNamedItem(attrName) != null) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Overriding Object's clone() method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java
deleted file mode 100644
index db14d1c54e..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleAttrAdapter.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-/**
- */
-public class StyleAttrAdapter extends AbstractCSSModelAdapter implements IStructuredDocumentListener, IStyleDeclarationAdapter {
-
- private boolean ignoreNotification = false;
- private final static String STYLE = "style";//$NON-NLS-1$
-
- /**
- */
- StyleAttrAdapter() {
- super();
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = getExistingModel();
- if (model == null && isModelNecessary()) {
- model = createModel();
- if (model == null)
- return null;
-
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return null;
-
- RegionParser parser = structuredDocument.getParser();
- if (parser instanceof CSSSourceParser) {
- ((CSSSourceParser)parser).setParserMode(CSSSourceParser.MODE_DECLARATION);
- } else {
- return null;
- }
-
- structuredDocument.addDocumentChangedListener(this);
-
- setModel(model); // need to set before valueChanged()
- valueChanged();
- }
- if (model != null && !isModelNecessary()) {
- model = null;
- valueChanged();
- }
- return model;
- }
-
- /**
- */
- public CSSStyleDeclaration getStyle() {
- ICSSModel model = getModel();
- if (model == null)
- return null;
- return (CSSStyleDeclaration) model.getDocument();
- }
-
- /**
- * 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 == IStyleDeclarationAdapter.class);
- }
-
- /**
- */
- public void newModel(NewDocumentEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- }
-
- /**
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (this.ignoreNotification)
- return;
-
- if (eventType != INodeNotifier.CHANGE)
- return;
- Attr attr = (Attr) changedFeature;
- if (attr == null)
- return;
- String name = attr.getName();
- if (name.equalsIgnoreCase(STYLE)) {
- valueChanged();
- }
- }
-
- /**
- */
- public void regionChanged(RegionChangedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- public void regionsReplaced(RegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == this)
- return;
-
- setValue();
- }
-
- /**
- */
- private void setValue() {
- Element element = getElement();
- if (element == null)
- return;
- ICSSModel model = getExistingModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
-
- String value = null;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes != null) {
- int count = flatNodes.getLength();
- if (count > 0) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion flatNode = flatNodes.item(i);
- if (flatNode == null)
- continue;
- buffer.append(flatNode.getText());
- }
- value = buffer.toString();
- }
- }
-
- this.ignoreNotification = true;
- if (value == null || value.length() == 0) {
- element.removeAttribute(STYLE);
- }
- else {
- Attr attr = element.getAttributeNode(STYLE);
- if (attr != null) {
- ((IDOMNode) attr).setValueSource(value);
- }
- else {
- Document document = element.getOwnerDocument();
- attr = document.createAttribute(STYLE);
- ((IDOMNode) attr).setValueSource(value);
- element.setAttributeNode(attr);
- }
- }
- this.ignoreNotification = false;
-
- notifyStyleChanged(element);
- }
-
- /**
- */
- private void valueChanged() {
- Element element = getElement();
- if (element == null)
- return;
- if (!isModelNecessary()) { // removed
- setModel(null);
-
- notifyStyleChanged(element);
- return;
- }
-
- ICSSModel model = getExistingModel();
- if (model == null)
- return; // defer
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return; // error
-
- String value = null;
- Attr attr = element.getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE);
- if (attr != null)
- value = ((IDOMNode) attr).getValueSource();
- structuredDocument.setText(this, value);
-
- notifyStyleChanged(element);
- }
-
- /**
- * @return boolean
- */
- private boolean isModelNecessary() {
- return getElement() != null && getElement().getAttributeNode(org.eclipse.wst.html.core.internal.provisional.HTML40Namespace.ATTR_NAME_STYLE) != null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
deleted file mode 100644
index 3ef97b9cc9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleElementAdapter.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004-2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- * Masaki Saitoh (MSAITOH@jp.ibm.com)
- * See Bug 153000 Style Adapters should be lazier
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=153000
- *
- ********************************************************************************/
-package org.eclipse.wst.html.core.internal.htmlcss;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener;
-import org.eclipse.wst.sse.core.internal.provisional.events.NewDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentRegionsReplacedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- */
-public class StyleElementAdapter extends AbstractStyleSheetAdapter implements IStructuredDocumentListener {
-
- private boolean replaceModel = true;
- private boolean ignoreNotification = false;
-
- /**
- */
- protected StyleElementAdapter() {
- super();
- }
-
- /**
- * Preparation of applying changes from CSS sub-model to HTML model
- */
- private void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null)
- return;
- Element element = getElement();
- if (element == null)
- return;
- ICSSModel model = getExistingModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
-
- // get old content length
- Node child = element.getFirstChild();
- if (child == null || child.getNodeType() != Node.TEXT_NODE)
- return;
- IDOMNode content = (IDOMNode) child;
- int oldLength = content.getEndOffset() - content.getStartOffset();
-
- // get new content length
- int newLength = 0;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes != null) {
- int count = flatNodes.getLength();
- if (count > 0) {
- IStructuredDocumentRegion last = flatNodes.item(count - 1);
- if (last != null)
- newLength = last.getEnd();
- }
- }
-
- int offset = flatNode.getStart();
- int end = flatNode.getEnd();
- int diff = oldLength - newLength;
- int length = end - offset + diff;
- String data = flatNode.getText();
-
- replaceData(offset, length, data);
- }
-
- /**
- * Apply changes from HTML model to CSS sub-model
- */
- private void contentChanged() {
- Element element = getElement();
- if (element == null)
- return;
- ICSSModel model = getExistingModel();
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
-
- String data = null;
- Node child = element.getFirstChild();
- if (child != null && child.getNodeType() == Node.TEXT_NODE && child.getNextSibling() == null) {
- data = child.getNodeValue();
- }
- if (data == null)
- data = "";//$NON-NLS-1$
-
- // minimize replace range
- int start = 0, end = 0;
- String oldData = structuredDocument.get();
- if (oldData == null)
- oldData = "";//$NON-NLS-1$
-
- // search differenct character position from first
- for (; start < oldData.length() && start < data.length(); start++)
- if (oldData.charAt(start) != data.charAt(start))
- break;
-
- if (start == oldData.length() && start == data.length())
- return; // no change
- else if (start == oldData.length()) {
- structuredDocument.replaceText(getRequesterH2C(), start, 0, data.substring(start)); // append text to last
- }
- else if (start == data.length()) {
- structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - start, ""); // remove text of last //$NON-NLS-1$
- }
- else {
- // search differenct character position from last
- for (; start < oldData.length() - end && start < data.length() - end; end++) {
- if (oldData.charAt(oldData.length() - end - 1) != data.charAt(data.length() - end - 1))
- break;
- }
- structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - end - start, data.substring(start, data.length() - end));
- }
-
- }
-
- /**
- */
- public ICSSModel getModel() {
- ICSSModel model = getExistingModel();
- if (this.replaceModel) {
- ICSSModel oldModel = model;
- model = createModel(false);
-
- setModel(model, false); // need to set before contentChanged()
- contentChanged();
-
- // from super.createModel()
- // get ModelProvideAdapter
- IModelProvideAdapter modelProvideAdapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- // notify adapter
- if (modelProvideAdapter != null)
- modelProvideAdapter.modelProvided(model);
-
- // from createModel()
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return null;
- structuredDocument.addDocumentChangedListener(this);
-
- // from setModel()
- if (oldModel != null)
- oldModel.removeStyleListener(this);
- if (model != null)
- model.addStyleListener(this);
-
- if (oldModel != null) {
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
- if (adapter != null) {
- adapter.modelRemoved(oldModel);
- }
- }
-
- this.replaceModel = false;
- }
- return model;
- }
-
- /**
- */
- protected boolean isValidAttribute() {
- Element element = getElement();
- if (element == null) {
- return false;
- }
- String type = element.getAttribute(HTML40Namespace.ATTR_NAME_TYPE);
- if (type != null && type.length() > 0 && !type.equalsIgnoreCase("text/css")) { //$NON-NLS-1$
- return false;
- }
- return true;
- }
-
- /**
- */
- protected ICSSModel createModel() {
- return createModel(true);
- }
-
- /**
- */
- protected ICSSModel createModel(boolean addListener) {
- if (!isValidAttribute()) {
- return null;
- }
-
- if (!addListener)
- return super.createModel(false);
-
- ICSSModel model = super.createModel();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return null;
- structuredDocument.addDocumentChangedListener(this);
-
- return model;
- }
-
- /**
- */
- // public ICSSModel getModel() {
- // ICSSModel model = getExistingModel();
- // if (model == null) {
- // model = createModel();
- // if (model == null) return null;
- // IStructuredDocument structuredDocument = model.getStructuredDocument();
- // if (structuredDocument == null) return null;
- // structuredDocument.addModelChangedListener(this);
- // setModel(model); // need to set before contentChanged()
- // contentChanged();
- // }
- // return model;
- // }
- /**
- */
- private Object getRequesterH2C() {
- return (getElement() != null && ((IDOMNode) getElement()).getModel() != null) ? (Object) ((IDOMNode) getElement()).getModel() : this;
- }
-
- /**
- */
- private Object getRequesterC2H() {
- return (getModel() != null) ? (Object) getModel() : this;
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void newModel(NewDocumentEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocument structuredDocument = event.getStructuredDocument();
- if (structuredDocument == null)
- return;
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes == null)
- return;
-
- replaceStructuredDocumentRegions(flatNodes, null);
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocumentRegionList oldStructuredDocumentRegions = event.getOldStructuredDocumentRegions();
- IStructuredDocumentRegionList newStructuredDocumentRegions = event.getNewStructuredDocumentRegions();
- if (oldStructuredDocumentRegions == null && newStructuredDocumentRegions == null)
- return;
-
- replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- }
-
- /**
- * Overriding INodeAdapter's method
- * Event from <STYLE> element
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- if (this.ignoreNotification)
- return;
-
- if (eventType == INodeNotifier.ADD || eventType == INodeNotifier.REMOVE || eventType == INodeNotifier.CONTENT_CHANGED) {
- contentChanged();
- }
- else if (eventType == INodeNotifier.CHANGE) {
- Attr attr = (Attr) changedFeature;
- if (attr == null)
- return;
- String name = attr.getName();
- if (name.equalsIgnoreCase("type")) { //$NON-NLS-1$
- this.replaceModel = true;
-
- Element element = getElement();
- if (element == null) {
- return;
- }
- Document document = element.getOwnerDocument();
- if (document == null) {
- return;
- }
- HTMLDocumentAdapter adapter = (HTMLDocumentAdapter) ((INodeNotifier) document).getAdapterFor(IStyleSheetListAdapter.class);
- if (adapter != null) {
- adapter.childReplaced();
- }
- }
- }
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void regionChanged(RegionChangedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- * Implementing IStructuredDocumentListener's method
- * Event from CSS Flat Model
- */
- public void regionsReplaced(RegionsReplacedEvent event) {
- if (event == null)
- return;
- if (event.getOriginalRequester() == getRequesterH2C())
- return;
- IStructuredDocumentRegion flatNode = event.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- * Apply changes from CSS sub-model to HTML model
- */
- private void replaceData(int offset, int length, String data) {
- IDOMNode element = (IDOMNode) getElement();
- if (element == null)
- return;
- IDOMModel ownerModel = element.getModel();
- if (ownerModel == null)
- return;
- IStructuredDocument structuredDocument = ownerModel.getStructuredDocument();
- if (structuredDocument == null)
- return;
- IStructuredDocumentRegion flatNode = element.getStartStructuredDocumentRegion();
- if (flatNode == null)
- return;
-
- int contentOffset = flatNode.getEndOffset();
- if (data == null)
- data = "";//$NON-NLS-1$
-
- this.ignoreNotification = true;
- structuredDocument.replaceText(getRequesterC2H(), contentOffset + offset, length, data);
- this.ignoreNotification = false;
- }
-
- /**
- * Preparation of applying changes from CSS sub-model to HTML model
- */
- private void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- int offset = 0;
- int length = 0;
- if (oldStructuredDocumentRegions != null) {
- int count = oldStructuredDocumentRegions.getLength();
- if (count > 0) {
- IStructuredDocumentRegion first = oldStructuredDocumentRegions.item(0);
- if (first != null)
- offset = first.getStart();
- IStructuredDocumentRegion last = oldStructuredDocumentRegions.item(count - 1);
- if (last != null)
- length = last.getEnd() - offset;
- }
- }
- String data = null;
- if (newStructuredDocumentRegions != null) {
- int count = newStructuredDocumentRegions.getLength();
- if (count > 0) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < count; i++) {
- IStructuredDocumentRegion flatNode = newStructuredDocumentRegions.item(i);
- if (flatNode == null)
- continue;
- buffer.append(flatNode.getText());
- if (i == 0)
- offset = flatNode.getStart();
- }
- data = buffer.toString();
- }
- }
-
- replaceData(offset, length, data);
- }
-
- /**
- */
- protected void setModel(ICSSModel model) {
- setModel(model, true);
- }
-
- /**
- */
- protected void setModel(ICSSModel model, boolean setupListener) {
- ICSSModel oldModel = getExistingModel();
- if (model == oldModel)
- return;
- super.setModel(model);
- if (!setupListener)
- return;
- if (oldModel != null)
- oldModel.removeStyleListener(this);
- if (model != null)
- model.addStyleListener(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.java
deleted file mode 100644
index bc8d16f577..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/StyleListener.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.core.internal.htmlcss;
-
-
-
-/**
- */
-public interface StyleListener {
-
- /**
- */
- void styleChanged();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.java
deleted file mode 100644
index 9413d6880d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLHelper.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.html.core.internal.htmlcss;
-
-/**
- * @deprecated
- */
-public class URLHelper extends org.eclipse.wst.css.core.internal.util.URLHelper {
-
- /**
- * @param baseUrl
- */
- public URLHelper(String baseUrl) {
- super(baseUrl);
- }
-
- /**
- * @param baseUrl
- * @param docRoot
- */
- public URLHelper(String baseUrl, String docRoot) {
- super(baseUrl, docRoot);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
deleted file mode 100644
index 6ab979c344..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/htmlcss/URLModelProvider.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.htmlcss;
-
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.UnsupportedCharsetException;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.EncodingRule;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;
-import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;
-import org.eclipse.wst.sse.core.internal.util.PathHelper;
-import org.eclipse.wst.sse.core.internal.util.ProjectResolver;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-// TODO when this class is removed from .core, PathHelper and URLHelper class
-// also can be removed.
-
-/**
- */
-public class URLModelProvider {
-
- private static final int GET_MODEL_FOR_READ = 1;
- // private static final int GET_NEW_MODEL_FOR_READ = 2;
- private static final int GET_MODEL_FOR_EDIT = 3;
- // private static final int GET_NEW_MODEL_FOR_EDIT = 4;
- // private static final int READ_BUFFER_SIZE = 4096;
- // IModelManager
- private IModelManager modelManager = null;
-
- /**
- */
- public URLModelProvider() {
- super();
-
- // obtain model manager
- modelManager = StructuredModelManager.getModelManager();
- }
-
- /**
- * Calculate ID from a filename. This must be same as
- * FileModelProvider.calculateId(IFile)
- */
- private static String calculateId(IPath fullIPath) {
- return fullIPath.toString();
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- */
- private IStructuredModel getCommonModelFor(final IStructuredModel baseModel, final String ref, final int which) throws IOException {
- // first, create absolute url
- String absURL = resolveURI(baseModel, ref, true);
- if ((absURL == null) || (absURL.length() == 0)) {
- return null;
- }
-
- // need to remove file:// scheme if necessary
- try {
- final java.net.URL aURL = new java.net.URL(absURL);
- // An actual URL was given, only file:/// is supported
- // resolve it by finding the file it points to
- if (!aURL.getProtocol().equals("platform")) { //$NON-NLS-1$
- if (aURL.getProtocol().equals("file") && (aURL.getHost().equals("localhost") || aURL.getHost().length() == 0)) {//$NON-NLS-2$//$NON-NLS-1$
- absURL = aURL.getFile();
- final IPath ipath = new Path(absURL);
- // if path has a device, and if it begins with
- // IPath.SEPARATOR, remove it
- final String device = ipath.getDevice();
- if ((device != null) && (device.length() > 0)) {
- if (device.charAt(0) == IPath.SEPARATOR) {
- final String newDevice = device.substring(1);
- absURL = ipath.setDevice(newDevice).toString();
- }
- }
-
- }
- }
- }
- catch (java.net.MalformedURLException mfuExc) {
- }
-
-
- // next, decide project
- IProject project = null;
- final IPath fullIPath = new Path(absURL);
- IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
- IContainer container = workspace.getContainerForLocation(fullIPath);
- if (container != null) {
- // fullIPath doesn't exist in workspace
- project = container.getProject();
- }
-
- // If HTML document has a link to an extern CSS which is not in
- // IProject
- // workspace.getContainerForLoation() may return null. We need to take
- // care
- // of this case
-
- // now, get absURL's IFile
- if ((project != null) && (project.getLocation().isPrefixOf(fullIPath) == false)) {
- // it's at outside of Project
- return null;
- }
-
- IStructuredModel model = null;
- if (project != null) {
- IPath filePath = fullIPath.removeFirstSegments(project.getLocation().segmentCount());
- IFile file = (filePath != null && !filePath.isEmpty()) ? project.getFile(filePath) : null;
- if (file == null) {
- return null;
- }
-
- // obtain model
- if (which == GET_MODEL_FOR_EDIT) {
- model = getModelForEdit(file);
- }
- else if (which == GET_MODEL_FOR_READ) {
- model = getModelForRead(file);
- }
-
- // setting synchronization stamp is IModelManager's client's
- // responsibility
- if (model != null && model.getSynchronizationStamp() == IResource.NULL_STAMP)
- model.resetSynchronizationStamp(file);
- }
- else {
- String id = null;
- InputStream inStream = null;
- // obtain resolver
- URIResolver resolver = (project != null) ? (URIResolver) project.getAdapter(URIResolver.class) : null;
- if (resolver == null) {
- // ProjectResolver can take care of the case if project is
- // null.
- resolver = new ProjectResolver(project);
- }
- if (resolver == null) {
- return null;
- }
-
- // there is no project. we can't expect IProject help to create
- // id/inputStream
- java.io.File file = fullIPath.toFile();
-
- // obatin id
- id = calculateId(fullIPath);
-
- // obtain InputStream
- try {
- inStream = new FileInputStream(file);
- }
- catch (FileNotFoundException fnfe) {
- // the file does not exist, or we don't have read permission
- return null;
- }
-
- // obtain model
- try {
- if (which == GET_MODEL_FOR_EDIT) {
- model = getModelManager().getModelForEdit(id, inStream, resolver);
- }
- else if (which == GET_MODEL_FOR_READ) {
- model = getModelManager().getModelForRead(id, inStream, resolver);
- }
- }
- catch (UnsupportedEncodingException ue) {
- }
- catch (IOException ioe) {
- }
- finally {
- // close now !
- if (inStream != null) {
- inStream.close();
- }
- }
- }
-
-
- // set locationid
- if (model != null && model.getBaseLocation() == null) {
- model.setBaseLocation(fullIPath.toString());
- }
-
- return model;
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- */
- public IStructuredModel getModelForEdit(IStructuredModel baseModel, String ref) throws IOException {
- return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_EDIT);
- }
-
- /**
- */
- private IStructuredModel getModelForEdit(IFile file) throws IOException {
- if (file == null)
- return null;
- IModelManager manager = getModelManager();
-
- // create a fake InputStream
- IStructuredModel model = null;
- try {
- model = manager.getModelForEdit(file);
- }
- catch (UnsupportedCharsetException ex) {
- try {
- model = manager.getModelForEdit(file, EncodingRule.FORCE_DEFAULT);
- }
- catch (IOException ioe) {
- }
- catch (CoreException ce) {
- }
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- */
- public IStructuredModel getModelForRead(IStructuredModel baseModel, String ref) throws UnsupportedEncodingException, IOException {
- return getCommonModelFor(baseModel, ref, GET_MODEL_FOR_READ);
- }
-
- /**
- */
- private IStructuredModel getModelForRead(IFile file) throws IOException {
- if (file == null)
- return null;
- IModelManager manager = getModelManager();
-
- // create a fake InputStream
- IStructuredModel model = null;
- try {
- model = manager.getModelForRead(file);
- }
- catch (UnsupportedCharsetException ex) {
- try {
- model = manager.getModelForRead(file, EncodingRule.FORCE_DEFAULT);
- }
- catch (IOException ioe) {
- }
- catch (CoreException ce) {
- }
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- /**
- */
- private IModelManager getModelManager() {
- return modelManager;
- }
-
- public IStructuredModel getNewModelForEdit(IFile iFile) {
- if (iFile == null)
- return null;
- IModelManager manager = getModelManager();
- if (manager == null)
- return null;
-
- IStructuredModel model = null;
- try {
- model = manager.getNewModelForEdit(iFile, false);
- }
- catch (IOException ex) {
- }
- catch (ResourceInUse riu) {
- }
- catch (ResourceAlreadyExists rae) {
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- public IStructuredModel getNewModelForRead(IFile iFile) {
- if (iFile == null)
- return null;
- IModelManager manager = getModelManager();
- if (manager == null)
- return null;
-
- IStructuredModel model = null;
- try {
- model = manager.getNewModelForEdit(iFile, false);
- }
- catch (IOException ex) {
- }
- catch (ResourceInUse riu) {
- }
- catch (ResourceAlreadyExists rae) {
- }
- catch (CoreException ce) {
- }
- return model;
- }
-
- /**
- * Utility to check the model is HTML family or not
- */
- static private boolean isHTMLFamily(IStructuredModel model) {
- if (model instanceof IDOMModel) {
- IDOMDocument document = ((IDOMModel) model).getDocument();
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null)
- return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
- }
- return false;
- }
-
- /**
- * <code>baseModel</code>: the model containing the link
- * <code>ref</code>: the link URL string
- * <code>resolveCrossProjectLinks</code>: If resolveCrossProjectLinks
- * is set to true, then this method will properly resolve the URI if it is
- * a valid URI pointing to another (appropriate) project.
- */
- public static String resolveURI(IStructuredModel baseModel, String ref, boolean resolveCrossProjectLinks) {
- if (baseModel == null)
- return null;
- // for HTML, 'href' attribute value of BASE element
- // should be used, if exists any
- String baseHref = null;
- // dmw_TODO needs to be changed to handle a content model
- // of HTML or XHTML
- if (isHTMLFamily(baseModel)) {
- final IDOMModel xmlmodel = (IDOMModel) baseModel;
- final IDOMDocument doc = xmlmodel.getDocument();
- // look for <BASE> w/ href
- final NodeList nl = doc.getElementsByTagName("BASE");//$NON-NLS-1$
- if ((nl != null) && (nl.getLength() > 0)) {
- // per each <BASE>
- for (int i = 0; i < nl.getLength(); i++) {
- final Node baseNode = nl.item(i);
- if (baseNode != null) {
- // get all attrs
- final NamedNodeMap attrNodes = baseNode.getAttributes();
- if (attrNodes != null) {
- final Node attrNode = attrNodes.getNamedItem("HREF");//$NON-NLS-1$
- if (attrNode != null) {
- // found href=""
- final String attrValue = attrNode.getNodeValue();
- if (attrValue != null) {
- baseHref = attrValue.trim();
- }
- }
- }
- }
- // what if there are multiple <BASE> tags ??
- if (baseHref != null) {
- break;
- }
- }
- }
- }
-
- // get resolver in Model
- final URIResolver resolver = baseModel.getResolver();
-
- // resolve to absolute url
- final String absurl = (resolver != null) ? ((baseHref != null) ? resolver.getLocationByURI(ref, baseHref, resolveCrossProjectLinks) : resolver.getLocationByURI(ref, resolveCrossProjectLinks)) : null;
- if ((resolver != null) && (absurl == null) && (ref != null) && (ref.trim().length() > 0) && (ref.trim().charAt(0) == '/')) {
- // to reach here means :
- // ref is a Docroot relative
- // resolver can't resolve ref
- // so that href is a broken and should not create model
- return null;
- }
- if ((absurl != null) && (absurl.length() > 0)) {
- return absurl;
- }
-
- // maybe ref is at outside of the Project
- // obtain docroot;
- final IContainer container = (resolver != null) ? resolver.getRootLocation() : null;
- String docroot = null;
- if (container != null) {
- docroot = container.getLocation().toString();
- }
- if (docroot == null) {
- docroot = baseModel.getBaseLocation();
- }
- if (docroot == null) {
- // should not be
- return null;
- }
-
- // obtain document url
- String modelBaseLocation = baseModel.getBaseLocation();
- if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
- // fallback...
- modelBaseLocation = baseModel.getId();
- }
- if ((modelBaseLocation == null) || (modelBaseLocation.length() == 0)) {
- // i can't resolve uri !
- return null;
- }
-
- // resolve url
- URLHelper helper = new URLHelper(PathHelper.getContainingFolderPath(modelBaseLocation), PathHelper.getContainingFolderPath(PathHelper.appendTrailingURLSlash(docroot)));
- return helper.toAbsolute(ref);
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
deleted file mode 100644
index 1d17f1eb04..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/EmbeddedHTML.java
+++ /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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelhandler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSelectorAdapter;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeAdapterFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLModelParserAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.HTMLStyleSelectorAdapterFactory;
-import org.eclipse.wst.html.core.internal.htmlcss.StyleAdapterFactory;
-import org.eclipse.wst.html.core.internal.modelquery.ModelQueryAdapterFactoryForEmbeddedHTML;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
-import org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser;
-import org.eclipse.wst.sse.core.internal.ltk.parser.JSPCapableParser;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.document.ModelParserAdapter;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class EmbeddedHTML implements EmbeddedTypeHandler {
-
- public String ContentTypeID_EmbeddedHTML = "org.eclipse.wst.html.core.internal.contenttype.EmbeddedHTML"; //$NON-NLS-1$
- private List supportedMimeTypes;
-
- /**
- * Constructor for EmbeddedHTML.
- */
- public EmbeddedHTML() {
- super();
- }
-
- /**
- * Convenience method to add tag names using BlockMarker object
- */
- private void addHTMLishTag(BlockTagParser parser, String tagname) {
- BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
- parser.addBlockMarker(bm);
- }
-
- /**
- * @see EmbeddedContentType#getFamilyId()
- */
- public String getFamilyId() {
- return ModelHandlerForHTML.AssociatedContentTypeID;
- }
-
- /*
- * Only "model side" embedded factories can be added here.
- */
- public List getAdapterFactories() {
- List factories = new ArrayList();
- factories.add(new ModelQueryAdapterFactoryForEmbeddedHTML());
- // factories.addAll(PluginContributedFactoryReader.getInstance().getFactories(this));
- return factories;
- }
-
- /*
- * @see EmbeddedContentType#initializeParser(RegionParser)
- */
- public void initializeParser(JSPCapableParser parser) {
- addHTMLishTag(parser, "script"); //$NON-NLS-1$
- addHTMLishTag(parser, "style"); //$NON-NLS-1$
- }
-
- public List getSupportedMimeTypes() {
- if (supportedMimeTypes == null) {
- supportedMimeTypes = new ArrayList();
- supportedMimeTypes.add("text/html"); //$NON-NLS-1$
- supportedMimeTypes.add("text/xhtml"); //$NON-NLS-1$
- supportedMimeTypes.add("application/xhtml+xml"); //$NON-NLS-1$
- supportedMimeTypes.add("text/vnd.wap.wml"); //$NON-NLS-1$
- }
- return supportedMimeTypes;
- }
-
- public void initializeFactoryRegistry(FactoryRegistry registry) {
- Assert.isNotNull(registry);
-
- INodeAdapterFactory factory = null;
- if (!registry.contains(DocumentTypeAdapter.class)) {
- factory = new HTMLDocumentTypeAdapterFactory();
- registry.addFactory(factory);
- }
- if (!registry.contains(ModelParserAdapter.class)) {
- factory = HTMLModelParserAdapterFactory.getInstance();
- registry.addFactory(factory);
- }
- if (!registry.contains(IStyleSelectorAdapter.class)) {
-
- factory = HTMLStyleSelectorAdapterFactory.getInstance();
- registry.addFactory(factory);
- }
- if (!registry.contains(IStyleSheetAdapter.class)) {
-
- factory = StyleAdapterFactory.getInstance();
- registry.addFactory(factory);
- }
-
- }
-
- public void uninitializeFactoryRegistry(FactoryRegistry registry) {
- Assert.isNotNull(registry);
-
- // ISSUE: should these factories be released? Or just
- // removed from this registry, because we are getting ready to
- // re-add them?
- INodeAdapterFactory factory = null;
- if (!registry.contains(DocumentTypeAdapter.class)) {
- factory = registry.getFactoryFor(DocumentTypeAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
- if (!registry.contains(ModelParserAdapter.class)) {
- factory = registry.getFactoryFor(ModelParserAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
- if (!registry.contains(IStyleSelectorAdapter.class)) {
- factory = registry.getFactoryFor(IStyleSelectorAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
- if (!registry.contains(IStyleSheetAdapter.class)) {
- factory = registry.getFactoryFor(IStyleSheetAdapter.class);
- factory.release();
- registry.removeFactory(factory);
- }
-
- }
-
- public void uninitializeParser(JSPCapableParser parser) {
- // I'm assuming block markers are unique based on name only
- // we add these as full BlockMarkers, but remove based on name alone.
- parser.removeBlockMarker("script"); //$NON-NLS-1$
- parser.removeBlockMarker("script"); //$NON-NLS-1$
- }
-
- public EmbeddedTypeHandler newInstance() {
- return new EmbeddedHTML();
- }
-
- /**
- * will someday be controlled via extension point
- */
- public boolean isDefault() {
- return true;
- }
-
- public boolean canHandleMimeType(String mimeType) {
- return getSupportedMimeTypes().contains(mimeType);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.java
deleted file mode 100644
index 06cc15a774..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelhandler/ModelHandlerForHTML.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.html.core.internal.modelhandler;
-
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentCharsetDetector;
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentLoader;
-import org.eclipse.wst.html.core.internal.encoding.HTMLModelLoader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.AbstractModelHandler;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
-
-public class ModelHandlerForHTML extends AbstractModelHandler implements IModelHandler {
- /**
- * 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.wst.html.core.htmlsource"; //$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_HTML = "org.eclipse.wst.html.core.modelhandler"; //$NON-NLS-1$
-
-
- public ModelHandlerForHTML() {
- super();
- setId(ModelHandlerID_HTML);
- setAssociatedContentTypeId(AssociatedContentTypeID);
- }
-
- public IModelLoader getModelLoader() {
- return new HTMLModelLoader();
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new HTMLDocumentCharsetDetector();
- }
-
- public IDocumentLoader getDocumentLoader() {
- return new HTMLDocumentLoader();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java
deleted file mode 100644
index ae41f91851..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMAttributeDeclarationBuddySystem.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-
-/**
- */
-class CMAttributeDeclarationBuddySystem extends CMNodeBuddySystem implements CMAttributeDeclaration {
-
-
- public CMAttributeDeclarationBuddySystem(CMAttributeDeclaration self, CMAttributeDeclaration buddy, boolean isXHTML) {
- super(self, buddy, isXHTML);
- }
-
- /*
- * @see CMAttributeDeclaration#getAttrName()
- */
- public String getAttrName() {
- return getSelf().getAttrName();
- }
-
- /*
- * @see CMAttributeDeclaration#getAttrType()
- */
- public CMDataType getAttrType() {
- return getSelf().getAttrType();
- }
-
- /*
- * @see CMAttributeDeclaration#getDefaultValue()
- * @deprecated in superclass
- */
- public String getDefaultValue() {
- return getSelf().getDefaultValue();
- }
-
- /*
- * @see CMAttributeDeclaration#getEnumAttr()
- * @deprecated in superclass
- */
- public Enumeration getEnumAttr() {
- return getSelf().getEnumAttr();
- }
-
- /*
- * @see CMAttributeDeclaration#getUsage()
- */
- public int getUsage() {
- return getSelf().getUsage();
- }
-
- private CMAttributeDeclaration getSelf() {
- return (CMAttributeDeclaration) self;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.java
deleted file mode 100644
index 0f8f13e8b4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMDocumentForBuddySystem.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.wst.html.core.internal.modelquery;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.contentmodel.ssi.SSICMDocumentFactory;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamespace;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- */
-class CMDocumentForBuddySystem extends CMNodeBuddySystem implements CMDocument {
-
-
- private static CMDocument getHTMLCMDocument() {
- return HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- }
-
- class Elements extends CMNamedNodeMapForBuddySystem {
- public Elements(CMNamedNodeMap elements, boolean isXHTML) {
- super(isXHTML);
- makeBuddySystem(elements);
- addSSIDecls();
- }
-
- protected String getKeyName(CMNode original) {
- CMElementDeclaration edecl = getDecl(original);
- if (edecl == null)
- return null;
- return edecl.getElementName();
- }
-
- protected CMNode createBuddySystem(CMNode original) {
- CMElementDeclaration edecl = getDecl(original);
- return new CMElementDeclarationBuddySystem(edecl, isXHTML());
- }
-
- private CMElementDeclaration getDecl(CMNode cmnode) {
- if (cmnode == null)
- return null;
- if (cmnode.getNodeType() != CMNode.ELEMENT_DECLARATION)
- return null;
- return (CMElementDeclaration) cmnode;
- }
-
- private void addSSIDecls() {
- CMDocument ssi = SSICMDocumentFactory.getCMDocument();
- if (ssi == null)
- return;
- CMNamedNodeMap elements = ssi.getElements();
- Iterator i = elements.iterator();
- while (i.hasNext()) {
- CMElementDeclaration decl = (CMElementDeclaration) i.next();
- if (decl == null)
- continue;
- put(decl.getElementName(), decl);
- }
- }
- }
-
- private Elements elements = null;
-
- public CMDocumentForBuddySystem(CMDocument self, boolean isXHTML) {
- super(self, getHTMLCMDocument(), isXHTML);
- }
-
- /*
- * @see CMDocument#getElements()
- */
- public CMNamedNodeMap getElements() {
- if (elements != null)
- return elements;
- CMDocument cmdoc = getSelf();
- if (cmdoc == null)
- return null;
- elements = new Elements(cmdoc.getElements(), isXHTML);
- return elements;
- }
-
- /*
- * @see CMDocument#getEntities()
- */
- public CMNamedNodeMap getEntities() {
- CMDocument cmdoc = getSelf();
- if (cmdoc == null)
- return null;
- return cmdoc.getEntities();
- }
-
- /*
- * @see CMDocument#getNamespace()
- */
- public CMNamespace getNamespace() {
- CMDocument cmdoc = getSelf();
- if (cmdoc == null)
- return null;
- return cmdoc.getNamespace();
- }
-
- private CMDocument getSelf() {
- if (self.getNodeType() != CMNode.DOCUMENT)
- return null;
- return (CMDocument) self;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java
deleted file mode 100644
index c71b4e050f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMElementDeclarationBuddySystem.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.modelquery;
-
-
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-
-/**
- */
-class CMElementDeclarationBuddySystem extends CMNodeBuddySystem implements CMElementDeclaration {
-
-
- private static CMDocument htmlcm = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
-
- private static CMElementDeclaration getHTMLCMElemDecl(CMElementDeclaration original) {
- CMElementDeclaration buddy = null;
- if (htmlcm != null) {
- CMNamedNodeMap elems = htmlcm.getElements();
- if (elems != null) {
- buddy = (CMElementDeclaration) elems.getNamedItem(original.getElementName());
- }
- }
- return buddy;
- }
-
- private class Attrs extends CMNamedNodeMapForBuddySystem {
- private CMNamedNodeMap buddyAttrs = null;
-
- public Attrs(CMNamedNodeMap attrs, CMNamedNodeMap buddyAttrs, boolean isXHTML) {
- super(isXHTML);
- this.buddyAttrs = buddyAttrs;
- makeBuddySystem(attrs);
- }
-
- protected String getKeyName(CMNode original) {
- CMAttributeDeclaration adecl = getDecl(original);
- if (adecl == null)
- return null;
- return adecl.getAttrName();
- }
-
- protected CMNode createBuddySystem(CMNode original) {
- CMAttributeDeclaration adecl = getDecl(original);
- if (adecl == null)
- return null;
- CMAttributeDeclaration buddy = null;
- if (buddyAttrs != null) {
- buddy = (CMAttributeDeclaration) buddyAttrs.getNamedItem(adecl.getAttrName());
- }
- return new CMAttributeDeclarationBuddySystem(adecl, buddy, isXHTML());
- }
-
- private CMAttributeDeclaration getDecl(CMNode cmnode) {
- if (cmnode == null)
- return null;
- if (cmnode.getNodeType() != CMNode.ATTRIBUTE_DECLARATION)
- return null;
- return (CMAttributeDeclaration) cmnode;
- }
- }
-
- private Attrs attributes = null;
-
- public CMElementDeclarationBuddySystem(CMElementDeclaration self, boolean isXHTML) {
- super(self, getHTMLCMElemDecl(self), isXHTML);
- }
-
- /*
- * @see CMElementDeclaration#getAttributes()
- */
- public CMNamedNodeMap getAttributes() {
- if (attributes != null)
- return attributes;
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- CMElementDeclaration htmlDecl = getBuddy();
- CMNamedNodeMap htmlAttrs = (htmlDecl == null) ? null : htmlDecl.getAttributes();
- attributes = new Attrs(edecl.getAttributes(), htmlAttrs, isXHTML);
- return attributes;
- }
-
- /*
- * @see CMElementDeclaration#getContent()
- */
- public CMContent getContent() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getContent();
- }
-
- /*
- * @see CMElementDeclaration#getContentType()
- */
- public int getContentType() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return CMElementDeclaration.ANY;
- return edecl.getContentType();
- }
-
- /*
- * @see CMElementDeclaration#getElementName()
- */
- public String getElementName() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getElementName();
- }
-
- /*
- * @see CMElementDeclaration#getDataType()
- */
- public CMDataType getDataType() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getDataType();
- }
-
- /*
- * @see CMElementDeclaration#getLocalElements()
- */
- public CMNamedNodeMap getLocalElements() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return null;
- return edecl.getLocalElements();
- }
-
- /*
- * @see CMContent#getMaxOccur()
- */
- public int getMaxOccur() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return -1;
- return edecl.getMaxOccur();
- }
-
- /*
- * @see CMContent#getMinOccur()
- */
- public int getMinOccur() {
- CMElementDeclaration edecl = getSelf();
- if (edecl == null)
- return -1;
- return edecl.getMinOccur();
- }
-
- /*
- * @see CMNode#supports(String)
- */
- public boolean supports(String propertyName) {
- if (isXHTML && propertyName.equals(HTMLCMProperties.OMIT_TYPE))
- return true;
- return super.supports(propertyName);
- }
-
- /*
- * @see CMNode#getProperty(String)
- */
- public Object getProperty(String propertyName) {
- if (isXHTML && propertyName.equals(HTMLCMProperties.OMIT_TYPE))
- return HTMLCMProperties.Values.OMIT_NONE;
- return super.getProperty(propertyName);
- }
-
- private CMElementDeclaration getSelf() {
- if (self.getNodeType() != CMNode.ELEMENT_DECLARATION)
- return null;
- return (CMElementDeclaration) self;
- }
-
- private CMElementDeclaration getBuddy() {
- if (buddy == null)
- return null;
- if (buddy.getNodeType() != CMNode.ELEMENT_DECLARATION)
- return null;
- return (CMElementDeclaration) buddy;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.java
deleted file mode 100644
index 643daa65ee..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNamedNodeMapForBuddySystem.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.wst.html.core.internal.modelquery;
-
-
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-abstract class CMNamedNodeMapForBuddySystem implements CMNamedNodeMap {
-
-
- private boolean isXHTML = false;
- private Hashtable map = new Hashtable();
-
- /**
- * Constructor of CMNamedNodeMapForBuddySystem.
- * CAUTION: Each derived class must call 'makeBuddySystem' method in its
- * constructor to build up its contents.
- */
- public CMNamedNodeMapForBuddySystem(boolean isXHTML) {
- super();
- this.isXHTML = isXHTML;
- }
-
- /*
- * @see CMNamedNodeMap#getLength()
- */
- public int getLength() {
- return map.size();
- }
-
- /*
- * @see CMNamedNodeMap#getNamedItem(String)
- */
- public CMNode getNamedItem(String name) {
- String key = canonicalName(name);
- if (!map.containsKey(key))
- return null;
- return (CMNode) map.get(key);
- }
-
- /*
- * @see CMNamedNodeMap#item(int)
- */
- public CMNode item(int index) {
- Iterator iter = iterator();
- while (iter.hasNext()) {
- Object node = iter.next();
- if (--index < 0)
- return (CMNode) node;
- }
- return null;
- }
-
- /*
- * @see CMNamedNodeMap#iterator()
- */
- public Iterator iterator() {
- return map.values().iterator();
- }
-
- /* package scope. */
- void put(String name, CMNode cmnode) {
- if (name == null || cmnode == null)
- return;
- map.put(canonicalName(name), cmnode);
- }
-
- abstract protected String getKeyName(CMNode original);
-
- abstract protected CMNode createBuddySystem(CMNode original);
-
- protected boolean isXHTML() {
- return isXHTML;
- }
-
- /**
- * Each derived class must call this method in its constructor
- * to build up its contents.
- */
- protected void makeBuddySystem(CMNamedNodeMap original) {
- Iterator i = original.iterator();
- if (i == null)
- return;
- while (i.hasNext()) {
- CMNode org = (CMNode) i.next();
- String key = getKeyName(org);
- CMNode newNode = createBuddySystem(org);
- put(key, newNode);
- }
- }
-
- private String canonicalName(String name) {
- return name.toUpperCase();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java
deleted file mode 100644
index b7a8be72b7..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/CMNodeBuddySystem.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-
-/**
- */
-class CMNodeBuddySystem implements CMNode {
-
-
- protected boolean isXHTML = false;
- protected CMNode self = null;
- protected CMNode buddy = null;
-
- public CMNodeBuddySystem(CMNode self, CMNode buddy, boolean isXHTML) {
- super();
- this.self = self;
- this.buddy = buddy;
- this.isXHTML = isXHTML;
- }
-
- /*
- * @see CMNode#getNodeName()
- */
- public String getNodeName() {
- return self.getNodeName();
- }
-
- /*
- * @see CMNode#getNodeType()
- */
- public int getNodeType() {
- return self.getNodeType();
- }
-
- /*
- * @see CMNode#supports(String)
- */
- public boolean supports(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return true;
- if (propertyName.equals(HTMLCMProperties.IS_XHTML))
- return true;
- if (buddy == null)
- return false;
- return buddy.supports(propertyName);
- }
-
- /*
- * @see CMNode#getProperty(String)
- */
- public Object getProperty(String propertyName) {
- if (propertyName.equals(HTMLCMProperties.SHOULD_IGNORE_CASE)) {
- return new Boolean(!isXHTML);
- }
- if (propertyName.equals(HTMLCMProperties.IS_XHTML)) {
- return new Boolean(isXHTML);
- }
-
- if (buddy == null || (!buddy.supports(propertyName)))
- return null;
- return buddy.getProperty(propertyName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java
deleted file mode 100644
index e72c2632c8..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/DocumentQuery.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.modelquery;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ranges.Range;
-
-/**
- */
-public interface DocumentQuery {
-
- /**
- * isRenderRoot() returns true if - node is BODY element (both explicit
- * and implicit) - node is portalhtml:body element - node is Document node
- * and the document is treated as fragment (with BODY context) Note that
- * in editing a fragment file, Document node should be treated as a
- * substitute of BODY element.
- */
- boolean isRenderRoot(Node node);
-
- /**
- * isHeadCorrespondent() returns true if - node is HEAD element (both
- * explicit and implicit) - node is portalhtml:head element - node is
- * Document node and the document is treated as fragment (with HEAD
- * context) Note that in editing a fragment file (with HEAD context),
- * Document node should be treated as a substitute of HEAD element.
- */
- boolean isHeadCorrespondent(Node node);
-
- /**
- * Implicit BODY element will be gone in V6 SED model. So page designer
- * provides an API to get a range whose content nodes are rendered in
- * design view. getRenderRootRange() returns - a range from BODY's first
- * to its last (if the document has BODY element) - a range form
- * Document's first to its last (if the document is fragment with BODY
- * context) - null (if the document is fragment with HEAD context) [The
- * following cases will be supported since V6] - a range from a custom
- * tag's first to its last (if the document has a custom tag which
- * generates BODY element at runtime) - a range from Document's
- * appropirate offset to its last (if the document does not have explicit
- * BODY/HTML) - a range from HTML element's appropriate offset to its last
- * (if the document does not have explicit BODY but have explicit HTML)
- *
- * @param doc
- * @return
- */
- Range getRenderRootRange(Document doc);
-
- /**
- * Implicit HEAD element will be gone in V6 SED model. So page designer
- * provides an API to get a range whose content nodes are treated as HEAD
- * element's child. getHeadCorrespondentRange() returns - a range from
- * HEAD's first to its last (if the document has HEAD element) - a range
- * form Document's first to its last (if the document is fragment with
- * HEAD context) - null (if the document is fragment with BODY context)
- * [The following cases will be supported since V6] - a range from a
- * custom tag's first to its last (if the document has a custom tag which
- * generates HEAD element at runtime) - a range from Document's first to
- * appropirate offset (if the document does not have explicit HEAD/HTML) -
- * a range from HTML element's first to appropriate offset (if the
- * document does not have explicit HEAD but have explicit HTML)
- *
- * @param doc
- * @return
- */
- Range getHeadCorrespondentRange(Document doc);
-
- /**
- * getRenderRootNode() with [create=false] returns - BODY element if this
- * document is not fragment and has BODY element - null if this document
- * is not fragment and does not have BODY element - Document node if this
- * document is fragment with BODY context - null if this document is
- * fragment with HEAD context [The following cases will be supported since
- * V6] - a custom tag which generates BODY tag at runtime - Document node
- * or HTML element if this document is not fragment but does not have
- * explicit BODY element getRenderRootNode() with [create=true] returns -
- * BODY element if this document is not fragment and has BODY element (no
- * modifictation) - newly created BODY element if this document is not
- * fragment but does not have BODY element - Document node if this
- * document is fragment with BODY context (no modifictation) [The
- * following cases will be supported since V6] - a custom tag which
- * generates BODY tag at runtime (no modifictation) - newly created BODY
- * element if this document is not fragment but does not have explicit
- * BODY element getRenderRootNode() throws HTMLCommandException (since V6)
- * if - this document is fragment with HEAD context and - "create"
- * parameter is true Note that in editing a fragment file, Document node
- * should be treated as a substitute of BODY element.
- *
- * @param childOrDocument
- * @param create
- * @return
- */
- Node getRenderRootNode(Node childOrDocument, boolean create);
-
- /**
- * getHeadCorrespondentNode() with [create=false] returns - HEAD element
- * if this document is not fragment and has HEAD element - null if this
- * document is not fragment and does not have HEAD element - Document node
- * if this document is fragment with HEAD context - null if this document
- * is fragment with BODY context [The following cases will be supported
- * since V6] - a custom tag which generates HEAD tag at runtime - Document
- * node or HTML element if this document is not fragment but does not have
- * explicit HEAD element getHeadCorrespondentNode() with [create=true]
- * returns - HEAD element if this document is not fragment and has HEAD
- * element (no modifictation) - newly created HEAD element if this
- * document is not fragment but does not have HEAD element - Document node
- * if this document is fragment with HEAD context (no modifictation) [The
- * following cases will be supported since V6] - a custom tag which
- * generates HEAD tag at runtime (no modifictation) - newly created HEAD
- * element if this document is not fragment but does not have explicit
- * HEAD element getHeadCorrespondentNode() throws HTMLCommandException
- * (since V6) if - this document is fragment with BODY context and -
- * "create" parameter is true Note that in editing a fragment file,
- * Document node should be treated as a substitute of HEAD element.
- *
- * @param childOrDocument
- * @param create
- * @return
- */
- Node getHeadCorrespondentNode(Node childOrDocument, boolean create);
-
- /**
- * getHtmlCorrespondentNode() throws HTMLCommandException (since V6) if -
- * this document is fragment and "create" parameter is true
- *
- * @param childOrDocument
- * @param create
- * @return
- */
- Node getHtmlCorrespondentNode(Node childOrDocument, boolean create);
-
- /**
- * This inner class is intended for insertion target. please use this like
- * the following : DocumentQuery.InsertionTarget ins;
- * ins.getParent().insertBefore(youInsertionNode, ins.getRef());
- */
- public class InsertionTarget {
- private final Node parent;
- private final Node ref;
-
- public InsertionTarget(Node parent, Node ref) {
- this.parent = parent;
- this.ref = ref;
- }
-
- public Node getParent() {
- return parent;
- }
-
- public Node getRef() {
- return ref;
- }
- }
-
- /**
- * getHeadInsertionTarget() returns appropriate insetion target location
- * for HEAD child tags such as <script>, <style>, <meta>etc. Basically
- * this function returns <HEAD>tag's the last position. Note that this
- * would not create actual <HEAD>tag when the document does not have it.
- * <HEAD>is omittable tag so this function returns appropriate position
- * to which implicit <HEAD>can be inserted, if the document has no
- * <HEAD>.
- *
- * @param doc
- * @return
- */
- InsertionTarget getHeadInsertionTarget(Document doc);
-
- /**
- * getPageInsertionTarget() returns appropriate insetion target location
- * for page-level markups, such as JSP directives, usebean tags or <html>
- * tag. Basically this function returns just before <HTML>tag. Note that
- * this would not create actual <HTML>tag when the document does not have
- * it. In such case, this function returns a position just before the
- * meaningful tags such as HTML/JSP elements.
- *
- * @param doc
- * @return
- */
- InsertionTarget getPageInsertionTarget(Document doc);
-
- /**
- * isFragment() returns whether the document is fragment or complete
- * document
- *
- * @param doc
- * @return
- */
- boolean isFragment(Document doc);
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.java
deleted file mode 100644
index 23e396dedd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapter.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.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- */
-public interface ElementDeclarationAdapter extends INodeAdapter {
-
- /**
- */
- CMElementDeclaration getDeclaration();
-
- /**
- */
- void setDeclaration(CMElementDeclaration declaration);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java
deleted file mode 100644
index a4981cb286..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ElementDeclarationAdapterFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-/**
- */
-public class ElementDeclarationAdapterFactory implements INodeAdapterFactory {
-
- private static ElementDeclarationAdapterFactory instance = null;
-
- /**
- */
- private ElementDeclarationAdapterFactory() {
- super();
- }
-
- /**
- */
- public INodeAdapter adapt(INodeNotifier notifier) {
- if (notifier == null)
- return null;
- INodeAdapter adapter = notifier.getExistingAdapter(ElementDeclarationAdapter.class);
- if (adapter != null)
- return adapter;
- adapter = new HTMLElementDeclarationAdapter();
- notifier.addAdapter(adapter);
- return adapter;
- }
-
- /**
- */
- public synchronized static ElementDeclarationAdapterFactory getInstance() {
- if (instance == null)
- instance = new ElementDeclarationAdapterFactory();
- return instance;
- }
-
- /**
- */
- public boolean isFactoryForType(Object type) {
- return (type == ElementDeclarationAdapter.class);
- }
-
- public void release() {
- // default is to do nothing
- }
-
- /**
- * Overriding copy method
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.java
deleted file mode 100644
index 42ddb16c6a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HMQUtil.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.wst.html.core.internal.modelquery;
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public final class HMQUtil {
-
- private final static Vector nullVector = new Vector();
-
- /* HMQUtil class must not instantiate. */
- private HMQUtil() {
- super();
- }
-
- /* gather all element declarations in inclusion of each parent of the target.
- * the inclusion of the target is also gathered. */
- public static Collection getInclusions(Element target) {
- if (target == null)
- return nullVector;
- Collection inclusions = gatherInclusions(getAncestorDeclarations(target));
-
- Hashtable availables = new Hashtable();
- Iterator iter = inclusions.iterator();
- while (iter.hasNext()) {
- CMContent inclusion = (CMContent) iter.next();
- switch (inclusion.getNodeType()) {
- case CMNode.GROUP :
- extractDeclarations(availables, (CMGroup) inclusion);
- break;
- case CMNode.ELEMENT_DECLARATION :
- addInclusion(availables, (CMElementDeclaration) inclusion);
- break;
- }
- }
-
- return availables.values();
- }
-
- private static Collection getAncestorDeclarations(Element target) {
- Vector ancestors = new Vector();
-
- Document doc = target.getOwnerDocument();
- ModelQuery query = ModelQueryUtil.getModelQuery(doc);
- CMElementDeclaration decl = query.getCMElementDeclaration(target);
- ancestors.add(decl);
-
- Element parent = getParent(target);
- while (parent != null) {
- decl = query.getCMElementDeclaration(parent);
- if (decl != null)
- ancestors.add(decl);
- parent = getParent(parent);
- }
- return ancestors;
- }
-
- private static void addInclusion(Hashtable availables, CMElementDeclaration decl) {
- String name = decl.getElementName();
- if (availables.containsKey(name))
- return;
- availables.put(name, decl);
- }
-
- private static Collection gatherInclusions(Collection ancestors) {
- Vector inclusions = new Vector();
- Iterator iter = ancestors.iterator();
- while (iter.hasNext()) {
- CMElementDeclaration decl = (CMElementDeclaration) iter.next();
- if (decl.supports(HTMLCMProperties.INCLUSION)) {
- CMContent inclusion = (CMContent) decl.getProperty(HTMLCMProperties.INCLUSION);
- if (inclusion != null)
- inclusions.add(inclusion);
- }
- }
- return inclusions;
- }
-
- private static Element getParent(Node target) {
- Node parent = target.getParentNode();
- while (parent != null) {
- if (parent.getNodeType() == Node.ELEMENT_NODE)
- return (Element) parent;
- parent = parent.getParentNode();
- }
- return null;
- }
-
- private static void extractDeclarations(Hashtable availables, CMGroup group) {
- CMNodeList content = group.getChildNodes();
- for (int i = 0; i < content.getLength(); i++) {
- CMNode cmn = content.item(i);
- if (cmn == null || cmn.getNodeType() != CMNode.ELEMENT_DECLARATION)
- continue;
- addInclusion(availables, (CMElementDeclaration) cmn);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.java
deleted file mode 100644
index 8797f54b55..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLElementDeclarationAdapter.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.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-
-/**
- */
-public class HTMLElementDeclarationAdapter implements ElementDeclarationAdapter {
-
- private CMElementDeclaration declaration = null;
-
- /**
- */
- public HTMLElementDeclarationAdapter() {
- super();
- }
-
- /**
- */
- public CMElementDeclaration getDeclaration() {
- return this.declaration;
- }
-
- /**
- * 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 == ElementDeclarationAdapter.class);
- }
-
- /**
- */
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- /**
- */
- public void setDeclaration(CMElementDeclaration declaration) {
- this.declaration = declaration;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.java
deleted file mode 100644
index e1a0d98f04..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryAssociationProvider.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.wst.html.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.SimpleAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-
-/**
- */
-public class HTMLModelQueryAssociationProvider extends SimpleAssociationProvider {
-
- /**
- * @param modelQueryCMProvider org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider
- */
- public HTMLModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
- super(new HTMLModelQueryCMProvider(cache, idResolver));
- }
-
- // MIWA: We cannot cache a CMElementDeclaration any more. Because, when the DOCTYPE
- // was changed, CMDocument would be changed. Then, a cached CMElementDeclaration
- // would be invalid. If some performance problems occurs, we consider a smarter
- // cache mechanism.
- //
- // public CMElementDeclaration getCMElementDeclaration(Element element) {
- // // check if element declaration is cached
- // INodeNotifier notifier = (INodeNotifier) element;
- // ElementDeclarationAdapter adapter = (ElementDeclarationAdapter) notifier.getExistingAdapter(ElementDeclarationAdapter.class);
- // if (adapter != null)
- // return adapter.getDeclaration();
- //
- // CMElementDeclaration decl = super.getCMElementDeclaration(element);
- //
- // // cache HTML element declaration only
- // if (decl != null && decl instanceof HTMLElementDeclaration) {
- // IAdapterFactory factory = ElementDeclarationAdapterFactory.getInstance();
- // adapter = (ElementDeclarationAdapter) factory.adapt(notifier);
- // if (adapter != null)
- // adapter.setDeclaration(decl);
- // }
- //
- // return decl;
- // }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
deleted file mode 100644
index 40e6d3d743..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryCMProvider.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.util.Hashtable;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocumentFactory;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQueryCMProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMDocType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Node;
-
-/**
- * CMDocument provider for HTML and XHTML documents.
- *
- * This added and/or made public specifically for experimentation. It will
- * change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- */
-
-
-public class HTMLModelQueryCMProvider implements ModelQueryCMProvider {
-
-
- private static CMDocument staticHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.HTML_DOC_TYPE);
- private static CMDocument staticCHTML = HTMLCMDocumentFactory.getCMDocument(CMDocType.CHTML_DOC_TYPE);
- private static HTMLDocumentTypeRegistry doctypeRegistry = HTMLDocumentTypeRegistry.getInstance();
- private static Hashtable buddyCache = new Hashtable();
-
- private XHTMLAssociationProvider xhtmlassoc = null;
-
- public HTMLModelQueryCMProvider(CMDocumentCache cache, URIResolver idResolver) {
- super();
- xhtmlassoc = new XHTMLAssociationProvider(cache, idResolver);
- }
-
- /**
- * 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) {
- IDOMDocument owner = getOwnerXMLDocument(node);
- if (owner == null)
- return null;
-
- String pid = getPublicId(owner);
- if (pid == null)
- return staticHTML;
-
- HTMLDocumentTypeEntry entry = doctypeRegistry.getEntry(pid);
- if (entry == null)
- return staticHTML;
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=151000 - use internal content model
- if (entry.useInternalModel()) {
- if (pid != null && pid.equals(HTMLDocumentTypeRegistry.CHTML_PUBLIC_ID)) {
- return staticCHTML;
- }
- return staticHTML;
- }
-
- pid = entry.getPublicId();
- String sid = entry.getSystemId();
-
- CMDocument dtdcm = xhtmlassoc.getXHTMLCMDocument(pid, sid);
- if (dtdcm == null) {
- if (pid != null && pid.equals(HTMLDocumentTypeRegistry.CHTML_PUBLIC_ID)) {
- return staticCHTML;
- }
- return staticHTML;
- }
-
- String grammarURI = xhtmlassoc.getCachedGrammerURI();
- CMDocument buddycm = (CMDocument) buddyCache.get(grammarURI);
- if (buddycm != null)
- return buddycm;
-
- buddycm = new CMDocumentForBuddySystem(dtdcm, entry.isXMLType());
- buddyCache.put(grammarURI, buddycm);
- return buddycm;
- }
-
- // private methods
- private IDOMDocument getOwnerXMLDocument(Node node) {
- if (node == null)
- return null;
- Document owner = (node.getNodeType() == Node.DOCUMENT_NODE) ? (Document) node : node.getOwnerDocument();
- if (owner == null)
- return null;
- if (!(owner instanceof IDOMDocument))
- return null;
- return (IDOMDocument) owner;
- }
-
- private String getPublicId(IDOMDocument doc) {
- if (doc == null)
- return null;
- DocumentType doctype = doc.getDoctype();
- return (doctype != null) ? doctype.getPublicId() : doc.getDocumentTypeId();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
deleted file mode 100644
index ad1d8d1768..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/HTMLModelQueryImpl.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.XMLModelQueryAssociationProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.MovableModelQuery;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * This added and/or made public specifically for experimentation. It
- * will change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- */
-
-public class HTMLModelQueryImpl extends ModelQueryImpl implements MovableModelQuery {
-
- protected CMDocumentCache fCache = null;
- protected XMLModelQueryAssociationProvider xmlAssocProv = null;
-
- public HTMLModelQueryImpl(CMDocumentCache cache, URIResolver idResolver) {
- super(new HTMLModelQueryAssociationProvider(cache, idResolver));
- fCache = cache;
- xmlAssocProv = new XMLModelQueryAssociationProvider(cache, idResolver);
- }
-
- public List getAvailableContent(Element element, CMElementDeclaration ed, int includeOptions) {
- List originalCandidates = super.getAvailableContent(element, ed, includeOptions);
- if ((includeOptions & INCLUDE_CHILD_NODES) == 0)
- return originalCandidates;
- // When the target document is XHTML, it is waste to find inclusions,
- // since inclusion is available in HTML only.
- if (!ed.supports(HTMLCMProperties.IS_XHTML))
- return originalCandidates;
-
- Boolean isXhtml = Boolean.FALSE;
- isXhtml = (Boolean) ed.getProperty(HTMLCMProperties.IS_XHTML);
- if (isXhtml != null && isXhtml.booleanValue())
- return originalCandidates;
-
- // OK, the target is surely a HTML element, so it may have inclusion.
- // Try to find it.
- Vector candidates = new Vector(originalCandidates);
-
- switch (ed.getContentType()) {
- case CMElementDeclaration.ANY :
- case CMElementDeclaration.ELEMENT :
- case CMElementDeclaration.MIXED :
- // do enumerate inclusions.
- candidates.addAll(HMQUtil.getInclusions(element));
- break;
- case CMElementDeclaration.EMPTY :
- case CMElementDeclaration.PCDATA :
- case CMElementDeclaration.CDATA :
- default :
- // should not add any inclusions.
- // so, nothing to do here.
- break;
- }
- // If the current element does not available, it is impossible
- // to filter out exclusion.
- if (element == null)
- return candidates;
-
- // Now, the time to check exclusion.
- Vector content = new Vector(candidates.size());
- for (int i = 0; i < candidates.size(); i++) {
- CMElementDeclaration candidate = (CMElementDeclaration) candidates.elementAt(i);
- if (candidate == null)
- continue;
- if (isExcluded(candidate, element))
- continue;
- content.add(candidate);
- }
-
- return content;
- }
-
- /**
- * @see MovableModelQuery#setIdResolver(IdResolver)
- */
- public void setIdResolver(URIResolver newIdResolver) {
- modelQueryAssociationProvider = new HTMLModelQueryAssociationProvider(fCache, newIdResolver);
- }
-
- // utilities
- private static boolean isExcluded(CMElementDeclaration candidate, Element target) {
- CMNamedNodeMap prohibited = getProhibitedAncestors(candidate);
- if (prohibited == null)
- return false;
- Element parent = target;
- while (parent != null) {
- CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
- if (pdec != null)
- return true;
- parent = getExplicitParentElement(parent);
- }
- return false;
- }
-
- private static CMNamedNodeMap getProhibitedAncestors(CMElementDeclaration dec) {
- if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS))
- return null;
- return (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);
- }
-
- /* get an ancestor element ignoring implicit ones. */
- private static Element getExplicitParentElement(Node child) {
- if (child == null)
- return null;
-
- Node p = child.getParentNode();
- while (p != null) {
- if (p.getNodeType() == Node.ELEMENT_NODE) {
- if (p instanceof IDOMElement) {
- if (((IDOMElement) p).isImplicitTag()) {
- p = p.getParentNode();
- continue;
- }
- }
- return (Element) p;
- }
- p = p.getParentNode();
- }
- return null;
- }
-
- public CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration result = super.getCMElementDeclaration(element);
- if (null != result)
- return result;
-
- return xmlAssocProv.getCMElementDeclaration(element);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java
deleted file mode 100644
index ef7c2638c4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForEmbeddedHTML.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.modelquery;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-
-public class ModelQueryAdapterFactoryForEmbeddedHTML extends ModelQueryAdapterFactoryForHTML {
-
-
- /**
- * Constructor for ModelQueryAdapterFactoryForEmbeddedHTML.
- */
- public ModelQueryAdapterFactoryForEmbeddedHTML() {
- super(ModelQueryAdapter.class, false);
- }
-
-
- public INodeAdapterFactory copy() {
-
- return new ModelQueryAdapterFactoryForEmbeddedHTML();
- }
-
- /**
- * ISSUE: this "forces" a new one to always be created/returned, not
- * "cached" on the node. That seems incorrect. Simply using
- * shouldRegisterFalse should work, except, there might have been one
- * there that someone else already explicitly put there, so this is only
- * way I know to override that. Especially complicated here since a number
- * of adapters are for ModelQueryAdapter.class.
- */
- public INodeAdapter adapt(INodeNotifier object) {
- return adaptNew(object);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java
deleted file mode 100644
index 125df78961..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/ModelQueryAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.util.Debug;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.eclipse.wst.xml.core.internal.modelquery.XMLCatalogIdResolver;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapterImpl;
-
-/**
- * Creates a ModelQueryAdapter for HTML models
- */
-public class ModelQueryAdapterFactoryForHTML extends AbstractAdapterFactory {
-
- ModelQueryAdapterImpl modelQueryAdapter;
- IStructuredModel modelStateNotifier;
- private InternalModelStateListener internalModelStateListener;
-
- class InternalModelStateListener implements IModelStateListener {
-
- /**
- * @see IModelStateListener#modelAboutToBeChanged(IStructuredModel)
- */
- public void modelAboutToBeChanged(IStructuredModel model) {
- // ISSUE: should we "freeze" state, or anything?
- }
-
- public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- // ISSUE: should we "freeze" state, or anything?
-
- }
-
- /**
- * @see IModelStateListener#modelChanged(IStructuredModel)
- */
- public void modelChanged(IStructuredModel model) {
- // nothing to do?
- }
-
- /**
- * @see IModelStateListener#modelDirtyStateChanged(IStructuredModel,
- * boolean)
- */
- public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
- // nothing to do
- }
-
- public void modelReinitialized(IStructuredModel structuredModel) {
- updateResolver(structuredModel);
- }
-
- /**
- * @see IModelStateListener#modelResourceDeleted(IStructuredModel)
- */
- public void modelResourceDeleted(IStructuredModel model) {
- // nothing to do?
- }
-
- /**
- * @see IModelStateListener#modelResourceMoved(IStructuredModel,
- * IStructuredModel)
- */
- public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
- modelStateNotifier.removeModelStateListener(this);
- modelStateNotifier = newModel;
- updateResolver(modelStateNotifier);
- modelStateNotifier.addModelStateListener(this);
- }
-
- private void updateResolver(IStructuredModel model) {
- String baseLocation = model.getBaseLocation();
- IFile baseFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
- if (baseFile != null) {
- baseLocation = baseFile.getLocation().toString();
- }
- modelQueryAdapter.setIdResolver(new XMLCatalogIdResolver(baseLocation, model.getResolver()));
- }
-
- }
-
-
- /**
- * ModelQueryAdapterFactoryForHTML constructor comment. Note: this is a
- * case there the key is not exactly same as the class we are after.
- */
- public ModelQueryAdapterFactoryForHTML() {
- super(ModelQueryAdapter.class, true);
- }
-
- /**
- * We need this protected version to allow subclasses to pass up standard
- * behaviour.
- *
- * @param adapterKey
- * @param registerAdapters
- */
-
- protected ModelQueryAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
-
-
- public INodeAdapterFactory copy() {
-
- return new ModelQueryAdapterFactoryForHTML();
- }
-
- public void release() {
- super.release();
- if (modelStateNotifier != null) {
- modelStateNotifier.removeModelStateListener(internalModelStateListener);
- }
-
- modelStateNotifier = null;
-
- if (modelQueryAdapter != null) {
- modelQueryAdapter.release();
- }
- }
-
- /**
- * createAdapter method comment.
- *
- * XXX: we must make this method more independent of 'location' (at least
- * provide some fall-back method).
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
-
- if (Debug.displayInfo) {
- Logger.log(Logger.INFO_DEBUG, "-----------------------ModelQueryAdapterFactoryForHTML.createAdapter" + target); //$NON-NLS-1$
- }
- if (modelQueryAdapter == null) {
- if (target instanceof IDOMNode) {
- IDOMNode xmlNode = (IDOMNode) target;
- modelStateNotifier = xmlNode.getModel();
- modelStateNotifier.addModelStateListener(getInternalModelStateListener());
-
- IStructuredModel model = xmlNode.getModel();
- String baseLocation = null;
- String modelsBaseLocation = model.getBaseLocation();
- if (modelsBaseLocation != null) {
- File file = new Path(modelsBaseLocation).toFile();
- if (file.exists()) {
- baseLocation = file.getAbsolutePath();
- }
- else {
- IPath basePath = new Path(model.getBaseLocation());
- IPath derivedPath = null;
- if (basePath.segmentCount() > 1)
- derivedPath = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath).getLocation();
- else
- derivedPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(basePath);
- if (derivedPath != null) {
- baseLocation = derivedPath.toString();
- }
- }
- }
- if (Debug.displayInfo)
- System.out.println("----------------ModelQueryAdapterFactoryForHTML... baseLocation : " + baseLocation); //$NON-NLS-1$
-
- CMDocumentCache cmDocumentCache = new CMDocumentCache();
- URIResolver idResolver = null;
-
- org.eclipse.wst.sse.core.internal.util.URIResolver resolver = model.getResolver();
- if (baseLocation != null || resolver != null) {
- idResolver = new XMLCatalogIdResolver(baseLocation, resolver);
- }
- ModelQuery modelQuery = new HTMLModelQueryImpl(cmDocumentCache, idResolver);
- modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
- modelQueryAdapter = new ModelQueryAdapterImpl(cmDocumentCache, modelQuery, idResolver);
- }
- }
- return modelQueryAdapter;
- }
-
-
-
- private final InternalModelStateListener getInternalModelStateListener() {
- if (internalModelStateListener == null) {
- internalModelStateListener = new InternalModelStateListener();
- }
- return internalModelStateListener;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
deleted file mode 100644
index de50ef20ad..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.modelquery;
-
-
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
-import org.w3c.dom.Document;
-
-/**
- * A Class to provide an association between XHTML documents and DTDs for
- * XHTML. This class is intended to be used only in HTMLModelQueryCMProvider.
- */
-/*
- * This class closely resemble XMLModelQueryAssociationProvider.
- */
-class XHTMLAssociationProvider extends XMLAssociationProvider {
-
- /**
- * set USE_QUICK_CACHE to false to test effects of not caching at all.
- */
- private static final boolean USE_QUICK_CACHE = true;
- protected URIResolver idResolver;
- private String fCachedGrammerURI;
- private String fCachedPublicID;
- private String fCachedSystemID;
- private boolean cached;
-
- public XHTMLAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
- super(cache);
- this.idResolver = idResolver;
- }
-
- /**
- *
- * @param publicId
- * @param systemId
- * @return
- */
- public CMDocument getXHTMLCMDocument(String publicId, String systemId) {
- if (idResolver == null)
- return null;
- String grammerURI = null;
- if (USE_QUICK_CACHE) {
- /*
- * In parsing a document, we get many identical requests to this
- * method, so instead of looking up (resolving) grammerURI each
- * time, we'll just return previously cached one. Probably not
- * worth have a more complex cache than that.
- */
- if (cached && sameAs(fCachedPublicID, publicId) && sameAs(fCachedSystemID, systemId)) {
- grammerURI = fCachedGrammerURI;
- }
- else {
- grammerURI = idResolver.resolve(null, publicId, systemId);
- fCachedGrammerURI = grammerURI;
- fCachedPublicID = publicId;
- fCachedSystemID = systemId;
- cached = true;
- }
- }
- else {
- grammerURI = idResolver.resolve(null, publicId, systemId);
- }
-
- if (grammerURI == null)
- return null;
-
- /*
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=88896
- *
- * We once called the deprecated 2 argument form of getCMDocument.
- *
- * CMDocument cmDocument = documentManager.getCMDocument(publicId,
- * grammerURI);
- *
- * which eventually resulted in empty string for type, which I don't
- * think the infrastructure handles any longer. So, I deleted
- * deprecated methods, and switched to null for type argument.
- *
- * 'null' means to "create based on uri".
- *
- * FYI, 'dtd' would mean load only those registered as dtd's
- *
- * CMDocument cmDocument = documentManager.getCMDocument(publicId,
- * grammerURI); CMDocument cmDocument =
- * documentManager.getCMDocument(publicId, grammerURI, "dtd");
- */
- CMDocument cmDocument = documentManager.getCMDocument(publicId, grammerURI, null);
- return cmDocument;
- }
-
- /**
- */
- protected String resolveGrammarURI(Document document, String publicId, String systemId) {
- return idResolver.resolve(null, publicId, systemId);
- }
-
- private boolean sameAs(String a, String b) {
- boolean result = false;
- if (a == null) {
- result = b == null;
- }
- else {
- result = a.equals(b);
- }
- return result;
- }
-
- /**
- * This added and/or made public specifically for experimentation. It
- * will change as this functionality becomes API. See
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=119084
- */
- public String getCachedGrammerURI() {
- return fCachedGrammerURI;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
deleted file mode 100644
index e302b81e87..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-
-/**
- * Sets default values for HTML Core preferences
- */
-public class HTMLCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
- // formatting preferences
- node.putInt(HTMLCorePreferenceNames.LINE_WIDTH, 72);
- node.putBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
- node.put(HTMLCorePreferenceNames.INDENTATION_CHAR, HTMLCorePreferenceNames.TAB);
- node.putInt(HTMLCorePreferenceNames.INDENTATION_SIZE, 1);
- node.putBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS, false);
-
- // cleanup preferences
- node.putInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.ASIS);
- node.putInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.ASIS);
- // node.putBoolean(HTMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS,
- // true);
- node.putBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, true);
- node.putBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, true);
- node.putBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, true);
- node.putBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE, true);
- node.putBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES, false);
-
- // code generation preferences
- node.put(CommonEncodingPreferenceNames.INPUT_CODESET, ""); //$NON-NLS-1$
- String defaultEnc = "UTF-8";//$NON-NLS-1$
- String systemEnc = System.getProperty("file.encoding"); //$NON-NLS-1$
- if (systemEnc != null) {
- defaultEnc = CommonCharsetNames.getPreferredDefaultIanaName(systemEnc, "UTF-8");//$NON-NLS-1$
- }
- node.put(CommonEncodingPreferenceNames.OUTPUT_CODESET, defaultEnc);
- node.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, ""); //$NON-NLS-1$
-
- node.putInt(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- node.putInt(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-
- // this could be made smarter by actually looking up the content
- // type's valid extensions
- node.put(HTMLCorePreferenceNames.DEFAULT_EXTENSION, "html"); //$NON-NLS-1$
-
- // HTML Validation Severities
- node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_START, ValidationMessage.ERROR);
- node.putInt(HTMLCorePreferenceNames.ELEM_MISSING_END, ValidationMessage.WARNING);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
deleted file mode 100644
index 28f019596f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.core.internal.preferences;
-
-/**
- * Common preference keys used by HTML core
- *
- * @plannedfor 1.0
- */
-public class HTMLCorePreferenceNames {
- private HTMLCorePreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- /**
- * The default extension to use when none is specified in the New HTML
- * File Wizard.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
-
- /**
- * The maximum width of a line before a line split is needed.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String LINE_WIDTH = "lineWidth";//$NON-NLS-1$
-
- /**
- * Indicates if all blanks lines should be cleared during formatting.
- * Blank lines will be kept when false.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String CLEAR_ALL_BLANK_LINES = "clearAllBlankLines";//$NON-NLS-1$
-
- /**
- * The number of #INDENTATION_CHAR for 1 indentation.
- * <p>
- * Value is of type <code>Integer</code>.
- * </p>
- */
- public static final String INDENTATION_SIZE = "indentationSize";//$NON-NLS-1$
-
- /**
- * The character used for indentation.
- * <p>
- * Value is of type <code>String</code>.<br />
- * Possible values: {TAB, SPACE}
- * </p>
- */
- public static final String INDENTATION_CHAR = "indentationChar";//$NON-NLS-1$
-
- /**
- * Possible value for the preference #INDENTATION_CHAR. Indicates to use
- * tab character when formatting.
- *
- * @see #SPACE
- * @see #INDENTATION_CHAR
- */
- public static final String TAB = "tab"; //$NON-NLS-1$
-
- /**
- * Possible value for the preference #INDENTATION_CHAR. Indicates to use
- * space character when formatting.
- *
- * @see #TAB
- * @see #INDENTATION_CHAR
- */
- public static final String SPACE = "space"; //$NON-NLS-1$
-
- /**
- * Indicates if tags with multiple attributes should be formatted
- * (splitting each attr on a new line).
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String SPLIT_MULTI_ATTRS = "splitMultiAttrs";//$NON-NLS-1$
-
- /**
- * Indicates whether or not cleanup processor should format source.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-
- /**
- * Indicates whether or not empty elements should be compressed during
- * cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String COMPRESS_EMPTY_ELEMENT_TAGS = "compressEmptyElementTags";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert required attributes during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String INSERT_REQUIRED_ATTRS = "insertRequiredAttrs";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to insert missing tags during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String INSERT_MISSING_TAGS = "insertMissingTags";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to quote all attribute values during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String QUOTE_ATTR_VALUES = "quoteAttrValues";//$NON-NLS-1$
-
- /**
- * Indicates whether or not to convert all line delimiters during cleanup.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String CONVERT_EOL_CODES = "convertEOLCodes";//$NON-NLS-1$
-
- /**
- * Indicates the line delimiter to use during cleanup if converting line
- * delimiters.
- * <p>
- * Value is of type <code>String</code>.<br />
- * Possible values: {CR, CRLF, LF, NO_TRANSLATION}
- * </p>
- *
- */
- public static final String CLEANUP_EOL_CODE = "cleanupEOLCode";//$NON-NLS-1$
-
- /**
- * Indicates case to use on all tag names during cleanup.
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER, ASIS}
- * </p>
- */
- public static final String CLEANUP_TAG_NAME_CASE = "cleanupTagNameCase";//$NON-NLS-1$
-
- /**
- * Indicates case to use on all attribute names during cleanup.
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER, ASIS}
- * </p>
- */
- public static final String CLEANUP_ATTR_NAME_CASE = "cleanupAttrNameCase";//$NON-NLS-1$
-
- /**
- * Preferred markup case for tag names in code generation
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER}
- * </p>
- */
- public static final String TAG_NAME_CASE = "tagNameCase";//$NON-NLS-1$
-
- /**
- * Preferred markup case for attribute names in code generation
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {LOWER, UPPER}
- * </p>
- */
- public static final String ATTR_NAME_CASE = "attrNameCase";//$NON-NLS-1$
-
- /**
- * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
- * Indicates to leave case as is.
- *
- * @see #LOWER
- * @see #UPPER
- * @see #TAG_NAME_CASE
- * @see #ATTR_NAME_CASE
- */
- public static final int ASIS = 0;
-
- /**
- * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
- * Indicates to make name lowercase.
- *
- * @see #ASIS
- * @see #UPPER
- * @see #TAG_NAME_CASE
- * @see #ATTR_NAME_CASE
- */
- public static final int LOWER = 1;
-
- /**
- * Possible value for the preference #TAG_NAME_CASE or #ATTR_NAME_CASE.
- * Indicates to make name uppercase.
- *
- * @see #LOWER
- * @see #ASIS
- * @see #TAG_NAME_CASE
- * @see #ATTR_NAME_CASE
- */
- public static final int UPPER = 2;
-
- /**
- * Validation severity for elements that are missing a start tag
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {IGNORE, ERROR, WARNING}
- * </p>
- */
- public static final String ELEM_MISSING_START = "elemMissingStart";//$NON-NLS-1$
-
- /**
- * Validation severity for elements that are missing an end tag
- * <p>
- * Value is of type <code>Integer</code>.<br />
- * Possible values: {IGNORE, ERROR, WARNING}
- * </p>
- */
- public static final String ELEM_MISSING_END = "elemMissingEnd";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java
deleted file mode 100644
index 9c944f0c26..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTML40Namespace.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.provisional;
-
-/**
- * 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$
- public static final String ATTR_VALUE_UPPER_ALPHA = "A"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_LOWER_ROMAN = "i"; // LI //$NON-NLS-1$
- public static final String ATTR_VALUE_UPPER_ROMAN = "I"; // LI //$NON-NLS-1$
- // for loop of BGSOUND (D205513)
- public static final String ATTR_VALUE_INFINITE = "infinite"; // BGSOUND //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
deleted file mode 100644
index 5396cd65a4..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLCMProperties.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.provisional;
-
-
-/**
- * HTMLCMProperties defines all property names and pre-defined values in HTML CM.
- * All of those properties can be retreived from element declarations of HTML CM
- * via CMNode#getProperty(String propName).
- */
-public interface HTMLCMProperties {
-
- /**
- * "shouldIgnoreCase" returns java.lang.Boolean object.
- */
- public static final String SHOULD_IGNORE_CASE = "shouldIgnoreCase";//$NON-NLS-1$
- /**
- * "shouldKeepSpace" returns java.lang.Boolean object.
- */
- public static final String SHOULD_KEEP_SPACE = "shouldKeepSpace";//$NON-NLS-1$
- /**
- * "indentChildSource" returns java.lang.Boolean object.
- */
- public static final String SHOULD_INDENT_CHILD_SOURCE = "shouldIndentChildSource";//$NON-NLS-1$
- /**
- * "terminators" returns java.util.Iterator (an array of String objects).
- */
- public static final String TERMINATORS = "terminators";//$NON-NLS-1$
- /**
- * "contentHint" returns CMElementDeclaration instnace.
- */
- public static final String CONTENT_HINT = "contentHint";//$NON-NLS-1$
- /**
- * "prohibitedAncestors" returns org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap.
- */
- public static final String PROHIBITED_ANCESTORS = "prohibitedAncestors";//$NON-NLS-1$
- /**
- * "isJSP" returns java.lang.Boolean object.
- */
- public static final String IS_JSP = "isJSP";//$NON-NLS-1$
- /**
- * "isXHTML" returns java.lang.Boolean object.
- */
- public static final String IS_XHTML = "isXHTML";//$NON-NLS-1$
- /**
- * "isSSI" returns java.lang.Boolean object.
- */
- public static final String IS_SSI = "isSSI";//$NON-NLS-1$
- /**
- * "lineBreakHint" returns String (one of pre-defined values in Values).
- */
- public static final String LINE_BREAK_HINT = "lineBreakHint";//$NON-NLS-1$
- /**
- * "layoutType" returns String (one of pre-defined values in Values).
- */
- public static final String LAYOUT_TYPE = "layoutType";//$NON-NLS-1$
- /**
- * "tagInfo" returns String (documentation for this element).
- */
- public static final String TAGINFO = "tagInfo";//$NON-NLS-1$
- /**
- * "omitType" returns String (one of pre-defined values in Values).
- */
- public static final String OMIT_TYPE = "omitType";//$NON-NLS-1$
- /**
- * "inclusion" returns org.eclipse.wst.xml.core.internal.contentmodel.CMContent.
- */
- public static final String INCLUSION = "inclusion";//$NON-NLS-1$
- /**
- * "isScriptable" returns java.lang.Boolean object.
- */
- public static final String IS_SCRIPTABLE = "isScriptable"; //$NON-NLS-1$
-
- public static interface Values {
- /*
- * for LINE_BREAK_HINT = "lineBreakHint".
- */
- public static final String BREAK_NONE = "breakNone";//$NON-NLS-1$
- public static final String BREAK_AFTER_START = "breakAfterStart";//$NON-NLS-1$
- public static final String BREAK_BEFORE_START_AND_AFTER_END = "breakBeforeStartAndAfterEnd";//$NON-NLS-1$
- /*
- * for LAYOUT_TYPE = "layoutType"
- */
- public static final String LAYOUT_BLOCK = "layoutBlock";//$NON-NLS-1$
- /** BR */
- public static final String LAYOUT_BREAK = "layoutBreak";//$NON-NLS-1$
- /** Hidden object; like HTML or HEAD */
- public static final String LAYOUT_HIDDEN = "layoutHidden";//$NON-NLS-1$
- public static final String LAYOUT_NONE = "layoutNone";//$NON-NLS-1$
- /** No wrap object; like IMG, APPLET,... */
- public static final String LAYOUT_OBJECT = "layoutObject";//$NON-NLS-1$
- public static final String LAYOUT_WRAP = "layoutWrap";//$NON-NLS-1$
- /*
- * for OMIT_TYPE = "omitType"
- */
- /** Not ommisible. */
- public static final String OMIT_NONE = "omitNone";//$NON-NLS-1$
- /** Both tags are ommisible. */
- public static final String OMIT_BOTH = "omitBoth";//$NON-NLS-1$
- /** The end tag is ommisible. */
- public static final String OMIT_END = "omitEnd";//$NON-NLS-1$
- /** The end tag is ommitted when created. */
- public static final String OMIT_END_DEFAULT = "omitEndDefault";//$NON-NLS-1$
- /** The end tag must be omitted. */
- public static final String OMIT_END_MUST = "omitEndMust";//$NON-NLS-1$
-
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.java
deleted file mode 100644
index fe2b4ea9df..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFilesPreferenceNames.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.html.core.internal.provisional;
-
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @deprecated not used in WTP
- */
-public interface HTMLFilesPreferenceNames {
-
- static final String DEFAULT_SUFFIX = "defaultSuffix";//$NON-NLS-1$
- static final String HTML_SUFFIX = "html";//$NON-NLS-1$
- static final String GENERATE_DOCUMENT_TYPE = "generateDocumentType";//$NON-NLS-1$
- static final String GENERATE_GENERATOR = "generateGenerator";//$NON-NLS-1$
- // added this as a potential way to handle changing
- // product names "up" the stack. Note, not declared final
- // to avoid getting 'inlined' by compiler.
- static IProduct product = Platform.getProduct();
- // Platform.getProduct() is spec'd so it might return null.
- // Its expected for any final product it would not be, so we'll return
- // "WTP" for development/interim builds. No need to translate.
- static String GENERATOR = (product == null) ? "WTP": product.getName(); //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.java
deleted file mode 100644
index a4cde9fa80..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/HTMLFormatContraints.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.core.internal.provisional;
-
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatContraints;
-
-/**
- * @deprecated
- * Please un-deprecate this if Page Designer thinks they are needed.
- */
-public interface HTMLFormatContraints extends IStructuredFormatContraints {
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- int getAvailableLineWidth();
-
- /**
- * @deprecated
- * It's very hard to keep the available line width accurate.
- * Sometimes a node wants to start on a new line, sometimes it doesn't.
- * It's best for the node to figure out the available line width on the fly.
- */
- void setAvailableLineWidth(int availableLineWidth);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.java
deleted file mode 100644
index 530c28d60d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/PreferenceNames.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.core.internal.provisional;
-
-
-public interface PreferenceNames {
-
- String TRUE = "true"; //$NON-NLS-1$
- String FALSE = "false"; //$NON-NLS-1$
- String YES = "yes"; //$NON-NLS-1$
- String NO = "no"; //$NON-NLS-1$
-
-
- String SETTINGS = "settings"; //$NON-NLS-1$
-
- String TREEVIEW = "treeview"; //$NON-NLS-1$
- String DEFAULT_DEPTH = "defaultdepth"; //$NON-NLS-1$
-
- String ASIS = "as-is"; //$NON-NLS-1$
- String LOWER = "lower"; //$NON-NLS-1$
- String UPPER = "upper"; //$NON-NLS-1$
-
- String PREFERRED_CASE = "preferred-case"; //$NON-NLS-1$
- String TAGNAME = "tagname"; //$NON-NLS-1$
- String ATTRIBUTENAME = "attributename"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java
deleted file mode 100644
index 35f17ff6a6..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeFamilyForHTML.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.core.internal.provisional.contenttype;
-
-/**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially set with default protected
- * method so it will not be inlined.
- */
-
-public class ContentTypeFamilyForHTML {
- /**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially not declared as final,
- * so it will not be inlined.
- */
- public final static String HTML_FAMILY = getConstantString();
-
- /**
- * Don't allow instantiation.
- */
- private ContentTypeFamilyForHTML() {
- super();
- }
-
- static String getConstantString() {
- return "org.eclipse.wst.html.core.contentfamily.html"; //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.java
deleted file mode 100644
index d01304df37..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/contenttype/ContentTypeIdForHTML.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.core.internal.provisional.contenttype;
-
-/**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially set with default protected
- * method so it will not be inlined.
- */
-
-public class ContentTypeIdForHTML {
- /**
- * The value of the contenttype id field must match what is specified in
- * plugin.xml file. Note: this value is intentially not declared as final,
- * so it will not be inlined.
- */
- public final static String ContentTypeID_HTML = getConstantString();
-
- /**
- * Don't allow instantiation.
- */
- private ContentTypeIdForHTML() {
- super();
- }
-
- static String getConstantString() {
- return "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
deleted file mode 100644
index 7fa8822019..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/provisional/text/IHTMLPartitionTypes.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.wst.html.core.internal.provisional.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for HTML. Clients should reference the partition type Strings defined
- * here directly.
- *
- * @deprecated use org.eclipse.wst.html.core.text.IHTMLPartitions
- */
-public interface IHTMLPartitionTypes {
-
- String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
- String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$
- String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$
-
- String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
- String STYLE = "org.eclipse.wst.html.STYLE"; //$NON-NLS-1$
-
- // ISSUE: I think meta tag areas are here too?
-}
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
deleted file mode 100644
index 3c93d42a6a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.text;
-
-import java.util.Locale;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion;
-import org.eclipse.wst.sse.core.internal.util.ScriptLanguageKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-
-/**
- * Document partitioner for HTML. Client-side scripts of type JavaScript are
- * reported as ST_SCRIPT, all others for <script language="foo" type="foo2">
- * as SCRIPT.language:FOO and SCRIPT.type:FOO2.
- */
-public class StructuredTextPartitionerForHTML extends StructuredTextPartitionerForXML implements IStructuredTextPartitioner {
-
- private final static String[] configuredContentTypes = new String[]{IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.HTML_DECLARATION, IHTMLPartitions.HTML_COMMENT, IHTMLPartitions.SCRIPT, ICSSPartitions.STYLE};
-
- public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$
- public static final String JAVASCRIPT_APPLICATION = "application/x-javascript"; //$NON-NLS-1$
-
- public StructuredTextPartitionerForHTML() {
- super();
- }
-
- public IStructuredTypedRegion createPartition(int offset, int length, String type) {
- if (type == IHTMLPartitions.SCRIPT) {
- IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
- if (node != null) {
- String stype = getScriptingPartitionType(node);
- return super.createPartition(offset, length, stype);
- }
- }
- return super.createPartition(offset, length, type);
- }
-
- protected void setInternalPartition(int offset, int length, String type) {
- String localType = type;
- if (type == IHTMLPartitions.SCRIPT) {
- IStructuredDocumentRegion node = fStructuredDocument.getRegionAtCharacterOffset(offset);
- if (node != null) {
- localType = getScriptingPartitionType(node);
- }
- }
- super.setInternalPartition(offset, length, localType);
- }
-
- private String getScriptingPartitionType(IStructuredDocumentRegion coreNode) {
- String language = null;
- String type = null;
- String result = IHTMLPartitions.SCRIPT;
- IStructuredDocumentRegion node = coreNode;
- ITextRegion attrNameRegion = null;
- while (node != null && isValidScriptingRegionType(node.getType())) {
- node = node.getPrevious();
- }
-
- ITextRegionList regions = node.getRegions();
- if (regions.size() > 4 && regions.get(1).getType() == DOMRegionContext.XML_TAG_NAME) {
- ITextRegion potentialLanguageRegion = regions.get(1);
- String potentialLanguageString = node.getText(potentialLanguageRegion);
- if (potentialLanguageString.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) {
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion region = regions.get(i);
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
- attrNameRegion = region;
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- String attrName = node.getText(attrNameRegion);
- if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_LANGUAGE))
- language = StringUtils.strip(node.getText(region));
- else if (attrName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_TYPE)) {
- type = StringUtils.strip(node.getText(region));
- break;
- }
- attrNameRegion = null;
- }
- }
- }
- }
- if (type != null)
- result = lookupScriptType(type);
- else if (language != null)
- result = lookupScriptLanguage(language);
- return result;
- }
-
- private boolean isValidScriptingRegionType(String type) {
- return type == DOMRegionContext.BLOCK_TEXT || type == DOMRegionContext.XML_CDATA_OPEN || type == DOMRegionContext.XML_CDATA_TEXT || type == DOMRegionContext.XML_CDATA_CLOSE;
- }
-
- protected void initLegalContentTypes() {
- fSupportedTypes = getConfiguredContentTypes();
- }
-
- private String lookupScriptType(String type) {
- for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++)
- if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type))
- return IHTMLPartitions.SCRIPT;
- return IHTMLPartitions.SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
- }
-
- private String lookupScriptLanguage(String language) {
- for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++)
- if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language))
- return IHTMLPartitions.SCRIPT;
- return IHTMLPartitions.SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$
- }
-
- public String getPartitionType(ITextRegion region, int offset) {
- String result = null;
- if (region.getType() == DOMRegionContext.XML_COMMENT_TEXT || region.getType() == DOMRegionContext.XML_COMMENT_OPEN)
- result = IHTMLPartitions.HTML_COMMENT;
- else if (region.getType() == DOMRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == DOMRegionContext.XML_DECLARATION_OPEN)
- result = IHTMLPartitions.HTML_DECLARATION;
- else
- result = super.getPartitionType(region, offset);
- return result;
- }
-
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
-
- ITextRegion previousStartTagNameRegion = null;
- ITextRegion nextEndTagNameRegion = null;
-
- ITextRegion[] regions = previousNode.getRegions().toArray();
- for (int i = 0; i < regions.length; i++) {
- if(regions[i].getType() == DOMRegionContext.XML_TAG_NAME) {
- previousStartTagNameRegion = regions[i];
- break;
- }
- }
- regions = nextNode.getRegions().toArray();
- for (int i = 0; i < regions.length; i++) {
- if(regions[i].getType() == DOMRegionContext.XML_TAG_NAME) {
- nextEndTagNameRegion = regions[i];
- break;
- }
- }
-
- if(previousStartTagNameRegion == null || nextEndTagNameRegion == null)
- return IHTMLPartitions.HTML_DEFAULT;
-
- String name1 = previousNode.getText(previousStartTagNameRegion);
- String name2 = nextNode.getText(nextEndTagNameRegion);
- if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
- // return ST_SCRIPT;
- return getScriptingPartitionType(fStructuredDocument.getRegionAtCharacterOffset(previousNode.getStartOffset(previousStartTagNameRegion)));
- else if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
- return ICSSPartitions.STYLE;
- return super.getPartitionTypeBetween(previousNode, nextNode);
- }
-
-
- protected String getPartitionType(ForeignRegion region, int offset) {
- String tagname = region.getSurroundingTag();
- String result = null;
- // tagname should not be null,
- // but see https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=4911
- if (tagname == null) {
- result = getUnknown();
- }
- else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT))
- result = IHTMLPartitions.SCRIPT;
- else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE))
- result = ICSSPartitions.STYLE;
- else
- result = super.getPartitionType(region, offset);
-
- return result;
- }
-
- public String getDefaultPartitionType() {
- return IHTMLPartitions.HTML_DEFAULT;
- }
-
- public IDocumentPartitioner newInstance() {
- return new StructuredTextPartitionerForHTML();
- }
-
- /**
- * @return
- */
- public static String[] getConfiguredContentTypes() {
- return configuredContentTypes;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java
deleted file mode 100644
index b9b4d93d19..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.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.core.internal.validate;
-
-abstract class AbstractErrorInfo implements ErrorInfo, ErrorState {
-
-
- private int state = NONE_ERROR;
- private Segment seg = null;
-
- public AbstractErrorInfo(int state, Segment seg) {
- super();
- this.state = state;
- this.seg = seg;
- }
-
- abstract public String getHint();
-
- abstract public short getTargetType();
-
- public int getLength() {
- return (seg == null) ? 0 : seg.getLength();
- }
-
- public int getOffset() {
- return (seg == null) ? 0 : seg.getOffset();
- }
-
- public int getState() {
- return this.state;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
deleted file mode 100644
index a8af2e59f2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CMUtil.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.modelquery.HMQUtil;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMGroup;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNodeList;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-final class CMUtil {
-
- /**
- * Never instantiate!
- */
- private CMUtil() {
- super();
- }
-
- /**
- * You cannot always retrieve HTMLElementDeclaration via an Element instance.
- * Because, it occasionally a JSP custom tag. -- 9/7/2001
- */
- public static CMElementDeclaration getDeclaration(Element target) {
- Document doc = target.getOwnerDocument();
- ModelQuery query = ModelQueryUtil.getModelQuery(doc);
- return query.getCMElementDeclaration(target);
- }
-
- /**
- */
- public static boolean isCaseSensitive(CMElementDeclaration decl) {
- if (decl == null || (!decl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE)))
- return false;
- return !((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- /**
- */
- private static boolean isChild(CMContent content, CMElementDeclaration target) {
- switch (content.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- if (isWholeTagOmissible((CMElementDeclaration) content))
- if (isChild(((CMElementDeclaration) content).getContent(), target))
- return true;
- return isSameDeclaration((CMElementDeclaration) content, target);
- case CMNode.GROUP :
- CMNodeList children = ((CMGroup) content).getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- CMNode child = children.item(i);
- switch (child.getNodeType()) {
- case CMNode.ELEMENT_DECLARATION :
- if (isWholeTagOmissible((CMElementDeclaration) child))
- if (isChild(((CMElementDeclaration) child).getContent(), target))
- return true;
- if (isSameDeclaration((CMElementDeclaration) child, target))
- return true;
- continue; // Go next child.
- case CMNode.GROUP :
- if (isChild((CMContent) child, target))
- return true;
- continue; // Go next child.
- default :
- continue; // Go next child.
- }
- }
- }
- return false;
- }
-
- /**
- */
- public static boolean isEndTagOmissible(CMElementDeclaration decl) {
- if (!(decl.supports(HTMLCMProperties.OMIT_TYPE)))
- return false;
- String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE);
- return !omitType.equals(HTMLCMProperties.Values.OMIT_NONE);
- }
-
- /**
- */
- public static boolean isWholeTagOmissible(CMElementDeclaration decl) {
- if (!(decl.supports(HTMLCMProperties.OMIT_TYPE)))
- return false;
- String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE);
- return omitType.equals(HTMLCMProperties.Values.OMIT_BOTH);
- }
-
- /**
- */
- public static boolean isJSP(CMElementDeclaration decl) {
- if (!decl.supports(HTMLCMProperties.IS_JSP))
- return false;
- return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue();
- }
-
- /**
- */
- public static boolean isXHTML(CMElementDeclaration decl) {
- if (!decl.supports(HTMLCMProperties.IS_XHTML))
- return false;
- return ((Boolean) decl.getProperty(HTMLCMProperties.IS_XHTML)).booleanValue();
- }
-
- /**
- * The method to distinguish HTML and XHTML from other mark up.
- * This method returns true if the target is,
- * (1) not JSP,
- * (2) not SSI.
- */
- public static boolean isHTML(CMElementDeclaration decl) {
- return (!isJSP(decl)) && (!isSSI(decl));
- }
-
- /**
- */
- private static boolean isSameDeclaration(CMElementDeclaration aDec, CMElementDeclaration otherDec) {
- return aDec.getElementName() == otherDec.getElementName();
- }
-
- /**
- */
- public static boolean isSSI(CMElementDeclaration edec) {
- if (edec == null)
- return false;
- if (!edec.supports(HTMLCMProperties.IS_SSI))
- return false;
- return ((Boolean) edec.getProperty(HTMLCMProperties.IS_SSI)).booleanValue();
- }
-
- /**
- * Call this method only when the parent content type is one of
- * the following: ANY, ELEMENT, or MIXED.
- */
- public static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
- if (parent == null || child == null)
- return false;
- if (isHTML(parent) && (!isHTML(child)))
- return true;
- CMContent content = parent.getContent();
- if (content == null)
- return false;
- return isChild(content, child);
- }
-
- public static boolean isForeign(Element target) {
- if (!(target instanceof IDOMElement))
- return true;
- IDOMElement element = (IDOMElement) target;
- return !element.isGlobalTag();
- }
-
- /**
- * This method returns true if all of the following conditions are met:
- * (1) value type is ENUM,
- * (2) only one value is defined in the enumeration,
- * (3) the value has same name to the attribute name.
- */
- public static boolean isBooleanAttr(CMAttributeDeclaration adec) {
- CMDataType attrtype = adec.getAttrType();
- if (attrtype == null)
- return false;
- if (attrtype.getDataTypeName() != CMDataType.ENUM)
- return false;
- String[] values = attrtype.getEnumeratedValues();
- if (values.length != 1)
- return false;
- return values[0].equals(adec.getAttrName());
- }
-
- public static boolean isValidInclusion(CMElementDeclaration decl, Element parent) {
- Iterator iter = HMQUtil.getInclusions(parent).iterator();
- while (iter.hasNext()) {
- CMElementDeclaration inclusion = (CMElementDeclaration) iter.next();
- if (isSameDeclaration(decl, inclusion))
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java
deleted file mode 100644
index 0ad2128e7a..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/CompositeValidator.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-abstract class CompositeValidator extends ValidationComponent {
-
- protected Vector components = new Vector();
-
- /**
- * CompositeValidator constructor comment.
- */
- public CompositeValidator() {
- super();
- }
-
- /**
- */
- public void setReporter(ValidationReporter reporter) {
- super.setReporter(reporter);
-
- Iterator i = components.iterator();
- while (i.hasNext()) {
- ValidationAdapter component = (ValidationAdapter) i.next();
- if (component == null)
- continue;
- component.setReporter(reporter);
- }
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- Iterator i = components.iterator();
- while (i.hasNext()) {
- ValidationComponent component = (ValidationComponent) i.next();
- if (component == null)
- continue;
- component.validate(node);
- }
- }
-
- /**
- */
- void add(ValidationComponent validator) {
- components.add(validator);
- }
-
- /**
- * This method registers all components in 'validators'.
- * Each derivative must call this methid in its constructor.
- */
- protected void register(ValidationComponent[] validators) {
- for (int i = 0; i < validators.length; i++) {
- if (validators[i] != null)
- add(validators[i]);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java
deleted file mode 100644
index 1bb7a86ae3..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/DocumentPropagatingValidator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.AbstractPropagatingValidator;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class DocumentPropagatingValidator extends AbstractPropagatingValidator {
-
-
- private ValidationComponent validator = new HTMLSimpleDocumentValidator();
- private ElementPropagatingValidator propagatee = new ElementPropagatingValidator();
-
- public DocumentPropagatingValidator() {
- super();
- }
-
- public void validate(IndexedRegion node) {
- getPropagatee().setReporter(this.reporter);
- super.validate(node);
- }
-
- public boolean isAdapterForType(Object type) {
- return (type == DocumentPropagatingValidator.class || super.isAdapterForType(type));
- }
-
- public void setReporter(ValidationReporter reporter) {
- super.setReporter(reporter);
- validator.setReporter(reporter);
- propagatee.setReporter(reporter);
- }
-
- protected final ValidationComponent getPropagatee() {
- return propagatee;
- }
-
- protected final ValidationAdapter getValidator() {
- return validator;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.java
deleted file mode 100644
index 5b837419ac..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ElementPropagatingValidator.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.wst.html.core.internal.validate;
-
-
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.AbstractPropagatingValidator;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class ElementPropagatingValidator extends AbstractPropagatingValidator {
-
-
- private ValidationComponent validator = new HTMLSimpleValidator();
-
- public ElementPropagatingValidator() {
- super();
- }
-
- public boolean isAdapterForType(Object type) {
- return (type == ElementPropagatingValidator.class || super.isAdapterForType(type));
- }
-
- public void setReporter(ValidationReporter reporter) {
- super.setReporter(reporter);
- validator.setReporter(reporter);
- }
-
- protected ValidationComponent getPropagatee() {
- return this;
- }
-
- protected ValidationAdapter getValidator() {
- return validator;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.java
deleted file mode 100644
index 34b430e71b..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfo.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.core.internal.validate;
-
-
-
-interface ErrorInfo {
-
- public String getHint();
-
- public int getLength();
-
- public int getOffset();
-
- public int getState();
-
- public short getTargetType();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.java
deleted file mode 100644
index 6026c2c4c9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorInfoImpl.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.core.internal.validate;
-
-
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-final class ErrorInfoImpl extends AbstractErrorInfo {
-
- private Node target = null;
-
- // private Segment seg = null;
- /**
- */
- public ErrorInfoImpl(int state, Segment errorSeg, Node target) {
- super(state, errorSeg);
- this.target = target;
- }
-
- /**
- */
- public String getHint() {
- switch (target.getNodeType()) {
- case Node.ATTRIBUTE_NODE :
- switch (getState()) {
- case UNDEFINED_VALUE_ERROR :
- case MISMATCHED_VALUE_ERROR :
- case UNCLOSED_ATTR_VALUE :
- //D210422
- return ((Attr) target).getValue();
- default :
- return target.getNodeName();
- }
- case Node.TEXT_NODE :
- return ((Text) target).getData();
- case Node.ELEMENT_NODE :
- default :
- return target.getNodeName();
- }
- }
-
- public short getTargetType() {
- return target.getNodeType();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
deleted file mode 100644
index f7259400e9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/ErrorState.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-interface ErrorState {
- static final int NONE_ERROR = 0;
- // generic error
- static final int UNDEFINED_NAME_ERROR = 11;
- static final int UNDEFINED_VALUE_ERROR = 12;
- static final int MISMATCHED_VALUE_ERROR = 13;
- // format error
- static final int FORMAT_ERROR_LEVEL = 100;
- static final int INVALID_NAME_ERROR = 101;
- static final int INVALID_CHAR_ERROR = 102;
- static final int MISMATCHED_ERROR = 103;
- static final int MISMATCHED_END_TAG_ERROR = 104;
- static final int MISSING_START_TAG_ERROR = 105;
- static final int MISSING_END_TAG_ERROR = 106;
- static final int UNNECESSARY_END_TAG_ERROR = 107;
- static final int INVALID_ATTR_ERROR = 108;
- static final int INVALID_DIRECTIVE_ERROR = 109;
- static final int UNCLOSED_TAG_ERROR = 110;
- static final int UNCLOSED_END_TAG_ERROR = 111;
- static final int INVALID_EMPTY_ELEMENT_TAG = 112;
- static final int UNCLOSED_ATTR_VALUE = 113; //D210422
- // layout error
- static final int LAYOUT_ERROR_LEVEL = 1000;
- static final int INVALID_CONTENT_ERROR = 1001;
- static final int DUPLICATE_ERROR = 1002;
- static final int COEXISTENCE_ERROR = 1003;
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.java
deleted file mode 100644
index c16984c8c2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/FMUtil.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.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-final class FMUtil {
-
- public final static int SEG_NONE = 0;
- public final static int SEG_WHOLE_TAG = 1;
- public final static int SEG_START_TAG = 2;
- public final static int SEG_END_TAG = 3;
-
- /**
- */
- private FMUtil() {
- super();
- }
-
- /**
- */
- public final static Segment getSegment(IDOMNode target, int segType) {
- if (target == null)
- return new Segment(0, 0);
- Segment seg = null;
- IStructuredDocumentRegion startTag = null;
- IStructuredDocumentRegion endTag = null;
- switch (segType) {
- case SEG_WHOLE_TAG :
- startTag = target.getFirstStructuredDocumentRegion();
- if (startTag != null) {
- endTag = target.getLastStructuredDocumentRegion();
- seg = new Segment(startTag, endTag);
- }
- else {
- int startOffset = target.getStartOffset();
- int endOffset = target.getEndOffset();
- seg = new Segment(startOffset, endOffset - startOffset);
- }
- break;
- case SEG_START_TAG :
- startTag = target.getStartStructuredDocumentRegion();
- if (startTag != null) {
- seg = new Segment(startTag);
- }
- else {
- seg = new Segment(target.getStartOffset(), 0);
- }
- break;
- case SEG_END_TAG :
- endTag = target.getEndStructuredDocumentRegion();
- if (endTag != null) {
- seg = new Segment(endTag);
- }
- else {
- seg = new Segment(target.getEndOffset(), 0);
- }
- break;
- case SEG_NONE :
- default :
- return new Segment(0, 0);
- }
- return seg;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
deleted file mode 100644
index 50cbd7ea9c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-public class HTMLAttributeValidator extends PrimeValidator {
-
- private static final int REGION_NAME = 1;
- private static final int REGION_VALUE = 2;
- // <<D210422
- private static final char SINGLE_QUOTE = '\'';
- private static final char DOUBLE_QUOTE = '\"';
-
- // D210422
- /**
- * HTMLAttributeValidator constructor comment.
- */
- public HTMLAttributeValidator() {
- super();
- }
-
- /**
- */
- private Segment getErrorSegment(IDOMNode errorNode, int regionType) {
- ITextRegion rgn = null;
- switch (regionType) {
- case REGION_NAME :
- rgn = errorNode.getNameRegion();
- break;
- case REGION_VALUE :
- rgn = errorNode.getValueRegion();
- break;
- default :
- // nothing to do.
- break;
- }
- if (rgn != null) {
- if (errorNode instanceof IDOMAttr) {
- IDOMElement ownerElement = (IDOMElement) ((IDOMAttr) errorNode).getOwnerElement();
- if (ownerElement != null) {
- int regionStartOffset = ownerElement.getFirstStructuredDocumentRegion().getStartOffset(rgn);
- int regionLength = rgn.getLength();
- return new Segment(regionStartOffset, regionLength);
- }
- }
- }
- return new Segment(errorNode.getStartOffset(), 0);
- }
-
- /**
- * 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 == HTMLAttributeValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (CMUtil.isForeign(target))
- return;
- CMElementDeclaration edec = CMUtil.getDeclaration(target);
- if (edec == null)
- return;
- CMNamedNodeMap declarations = edec.getAttributes();
-
- NamedNodeMap attrs = target.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- int rgnType = REGION_NAME;
- int state = ErrorState.NONE_ERROR;
- Attr a = (Attr) attrs.item(i);
- // D203637; If the target attr has prefix, the validator should
- // not
- // warn about it. That is, just ignore. It is able to check
- // whether
- // an attr has prefix or not by calling XMLAttr#isGlobalAttr().
- // When a attr has prefix (not global), it returns false.
- boolean isXMLAttr = a instanceof IDOMAttr;
- if (isXMLAttr) {
- IDOMAttr xmlattr = (IDOMAttr) a;
- if (!xmlattr.isGlobalAttr())
- continue; // skip futher validation and begin next loop.
- }
-
- CMAttributeDeclaration adec = (CMAttributeDeclaration) declarations.getNamedItem(a.getName());
- if (adec == null) {
- // No attr declaration was found. That is, the attr name is
- // undefined.
- // but not regard it as undefined name if it includes JSP
- if (!hasJSPRegion(((IDOMNode) a).getNameRegion())) {
- rgnType = REGION_NAME;
- state = ErrorState.UNDEFINED_NAME_ERROR;
- }
- }
- else {
- // The attr declaration was found.
- // At 1st, the name should be checked.
- if (CMUtil.isHTML(edec) && (!CMUtil.isXHTML(edec))) {
- // If the target element is pure HTML (not XHTML), some
- // attributes
- // might be written in boolean format. It should be check
- // specifically.
- if (CMUtil.isBooleanAttr(adec) && ((IDOMAttr) a).hasNameOnly())
- continue; // OK, keep going. No more check is needed
- // against this attr.
- }
- else {
- // If the target is other than pure HTML (JSP or XHTML),
- // the name
- // must be checked exactly (ie in case sensitive way).
- String actual = a.getName();
- String desired = adec.getAttrName();
- if (!actual.equals(desired)) { // case mismatch
- rgnType = REGION_NAME;
- state = ErrorState.MISMATCHED_ERROR;
- }
- }
- // Then, the value must be checked.
- if (state == ErrorState.NONE_ERROR) { // Need more check.
- // Now, the value should be checked, if the type is ENUM.
- CMDataType attrType = adec.getAttrType();
- String actualValue = a.getValue();
- if (attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) {
- // Check FIXED value.
- String validValue = attrType.getImpliedValue();
- if (!actualValue.equals(validValue)) {
- rgnType = REGION_VALUE;
- state = ErrorState.UNDEFINED_VALUE_ERROR;
- }
- }
- else {
- String[] candidates = attrType.getEnumeratedValues();
- if (candidates != null && candidates.length > 0) {
- // several candidates are found.
- boolean found = false;
- for (int index = 0; index < candidates.length; index++) {
- String candidate = candidates[index];
- // At 1st, compare ignoring case.
- if (actualValue.equalsIgnoreCase(candidate)) {
- found = true;
- if (CMUtil.isCaseSensitive(edec) && (!actualValue.equals(candidate))) {
- rgnType = REGION_VALUE;
- state = ErrorState.MISMATCHED_VALUE_ERROR;
- }
- break; // exit the loop.
- }
- }
- if (!found) {
- // No candidate was found. That is,
- // actualValue is invalid.
- // but not regard it as undefined value if it
- // includes JSP.
- if (!hasJSPRegion(((IDOMNode) a).getValueRegion())) {
- rgnType = REGION_VALUE;
- state = ErrorState.UNDEFINED_VALUE_ERROR;
- }
- }
- }
- }
- }
- // <<D210422
- if (state == ErrorState.NONE_ERROR) { // Need more check.
- if (isXMLAttr) {
- String source = ((IDOMAttr) a).getValueRegionText();
- if (source != null) {
- char firstChar = source.charAt(0);
- char lastChar = source.charAt(source.length() - 1);
- if (isQuote(firstChar) || isQuote(lastChar)) {
- if (lastChar != firstChar) {
- rgnType = REGION_VALUE;
- state = ErrorState.UNCLOSED_ATTR_VALUE;
- }
- }
- }
- }
- }
- // D210422
- }
- if (state != ErrorState.NONE_ERROR) {
- Segment seg = getErrorSegment((IDOMNode) a, rgnType);
- if (seg != null)
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(state, seg, a)));
- }
- }
- }
-
- /**
- */
- private boolean hasJSPRegion(ITextRegion container) {
- if (!(container instanceof ITextRegionContainer))
- return false;
- ITextRegionList regions = ((ITextRegionContainer) container).getRegions();
- if (regions == null)
- return false;
- Iterator e = regions.iterator();
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- if (region == null)
- continue;
- String regionType = region.getType();
- if (regionType == DOMRegionContext.XML_TAG_OPEN || (isNextedTagName(regionType)))
- return true;
- }
- return false;
- }
-
- /**
- * ISSUE: this is a bit of hidden JSP knowledge that was implemented this
- * way for expedency. Should be evolved in future to depend on "nestedContext".
- */
- private boolean isNextedTagName(String regionType) {
- final String JSP_SCRIPTLET_OPEN = "JSP_SCRIPTLET_OPEN"; //$NON-NLS-1$
- final String JSP_EXPRESSION_OPEN = "JSP_EXPRESSION_OPEN"; //$NON-NLS-1$
- final String JSP_DECLARATION_OPEN = "JSP_DECLARATION_OPEN"; //$NON-NLS-1$
- final String JSP_DIRECTIVE_OPEN = "JSP_DIRECTIVE_OPEN"; //$NON-NLS-1$
-
- boolean result = regionType.equals(JSP_SCRIPTLET_OPEN) || regionType.equals(JSP_EXPRESSION_OPEN) || regionType.equals(JSP_DECLARATION_OPEN) || regionType.equals(JSP_DIRECTIVE_OPEN);
- return result;
- }
-
- // <<D214022
- private boolean isQuote(char c) {
- return (c == SINGLE_QUOTE) || (c == DOUBLE_QUOTE);
- }
- // D210422
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java
deleted file mode 100644
index 026e6d2bf9..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLDocumentContentValidator.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class HTMLDocumentContentValidator extends PrimeValidator {
-
-
- private final static class Division {
- private Vector explicitHtmls = new Vector();
- private Vector rest = new Vector();
-
- public Division(Document document, NodeList children) {
- String rootTagName = getRootTagName(document);
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (isHtmlTag(child, rootTagName)) {
- explicitHtmls.add(child);
- }
- else {
- rest.add(child);
- }
- }
- }
-
- public boolean hasExplicitHtmls() {
- return explicitHtmls.size() > 0;
- }
-
- public List getExplicitHtmls() {
- return explicitHtmls;
- }
-
- public Iterator getRestNodes() {
- return rest.iterator();
- }
-
- /* utilities */
- private static boolean isHtmlTag(Node node, String tagName) {
- if (node.getNodeType() != Node.ELEMENT_NODE)
- return false;
- return ((Element) node).getTagName().equalsIgnoreCase(tagName);
- }
-
- private static String getRootTagName(Document document) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) ((IDOMDocument) document).getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null) {
- DocumentType docType = adapter.getDocumentType();
- if (docType != null) {
- return docType.getName();
- }
- }
-
- return HTML40Namespace.ElementName.HTML;
- }
- }
-
- /**
- * HTMLDocumentContentValidator constructor comment.
- */
- public HTMLDocumentContentValidator() {
- super();
- }
-
- /**
- * 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 == HTMLDocumentContentValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- // isFragment check should be more intelligent.
- boolean isFragment = true;
-
- Document target = (Document) node;
- NodeList children = target.getChildNodes();
- if (children == null)
- return;
-
- Division division = new Division(target, children);
- if (division.hasExplicitHtmls()) {
- isFragment = false;
-
- List explicits = division.getExplicitHtmls();
- if (explicits.size() > 1) {
- for (int i = 1; i < explicits.size(); i++) {
- Element html = (Element) explicits.get(i);
- // report error (duplicate)
- Segment errorSeg = FMUtil.getSegment((IDOMNode) html, FMUtil.SEG_START_TAG);
- if (errorSeg != null)
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(ErrorState.DUPLICATE_ERROR, errorSeg, html)));
- }
- }
- }
- validateContent(division.getRestNodes(), isFragment);
- }
-
- /*
- * This methods validate nodes other than HTML elements.
- */
- private void validateContent(Iterator children, boolean isFragment) {
- boolean foundDoctype = false;
- while (children.hasNext()) {
- IDOMNode child = (IDOMNode) children.next();
-
- int error = ErrorState.NONE_ERROR;
- int segType = FMUtil.SEG_WHOLE_TAG;
-
- switch (child.getNodeType()) {
- case Node.ELEMENT_NODE :
- if (!isFragment) {
- Element childElem = (Element) child;
- CMElementDeclaration ced = CMUtil.getDeclaration(childElem);
- // Undefined element is valid.
- if (ced == null)
- continue;
- // JSP (includes custom tags) and SSI are valid.
- if (CMUtil.isForeign(childElem) || CMUtil.isSSI(ced))
- continue; // Defect 186774
-
- // report error (invalid content)
- error = ErrorState.INVALID_CONTENT_ERROR;
- // mark the whole start tag as error.
- segType = FMUtil.SEG_START_TAG;
- }
- break;
- case Node.TEXT_NODE :
- if (!isFragment) {
- // TEXT node is valid when it contains white space
- // characters only.
- // Otherwise, it is invalid content.
- if (((IDOMText) child).isElementContentWhitespace())
- continue;
- error = ErrorState.INVALID_CONTENT_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- }
- break;
- case Node.DOCUMENT_TYPE_NODE :
- // DOCTYPE is also valid when it appears once and only
- // once.
- if (!foundDoctype) {
- foundDoctype = true;
- continue;
- }
- error = ErrorState.DUPLICATE_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- case Node.COMMENT_NODE :
- // always valid.
- case Node.PROCESSING_INSTRUCTION_NODE :
- continue;
- default :
- if (!isFragment) {
- error = ErrorState.INVALID_CONTENT_ERROR;
- segType = FMUtil.SEG_WHOLE_TAG;
- }
- break;
- }
- if (error != ErrorState.NONE_ERROR) {
- Segment errorSeg = FMUtil.getSegment(child, segType);
- if (errorSeg != null)
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(error, errorSeg, child)));
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.java
deleted file mode 100644
index 6ae5e13f63..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementAncestorValidator.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.core.internal.validate;
-
-
-
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-
-public class HTMLElementAncestorValidator extends PrimeValidator {
-
- /**
- * HTMLElementAncestorValidator constructor comment.
- */
- public HTMLElementAncestorValidator() {
- super();
- }
-
- /**
- * 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 == HTMLElementAncestorValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- * Check exclusion which is defined in only HTML DTD (SGML).
- */
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (CMUtil.isForeign(target))
- return;
- CMElementDeclaration dec = CMUtil.getDeclaration(target);
- if (dec == null)
- return; // cannot validate.
- if (!CMUtil.isHTML(dec))
- return; // no need to validate
- if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS))
- return; // cannot validate.
- CMNamedNodeMap prohibited = (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS);
- if (prohibited.getLength() <= 0)
- return; // no prohibited ancestors.
-
- Element parent = SMUtil.getParentElement(target);
- while (parent != null) {
- CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
- if (pdec != null) { // prohibited element is found in ancestors.
- Segment errorSeg = FMUtil.getSegment((IDOMNode) node, FMUtil.SEG_START_TAG);
- if (errorSeg != null)
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(ErrorState.INVALID_CONTENT_ERROR, errorSeg, target)));
- break; // If one prohibited ancestor is found, it's enough.
- }
- parent = SMUtil.getParentElement(parent);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
deleted file mode 100644
index 8ec0839321..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLElementContentValidator.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class HTMLElementContentValidator extends PrimeValidator {
-
- /**
- * HTMLElementContentValidator constructor comment.
- */
- public HTMLElementContentValidator() {
- super();
- }
-
- /**
- * 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 == HTMLElementContentValidator.class) || super.isAdapterForType(type));
- }
-
- /**
- */
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (CMUtil.isForeign(target))
- return;
-
- validateContent(target, target.getChildNodes());
- }
-
- private void validateContent(Element parent, NodeList children) {
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child == null)
- continue;
-
- // perform actual validation
- validateNode(parent, child);
- }
- }
-
- // private int countExplicitSiblings(Element parent, String tagName) {
- // NodeList children = parent.getChildNodes();
- // int count = 0;
- // for (int i = 0; i < children.getLength(); i++) {
- // Node child = children.item(i);
- // if (child.getNodeType() != Node.ELEMENT_NODE)
- // continue;
- // if (tagName.equalsIgnoreCase(((Element) child).getTagName())) {
- // count++;
- // }
- // }
- // return count;
- // }
-
- /*
- * The implementation of the following method is practical but accurate.
- * The accurate maximum occurence should be retreive from the content
- * model. However, it is useful enough, since almost implicit elements are
- * HTML, HEAD, or BODY.
- */
- // private int getMaxOccur(Element parent, String childTag) {
- // return 1;
- // }
- private void validateNode(Element target, Node child) {
- // NOTE: If the target element is 'UNKNOWN', that is, it has no
- // element declaration, the content type of the element should be
- // regarded as 'ANY'. -- 9/10/2001
- int contentType = CMElementDeclaration.ANY;
- CMElementDeclaration edec = CMUtil.getDeclaration(target);
- if (edec != null)
- contentType = edec.getContentType();
-
- int error = ErrorState.NONE_ERROR;
- int segType = FMUtil.SEG_WHOLE_TAG;
-
- switch (child.getNodeType()) {
- case Node.ELEMENT_NODE :
- Element childElem = (Element) child;
- // Defect 200321:
- // This validator cares only HTML/XHTML elements. If a child
- // is
- // an element of foreign markup languages, just ignore it.
- if (CMUtil.isForeign(childElem))
- return;
-
- CMElementDeclaration ced = CMUtil.getDeclaration((Element) child);
- // Defect 186774: If a child is not one of HTML elements,
- // it should be regarded as a valid child regardless the
- // type of the parent content model. -- 10/12/2001
- if (ced == null || CMUtil.isSSI(ced) || (!CMUtil.isHTML(ced)))
- return;
-
- switch (contentType) {
- case CMElementDeclaration.ANY :
- // Keep going.
- return;
- case CMElementDeclaration.ELEMENT :
- case CMElementDeclaration.MIXED :
- if (ced == null)
- return;
- if (CMUtil.isValidChild(edec, ced))
- return;
- // Now, it is the time to check inclusion, unless the
- // target
- // document is not a XHTML.
- if (!CMUtil.isXHTML(edec)) {
- // pure HTML
- if (CMUtil.isValidInclusion(ced, target))
- return;
- }
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- default :
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- }
- // Mark the whole START tag as an error segment.
- segType = FMUtil.SEG_START_TAG;
- break;
- case Node.TEXT_NODE :
- switch (contentType) {
- case CMElementDeclaration.ANY :
- case CMElementDeclaration.MIXED :
- case CMElementDeclaration.PCDATA :
- case CMElementDeclaration.CDATA :
- // D184339
- // Keep going.
- return;
- case CMElementDeclaration.ELEMENT :
- case CMElementDeclaration.EMPTY :
- if (((IDOMText) child).isElementContentWhitespace())
- return;
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- default :
- error = ErrorState.INVALID_CONTENT_ERROR;
- break;
- }
- // Mark the whole node as an error segment.
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- case Node.COMMENT_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- if (contentType != CMElementDeclaration.EMPTY)
- return;
- error = ErrorState.INVALID_CONTENT_ERROR;
- // Mark the whole node as an error segment.
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- default :
- error = ErrorState.INVALID_CONTENT_ERROR;
- // Mark the whole node as an error segment.
- segType = FMUtil.SEG_WHOLE_TAG;
- break;
- }
- if (error != ErrorState.NONE_ERROR) {
- Segment errorSeg = FMUtil.getSegment((IDOMNode) child, segType);
- if (errorSeg != null)
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(error, errorSeg, child)));
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java
deleted file mode 100644
index f9a93924d2..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleDocumentValidator.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class HTMLSimpleDocumentValidator extends CompositeValidator {
-
- /**
- * HTMLSimpleDocumentValidator constructor comment.
- */
- public HTMLSimpleDocumentValidator() {
- super();
-
- ValidationComponent[] validators = new ValidationComponent[2];
-
- validators[0] = new HTMLDocumentContentValidator();
- validators[1] = new SyntaxValidator();
-
- register(validators);
- }
-
- /**
- * 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 == HTMLSimpleDocumentValidator.class) || super.isAdapterForType(type));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.java
deleted file mode 100644
index ff2a5e188f..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLSimpleValidator.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.core.internal.validate;
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-class HTMLSimpleValidator extends CompositeValidator {
-
- /**
- * HTMLSimpleValidator constructor comment.
- */
- public HTMLSimpleValidator() {
- super();
-
- ValidationComponent[] validators = new ValidationComponent[5];
-
- validators[0] = new HTMLAttributeValidator();
- validators[1] = new HTMLElementContentValidator();
- validators[2] = new SyntaxValidator();
- validators[3] = new HTMLElementAncestorValidator();
- validators[4] = new NamespaceValidator();
-
- register(validators);
- }
-
- /**
- * 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 == HTMLSimpleValidator.class) || super.isAdapterForType(type));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.java
deleted file mode 100644
index 7b5088677c..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLValidationAdapterFactory.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.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.w3c.dom.Node;
-
-public class HTMLValidationAdapterFactory extends AbstractAdapterFactory {
-
- private static HTMLValidationAdapterFactory instance = null;
-
- /**
- * HTMLValidationAdapterFactory constructor comment.
- */
- public HTMLValidationAdapterFactory() {
- super(ValidationAdapter.class, true);
- }
-
- /**
- * HTMLValidationAdapterFactory constructor comment.
- * @param adapterKey java.lang.Object
- * @param registerAdapters boolean
- */
- public HTMLValidationAdapterFactory(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- /**
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- Node node = (Node) target;
- switch (node.getNodeType()) {
- case Node.DOCUMENT_NODE :
- return new DocumentPropagatingValidator();
- case Node.ELEMENT_NODE :
- return new ElementPropagatingValidator();
- default :
- return new NullValidator();
- }
- }
-
- /**
- */
- public synchronized static HTMLValidationAdapterFactory getInstance() {
- if (instance != null)
- return instance;
- instance = new HTMLValidationAdapterFactory();
- return instance;
- }
-
- /**
- * Overriding Object's clone() method
- * This is used in IModelManager's IStructuredModel copying.
- */
- public INodeAdapterFactory copy() {
- return getInstance();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
deleted file mode 100644
index 2b887b61cd..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/MessageFactory.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.HTMLCoreMessages;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.Logger;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.w3c.dom.Node;
-
-class MessageFactory implements ErrorState {
-
-
- private static class ErrorTable {
- private class Packet {
- public Packet(String msg, int severity) {
- this.msg = msg;
- this.severity = severity;
- }
-
- public Packet(String msg, int severity, String preferenceName) {
- this.msg = msg;
- this.severity = severity;
- this.preferenceName = preferenceName;
- }
-
- public String getMessage() {
- return msg;
- }
-
- public int getSeverity() {
- return severity;
- }
-
- public String getPreferenceName() {
- return preferenceName;
- }
-
- private String msg = null;
- private int severity = -1;
- private String preferenceName = null;
- }
-
- public ErrorTable() {
- }
-
- public void put(int state, String msg, int severity) {
- Packet packet = new Packet(msg, severity);
- map.put(new Integer(state), packet);
- }
-
- public void put(int state, String msg, int severity, String preferenceName) {
- Packet packet = new Packet(msg, severity, preferenceName);
- map.put(new Integer(state), packet);
- }
-
- public String getMessage(int state) {
- return getPacket(state).getMessage();
- }
-
- public int getSeverity(int state) {
- Packet packet = getPacket(state);
- if(packet.getPreferenceName() != null)
- return Platform.getPreferencesService().getInt(getPreferenceNodeQualifier(), packet.getPreferenceName(), packet.getSeverity(), scopeContexts);
- return packet.getSeverity();
- }
-
- private Packet getPacket(int state) {
- return (Packet) map.get(new Integer(state));
- }
-
- private Hashtable map = new Hashtable();
- }
-
- private static interface NodeType {
- static final int ATTRIBUTE = 0;
- static final int ELEMENT = 1;
- static final int DOCUMENT_TYPE = 2;
- static final int TEXT = 3;
- static final int COMMENT = 4;
- static final int CDATA_SECTION = 5;
- static final int PROCESSING_INSTRUCTION = 6;
- static final int ENTITY_REFERENCE = 7;
-
- static final int MAX_TYPE = 8;
- }
-
- // error messages
- private static final String MSG_NO_ERROR = HTMLCoreMessages.No_error__UI_;
- private static final String MSG_UNDEFINED_ATTR_ERROR = HTMLCoreMessages.Undefined_attribute_name___ERROR_;
- private static final String MSG_UNDEFINED_VALUE_ERROR = HTMLCoreMessages.Undefined_attribute_value__ERROR_;
- private static final String MSG_DUPLICATE_ATTR_ERROR = HTMLCoreMessages.Multiple_values_specified__ERROR_;
- private static final String MSG_MISMATCHED_ATTR_ERROR = HTMLCoreMessages.Attribute_name___0___uses__ERROR_;
- private static final String MSG_INVALID_ATTR_ERROR = HTMLCoreMessages.Invalid_attribute_name___0_ERROR_;
- private static final String MSG_ATTR_NO_VALUE_ERROR = HTMLCoreMessages.Invalid_attribute___0____ERROR_;
- private static final String MSG_INVALID_CONTENT_ERROR = HTMLCoreMessages.Invalid_location_of_tag____ERROR_;
- private static final String MSG_DUPLICATE_TAG_ERROR = HTMLCoreMessages.Duplicate_tag___0____ERROR_;
- private static final String MSG_MISSING_START_TAG_ERROR = HTMLCoreMessages.No_start_tag____0_____ERROR_;
- private static final String MSG_MISSING_END_TAG_ERROR = HTMLCoreMessages.No_end_tag_____0_____ERROR_;
- private static final String MSG_UNNECESSARY_END_TAG_ERROR = HTMLCoreMessages.End_tag_____0____not_neede_ERROR_;
- private static final String MSG_UNDEFINED_TAG_ERROR = HTMLCoreMessages.Unknown_tag___0____ERROR_;
- private static final String MSG_MISMATCHED_TAG_ERROR = HTMLCoreMessages.Tag_name___0___uses_wrong__ERROR_;
- private static final String MSG_INVALID_TAG_ERROR = HTMLCoreMessages.Invalid_tag_name___0____ERROR_;
- private static final String MSG_INVALID_DIRECTIVE_ERROR = HTMLCoreMessages.Invalid_JSP_directive___0__ERROR_;
- private static final String MSG_INVALID_TEXT_ERROR = HTMLCoreMessages.Invalid_text_string___0____ERROR_;
- private static final String MSG_INVALID_CHAR_ERROR = HTMLCoreMessages.Invalid_character_used_in__ERROR_;
- private static final String MSG_UNKNOWN_ERROR = HTMLCoreMessages.Unknown_error__ERROR_;
- private static final String MSG_UNCLOSED_START_TAG_ERROR = HTMLCoreMessages.Start_tag____0____not_clos_ERROR_;
- private static final String MSG_UNCLOSED_END_TAG_ERROR = HTMLCoreMessages.End_tag_____0____not_close_ERROR_;
- private static final String MSG_MISMATCHED_ATTR_VALUE_ERROR = HTMLCoreMessages.Attribute_value___0___uses_ERROR_;
- private static final String MSG_UNCLOSED_COMMENT_ERROR = HTMLCoreMessages.Comment_not_closed__ERROR_;
- private static final String MSG_UNCLOSED_DOCTYPE_ERROR = HTMLCoreMessages.DOCTYPE_declaration_not_cl_ERROR_;
- private static final String MSG_UNCLOSED_PI_ERROR = HTMLCoreMessages.Processing_instruction_not_ERROR_;
- private static final String MSG_UNCLOSED_CDATA_SECTION_ERROR = HTMLCoreMessages.CDATA_section_not_closed__ERROR_;
- private static final String MSG_INVALID_EMPTY_ELEMENT_TAG = HTMLCoreMessages._ERROR_Tag___0___should_be_an_empty_element_tag_1;
- private static final String MSG_UNCLOSED_ATTR_VALUE_ERROR = HTMLCoreMessages._ERROR_Attribute_value___0___not_closed__1;
- private static ErrorTable[] errTables = new ErrorTable[NodeType.MAX_TYPE];
-
- private static IScopeContext[] scopeContexts = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
- static {
- for (int i = 0; i < NodeType.MAX_TYPE; i++) {
- errTables[i] = new ErrorTable();
- }
- // NOTE: The severities are just stub. They must be reviewed.
- // -- 8/30/2001
-
- // attribute error map
- ErrorTable attrTable = errTables[NodeType.ATTRIBUTE];// short hand
- attrTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- attrTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_ATTR_ERROR, ValidationMessage.WARNING);
- attrTable.put(UNDEFINED_VALUE_ERROR, MSG_UNDEFINED_VALUE_ERROR, ValidationMessage.WARNING);
- attrTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_ATTR_ERROR, ValidationMessage.WARNING);
- attrTable.put(INVALID_NAME_ERROR, MSG_INVALID_ATTR_ERROR, ValidationMessage.WARNING);
- attrTable.put(INVALID_ATTR_ERROR, MSG_ATTR_NO_VALUE_ERROR, ValidationMessage.WARNING);
- attrTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_ATTR_ERROR, ValidationMessage.WARNING);
- attrTable.put(MISMATCHED_VALUE_ERROR, MSG_MISMATCHED_ATTR_VALUE_ERROR, ValidationMessage.ERROR);
- //<<D210422
- attrTable.put(UNCLOSED_ATTR_VALUE, MSG_UNCLOSED_ATTR_VALUE_ERROR, ValidationMessage.WARNING);
- //D210422
- // element error map
- ErrorTable elemTable = errTables[NodeType.ELEMENT];// short hand
- elemTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- elemTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
- elemTable.put(INVALID_NAME_ERROR, MSG_INVALID_TAG_ERROR, ValidationMessage.ERROR);
- elemTable.put(MISMATCHED_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.WARNING);
- elemTable.put(MISMATCHED_END_TAG_ERROR, MSG_MISMATCHED_TAG_ERROR, ValidationMessage.ERROR);
- elemTable.put(MISSING_START_TAG_ERROR, MSG_MISSING_START_TAG_ERROR, ValidationMessage.ERROR, HTMLCorePreferenceNames.ELEM_MISSING_START);
- elemTable.put(MISSING_END_TAG_ERROR, MSG_MISSING_END_TAG_ERROR, ValidationMessage.WARNING, HTMLCorePreferenceNames.ELEM_MISSING_END);
- elemTable.put(UNNECESSARY_END_TAG_ERROR, MSG_UNNECESSARY_END_TAG_ERROR, ValidationMessage.WARNING);
- elemTable.put(INVALID_DIRECTIVE_ERROR, MSG_INVALID_DIRECTIVE_ERROR, ValidationMessage.ERROR);
- elemTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- elemTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.WARNING);
- elemTable.put(COEXISTENCE_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- elemTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_START_TAG_ERROR, ValidationMessage.ERROR);
- elemTable.put(UNCLOSED_END_TAG_ERROR, MSG_UNCLOSED_END_TAG_ERROR, ValidationMessage.ERROR);
- elemTable.put(INVALID_EMPTY_ELEMENT_TAG, MSG_INVALID_EMPTY_ELEMENT_TAG, ValidationMessage.WARNING);
-
- // document type error map
- ErrorTable docTable = errTables[NodeType.DOCUMENT_TYPE];// short hand
- docTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- docTable.put(DUPLICATE_ERROR, MSG_DUPLICATE_TAG_ERROR, ValidationMessage.ERROR);
- docTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- docTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_DOCTYPE_ERROR, ValidationMessage.ERROR);
-
- // text error map
- ErrorTable textTable = errTables[NodeType.TEXT];
- textTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- textTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_TEXT_ERROR, ValidationMessage.WARNING);
- textTable.put(INVALID_CHAR_ERROR, MSG_INVALID_CHAR_ERROR, ValidationMessage.WARNING);
-
- // comment error map
- ErrorTable commTable = errTables[NodeType.COMMENT];
- commTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- commTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- commTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_COMMENT_ERROR, ValidationMessage.ERROR);
-
- // cdata section error map
- ErrorTable cdatTable = errTables[NodeType.CDATA_SECTION];
- cdatTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- cdatTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- cdatTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_CDATA_SECTION_ERROR, ValidationMessage.ERROR);
-
- // processing instruction error map
- ErrorTable piTable = errTables[NodeType.PROCESSING_INSTRUCTION];
- piTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- piTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- piTable.put(UNCLOSED_TAG_ERROR, MSG_UNCLOSED_PI_ERROR, ValidationMessage.ERROR);
-
- // entity reference error map
- ErrorTable erTable = errTables[NodeType.ENTITY_REFERENCE];
- erTable.put(NONE_ERROR, MSG_NO_ERROR, 0);
- erTable.put(UNDEFINED_NAME_ERROR, MSG_UNDEFINED_TAG_ERROR, ValidationMessage.WARNING);
- erTable.put(INVALID_CONTENT_ERROR, MSG_INVALID_CONTENT_ERROR, ValidationMessage.WARNING);
- }
-
- /**
- */
- public static ValidationMessage createMessage(ErrorInfo info) {
- String errorMsg = getErrorMessage(info);
- int errorSeverity = getErrorSeverity(info);
- return new ValidationMessage(errorMsg, info.getOffset(), info.getLength(), errorSeverity);
- }
-
- private static String getErrorMessage(ErrorInfo info) {
- ErrorTable tab = getErrorTable(info.getTargetType());
- if (tab == null)
- return MSG_UNKNOWN_ERROR;
-
- String template = tab.getMessage(info.getState());
- Object[] arguments = {info.getHint()};
- String s = null;
- try {
- s = NLS.bind(template, arguments);
- }
- catch (IllegalArgumentException e) {
- Logger.logException(e);
- s = template + ":" + arguments.toString(); //$NON-NLS-1$
- }
- return s;
- }
-
- /**
- */
- private static int getErrorSeverity(ErrorInfo info) {
- ErrorTable tab = getErrorTable(info.getTargetType());
- if (tab == null)
- return 0;
- return tab.getSeverity(info.getState());
- }
-
- private static ErrorTable getErrorTable(short nodetype) {
- ErrorTable tab = null;
- switch (nodetype) {
- case Node.ATTRIBUTE_NODE :
- tab = errTables[NodeType.ATTRIBUTE];
- break;
- case Node.ELEMENT_NODE :
- tab = errTables[NodeType.ELEMENT];
- break;
- case Node.DOCUMENT_TYPE_NODE :
- tab = errTables[NodeType.DOCUMENT_TYPE];
- break;
- case Node.TEXT_NODE :
- tab = errTables[NodeType.TEXT];
- break;
- case Node.COMMENT_NODE :
- tab = errTables[NodeType.COMMENT];
- break;
- case Node.CDATA_SECTION_NODE :
- tab = errTables[NodeType.CDATA_SECTION];
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- tab = errTables[NodeType.PROCESSING_INSTRUCTION];
- break;
- case Node.ENTITY_REFERENCE_NODE :
- tab = errTables[NodeType.ENTITY_REFERENCE];
- break;
- default :
- return null;
- }
- return tab;
- }
-
- private static String getPreferenceNodeQualifier() {
- return HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
deleted file mode 100644
index 3549971dd0..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NamespaceValidator.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class NamespaceValidator extends PrimeValidator implements ErrorState {
-
- private final static String XMLNS_PREFIX = "xmlns";//$NON-NLS-1$
- private final static String NS_SEPARATOR = ":";//$NON-NLS-1$
-
- public NamespaceValidator() {
- super();
- }
-
- public boolean isAdapterForType(Object type) {
- return ((type == NamespaceValidator.class) || super.isAdapterForType(type));
- }
-
- public void validate(IndexedRegion node) {
- Element target = (Element) node;
- if (isXMLElement(target) && hasUnknownPrefix(target)) {
- IDOMElement e = (IDOMElement) target;
- if (!isValidPrefix(e.getPrefix(), target) && !e.isCommentTag()) {
- // report unknown tag error.
- Segment errorSeg = null;
- if(e.hasStartTag())
- errorSeg = FMUtil.getSegment(e, FMUtil.SEG_START_TAG);
- else if (e.hasEndTag())
- errorSeg = FMUtil.getSegment(e, FMUtil.SEG_END_TAG);
-
- if (errorSeg != null)
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, errorSeg, e)));
- }
- }
- // (2) check prefix of each attr
- NamedNodeMap attrs = target.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node n = attrs.item(i);
- if (!(n instanceof IDOMAttr))
- continue;
- IDOMAttr a = (IDOMAttr) n;
- String prefix = a.getPrefix();
- if ((prefix != null) && isUnknownAttr(a, target)) {
- // The attr has unknown prefix. So, check it.
- if (!isValidPrefix(prefix, target)) {
- // report unknown attr error.
- ITextRegion r = a.getNameRegion();
- if (r == null)
- continue;
- int a_offset = a.getNameRegionStartOffset();
- int a_length = a.getNameRegion().getLength();
- reporter.report(MessageFactory.createMessage(new ErrorInfoImpl(UNDEFINED_NAME_ERROR, new Segment(a_offset, a_length), a)));
- }
- }
- }
- }
-
- // private methods
- private boolean isXMLElement(Element target) {
- return target instanceof IDOMElement;
- }
-
- private boolean hasUnknownPrefix(Element target) {
- return isUnknownElement(target) && CMUtil.isForeign(target);
- }
-
- private boolean isUnknownElement(Element target) {
- CMElementDeclaration dec = CMUtil.getDeclaration(target);
- return dec == null;
- }
-
- private boolean isUnknownAttr(IDOMAttr attr, Element target) {
- CMElementDeclaration dec = CMUtil.getDeclaration(target);
- if (dec == null)
- return true; // unknown.
- CMNamedNodeMap adecls = dec.getAttributes();
- CMAttributeDeclaration adec = (CMAttributeDeclaration) adecls.getNamedItem(attr.getName());
- return adec == null;
- }
-
- private boolean isValidPrefix(String prefix, Element e) {
- if (prefix.equals(XMLNS_PREFIX))
- return true; // "xmlns:foo" attr is always valid.
-
- // (1) check the element has the namespace definition or not.
- if (isValidPrefixWithinElement(prefix, e))
- return true;
-
- // (2) check ancestors of the element have the namespace definition or not.
- Element parent = SMUtil.getParentElement(e);
- while (parent != null) {
- if (isValidPrefixWithinElement(prefix, parent))
- return true;
- parent = SMUtil.getParentElement(parent);
- }
- return false;
- }
-
- private boolean isValidPrefixWithinElement(String prefix, Element e) {
- String ns = XMLNS_PREFIX + NS_SEPARATOR + prefix;
- NamedNodeMap attrs = e.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Node n = attrs.item(i);
- if (n == null)
- continue;
- if (n.getNodeType() != Node.ATTRIBUTE_NODE)
- continue;
- if (ns.equals(((Attr) n).getName()))
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.java
deleted file mode 100644
index fb1f93cade..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/NullValidator.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.core.internal.validate;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-/**
- * NullValidator class is intended to be a replacement of null
- * for ValidationComponent type.
- */
-final class NullValidator extends ValidationComponent {
-
- public NullValidator() {
- super();
- }
-
- public void validate(IndexedRegion node) {
- return;
- }
-
- public void setReporter(ValidationReporter reporter) {
- return;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.java
deleted file mode 100644
index b44f258b87..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/PrimeValidator.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.core.internal.validate;
-
-
-
-import org.eclipse.wst.xml.core.internal.validate.ValidationComponent;
-
-abstract class PrimeValidator extends ValidationComponent {
-
- /**
- * PrimeValidator constructor comment.
- */
- public PrimeValidator() {
- super();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.java
deleted file mode 100644
index 6bf6fede41..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SMUtil.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.wst.html.core.internal.validate;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-final class SMUtil {
-
- private SMUtil() {
- super();
- }
-
- /* get an ancestor element ignoring implicit ones. */
- public static Element getParentElement(Node child) {
- if (child == null)
- return null;
-
- Node p = child.getParentNode();
- while (p != null) {
- if (p.getNodeType() == Node.ELEMENT_NODE) {
- return (Element) p;
- }
- p = p.getParentNode();
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.java
deleted file mode 100644
index b9fd37ea83..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/Segment.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
- *******************************************************************************/
-package org.eclipse.wst.html.core.internal.validate;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-public class Segment {
-
- private int offset = 0;
- private int length = 0;
-
- /**
- */
- public Segment(int offset, int length) {
- super();
- this.offset = offset;
- this.length = length;
- }
-
- public Segment(IStructuredDocumentRegion region) {
- super();
- this.offset = region.getStartOffset();
- this.length = region.getLength();
- }
-
- /**
- * NOTE: 'start' and 'end' must be the start and end of the contiguous regions.
- * Otherwise, this class cannot work correctly.
- */
- public Segment(IStructuredDocumentRegion start, IStructuredDocumentRegion end) {
- super();
- this.offset = start.getStartOffset();
- int endOffset = (end == null) ? start.getEndOffset() : end.getEndOffset();
- this.length = endOffset - this.offset;
- }
-
- //public Segment(ITextRegion start, ITextRegion end) {
- // super();
- // this.offset = start.getStartOffset();
- // int endOffset = (end == null) ? start.getEndOffset() : end.getEndOffset();
- // this.length = endOffset - this.offset;
- //}
- /**
- */
- public int getLength() {
- return this.length;
- }
-
- /**
- */
- public int getOffset() {
- return this.offset;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
deleted file mode 100644
index 57c749f3f5..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/SyntaxValidator.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.core.internal.validate;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.document.SourceValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-class SyntaxValidator extends PrimeValidator implements ErrorState {
-
-
- static private boolean isValidRegion(ITextRegion rgn) {
- String type = rgn.getType();
- if (type == null)
- return false; // no type is invalid.
- if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_TAG_NAME || type == DOMRegionContext.XML_TAG_CLOSE) {
- return true;
- }
- return false;
- }
-
- static private String getTagName(IStructuredDocumentRegion tag) {
- ITextRegionList regions = tag.getRegions();
- Iterator iter = regions.iterator();
- while (iter.hasNext()) {
- ITextRegion rgn = (ITextRegion) iter.next();
- if (rgn.getType() == DOMRegionContext.XML_TAG_NAME)
- return tag.getText(rgn);
- }
- return "";//$NON-NLS-1$
- }
-
- static private boolean isEmptyContent(CMElementDeclaration decl) {
- return (decl != null) && (decl.getContentType() == CMElementDeclaration.EMPTY);
- }
-
- public SyntaxValidator() {
- super();
- }
-
- public boolean isAdapterForType(Object type) {
- return ((type == SyntaxValidator.class) || super.isAdapterForType(type));
- }
-
- class ElementInfo {
- public ElementInfo() {
- super();
- }
-
- public IDOMElement target = null;
- public CMElementDeclaration decl = null;
- public IStructuredDocumentRegion startTag = null;
- public IStructuredDocumentRegion endTag = null;
- public boolean hasStartTag = false;
- public boolean hasEndTag = false;
- public boolean isXHTML = false;
- }
-
- public void validate(IndexedRegion indexedNode) {
- Node node = (Node) indexedNode;
- validateChildren(node);
-
- if (node.getNodeType() != Node.ELEMENT_NODE)
- return;
- if (!(node instanceof IDOMElement))
- return;
-
- ElementInfo info = new ElementInfo();
- info.target = (IDOMElement) node;
-
- // gather information to validate from target at once.
- getInfo(info);
-
- validateTags(info);
- if (info.target.isGlobalTag()) {
- validateNames(info);
- if (info.decl != null && info.isXHTML) {
- validateTagCase(info);
- }
- }
- }
-
- private void getInfo(ElementInfo info) {
- info.decl = CMUtil.getDeclaration(info.target);
- info.startTag = info.target.getStartStructuredDocumentRegion();
- info.endTag = info.target.getEndStructuredDocumentRegion();
-
- info.hasStartTag = (info.startTag != null);
- info.hasEndTag = (info.endTag != null);
-
- Document doc = info.target.getOwnerDocument();
- if (!(doc instanceof IDOMDocument))
- return;
- String typeid = ((IDOMDocument) doc).getDocumentTypeId();
- if (typeid != null) {
- HTMLDocumentTypeEntry entry = HTMLDocumentTypeRegistry.getInstance().getEntry(typeid);
- info.isXHTML = (entry != null && entry.isXMLType());
- }
- }
-
- class TagErrorInfoImpl extends AbstractErrorInfo {
- private String hint = null;
-
- public TagErrorInfoImpl(int state, IStructuredDocumentRegion tag, String hint) {
- super(state, new Segment(tag));
- this.hint = hint;
- }
-
- public String getHint() {
- return hint;
- }
-
- public short getTargetType() {
- return Node.ELEMENT_NODE;
- }
- }
-
- private boolean isEndTagCorrupted(ElementInfo info) {
- ITextRegionList regions = info.endTag.getRegions();
- if (regions == null || regions.isEmpty())
- return false;
- Iterator iter = regions.iterator();
- while (iter.hasNext()) {
- ITextRegion rgn = (ITextRegion) iter.next();
- if (!isValidRegion(rgn))
- return true; // found invalid region type.
- }
- return false; // all regions are valid.
- }
-
- private String getEndTagFullText(ElementInfo info) {
- String hint = "";//$NON-NLS-1$
- ITextRegionList regions = info.endTag.getRegions();
- Iterator iter = regions.iterator();
- while (iter.hasNext()) {
- ITextRegion rgn = (ITextRegion) iter.next();
- String type = rgn.getType();
- if (type == null)
- continue;
- if (type == DOMRegionContext.XML_END_TAG_OPEN || type == DOMRegionContext.XML_TAG_CLOSE)
- continue;
- hint += info.endTag.getFullText(rgn);
- }
- return hint;
- }
-
- private void reportCorruptedEndTagError(ElementInfo info) {
- String hint = getEndTagFullText(info);
- TagErrorInfoImpl error = new TagErrorInfoImpl(UNDEFINED_NAME_ERROR, info.endTag, hint);
- this.reporter.report(MessageFactory.createMessage(error));
- }
-
- private void validateTags(ElementInfo info) {
- if (info.hasStartTag) {
- if (!info.target.isStartTagClosed()) {
- // Mark the whole START tag as an error segment.
- Segment errorSeg = new Segment(info.startTag);
- report(UNCLOSED_TAG_ERROR, errorSeg, info.target);
- }
- }
- else {
- if (info.hasEndTag) {
- if (info.decl != null) {
- if (CMUtil.isHTML(info.decl) && !info.target.hasChildNodes()) {
- if (info.target.isContainer()) {
- // Set the error mark to the start of the element.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG);
- report(MISSING_START_TAG_ERROR, errorSeg, info.target);
- }
- else {
- // Mark the whole END tag as an error segment.
- Segment errorSeg = new Segment(info.endTag);
- report(UNNECESSARY_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- else if (info.isXHTML) {
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_END_TAG);
- report(MISSING_START_TAG_ERROR, errorSeg, info.target);
- }
- }
- }
- }
-
- if (info.hasEndTag) {
- if (!info.target.isClosed()) {
- // Set the whole END tag as error segment.
- Segment errorSeg = new Segment(info.endTag);
- report(UNCLOSED_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- else {
- if (info.isXHTML) { // XHTML
- if (!info.target.isEmptyTag()) {
- if (isEmptyContent(info.decl)) {
- // EMPTY element should be written in <.../> form.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(INVALID_EMPTY_ELEMENT_TAG, errorSeg, info.target);
- }
- else {
- // end tag is required.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(MISSING_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- }
- else { // HTML
- if (info.hasStartTag) {
- if (info.decl != null && CMUtil.isHTML(info.decl) && !info.target.isEmptyTag() && !CMUtil.isEndTagOmissible(info.decl)) {
- // Set the error mark to the end of the element.
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(MISSING_END_TAG_ERROR, errorSeg, info.target);
- }
- }
- }
- }
- }
-
- /* perform validation about tag name definition. */
- private void validateNames(ElementInfo info) {
- boolean corrupted = info.hasEndTag && isEndTagCorrupted(info);
- if (info.decl == null) {
- // If no declaration is retrieved, the target is really
- // unknown element.
- if (!info.hasStartTag && corrupted) {
- reportCorruptedEndTagError(info);
- }
- else {
- Segment errorSeg = FMUtil.getSegment(info.target, FMUtil.SEG_START_TAG);
- report(UNDEFINED_NAME_ERROR, errorSeg, info.target);
- }
- }
- else {
- // Even if a declaration could be retrieved, if the end
- // tag is corrupted, it should be reported as undefined
- // name. (D202493)
- if (corrupted) {
- reportCorruptedEndTagError(info);
- }
- }
- }
-
- /* perform validation tag case only for XHTML document */
- private void validateTagCase(ElementInfo info) {
- String declared = info.decl.getElementName();
- String startTagName = "";//$NON-NLS-1$
- String endTagName = "";//$NON-NLS-1$
- if (declared == null)
- return;
-
- // start tag
- if (info.hasStartTag) {
- startTagName = getTagName(info.startTag);
- if (!declared.equals(startTagName)) {
- TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.startTag, startTagName);
- this.reporter.report(MessageFactory.createMessage(error));
- }
- }
- // end tag
- if (info.hasEndTag) {
- endTagName = getTagName(info.endTag);
- if (!info.hasStartTag || (!endTagName.equals(startTagName))) {
- if (!declared.equals(endTagName)) {
- TagErrorInfoImpl error = new TagErrorInfoImpl(MISMATCHED_ERROR, info.endTag, endTagName);
- this.reporter.report(MessageFactory.createMessage(error));
- }
- }
- }
- }
-
- private void validateChildren(Node target) {
- if ((target.getNodeType() == Node.ELEMENT_NODE) && CMUtil.isForeign((Element) target))
- return;
-
- for (Node child = target.getFirstChild(); child != null; child = child.getNextSibling()) {
- switch (child.getNodeType()) {
- case Node.TEXT_NODE :
- {
- IDOMNode text = (IDOMNode) child;
- int charOffset = validateTextSource(text);
- if (charOffset >= 0) {
- charOffset += text.getStartOffset();
- Segment errorSeg = new Segment(charOffset, 1);
- if (errorSeg != null)
- report(INVALID_CHAR_ERROR, errorSeg, text);
- }
- break;
- }
- case Node.COMMENT_NODE :
- case Node.DOCUMENT_TYPE_NODE :
- case Node.PROCESSING_INSTRUCTION_NODE :
- case Node.CDATA_SECTION_NODE :
- {
- IDOMNode tag = (IDOMNode) child;
- if (!tag.isClosed()) {
- Segment errorSeg = FMUtil.getSegment(tag, FMUtil.SEG_WHOLE_TAG);
- if (errorSeg != null)
- report(UNCLOSED_TAG_ERROR, errorSeg, tag);
- }
- break;
- }
- default :
- break;
- }
- }
- }
-
- private int validateTextSource(IDOMNode text) {
- try {
- SourceValidator validator = new SourceValidator(text);
- validator.validateSource(text.getSource());
- }
- catch (InvalidCharacterException ex) {
- return ex.getOffset();
- }
- return -1;
- }
-
- private void report(int state, Segment errorSeg, Node node) {
- ErrorInfo info = new ErrorInfoImpl(state, errorSeg, node);
- reporter.report(MessageFactory.createMessage(info));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
deleted file mode 100644
index 661904a09d..0000000000
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.wst.html.core.text;
-
-
-/**
- * This interface is not intended to be implemented. It defines the partition
- * types for HTML. Clients should reference the partition type Strings defined
- * here directly.
- *
- * @since 1.1
- */
-public interface IHTMLPartitions {
-
- String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
- String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$
- String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$
-
- String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$
- String STYLE = "org.eclipse.wst.html.STYLE"; //$NON-NLS-1$
-
- // ISSUE: I think meta tag areas are here too?
-}
diff --git a/bundles/org.eclipse.wst.html.ui/.classpath b/bundles/org.eclipse.wst.html.ui/.classpath
deleted file mode 100644
index d7ce462fd1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-html-validation"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.html.ui/.cvsignore b/bundles/org.eclipse.wst.html.ui/.cvsignore
deleted file mode 100644
index e4239f5540..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-bin
-htmleditor.jar
-temp.folder
-build.xml
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.html.ui/.options b/bundles/org.eclipse.wst.html.ui/.options
deleted file mode 100644
index 6d015ff08a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.options
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.html.ui/projectionperf=false
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/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 2dd8b5cef1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 14:37:21 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index f724958463..0000000000
--- a/bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index a76dff0618..0000000000
--- a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,53 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.html.ui; singleton:=true
-Bundle-Version: 1.0.103.qualifier
-Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.html.internal.validation;x-internal:=true,
- org.eclipse.wst.html.ui,
- org.eclipse.wst.html.ui.internal;x-internal:=true,
- org.eclipse.wst.html.ui.internal.autoedit;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentassist;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentoutline;x-internal:=true,
- org.eclipse.wst.html.ui.internal.contentproperties.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.correction;x-internal:=true,
- org.eclipse.wst.html.ui.internal.derived;x-internal:=true,
- org.eclipse.wst.html.ui.internal.edit.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.editor;x-internal:=true,
- org.eclipse.wst.html.ui.internal.hyperlink;x-internal:=true,
- org.eclipse.wst.html.ui.internal.preferences;x-internal:=true,
- org.eclipse.wst.html.ui.internal.preferences.ui;x-internal:=true,
- org.eclipse.wst.html.ui.internal.projection;x-internal:=true,
- org.eclipse.wst.html.ui.internal.registry;x-internal:=true,
- org.eclipse.wst.html.ui.internal.search;x-internal:=true,
- org.eclipse.wst.html.ui.internal.style;x-internal:=true,
- org.eclipse.wst.html.ui.internal.taginfo;x-internal:=true,
- org.eclipse.wst.html.ui.internal.templates;x-internal:=true,
- org.eclipse.wst.html.ui.internal.text;x-internal:=true,
- org.eclipse.wst.html.ui.internal.wizard;x-internal:=true,
- org.eclipse.wst.html.ui.views.contentoutline
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.editors;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.0.101,1.1.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.javascript.ui;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.0,1.2.0)",
- com.ibm.icu;bundle-version="[3.4.4,3.5.0)",
- org.eclipse.wst.validation.ui;bundle-version="[1.1.0,1.2.0)"
-Eclipse-LazyStart: true
diff --git a/bundles/org.eclipse.wst.html.ui/about.html b/bundles/org.eclipse.wst.html.ui/about.html
deleted file mode 100644
index 4ec5989581..0000000000
--- a/bundles/org.eclipse.wst.html.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 2, 2006</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
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 f486ed68cb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/build.properties
+++ /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
-###############################################################################
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- templates/,\
- META-INF/,\
- .,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-source.. = src/,\
- src-html-validation/
-src.includes = build.properties
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
deleted file mode 100644
index 8175aa93fb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/dtool16/newhtml_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
deleted file mode 100644
index 976e18d7cd..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/etool16/newhtml_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/sourceEditor.gif
+++ /dev/null
Binary files differ
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-generic.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.gif
deleted file mode 100644
index 65f516e80a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-generic.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-template.gif b/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.gif
deleted file mode 100644
index 5d1f81b6d4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/obj16/tag-template.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/full/wizban/newhfile_wiz.gif b/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.gif
deleted file mode 100644
index 603e1ed7c9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/icons/full/wizban/newhfile_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.html.ui/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.html.ui/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 5263e36a2c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 17:23:39 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=ignore
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
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 7a0eb444a3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.properties
+++ /dev/null
@@ -1,54 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-providerName=Eclipse.org
-pluginName=HTML UI Source Editor
-HTML_Source_Page_Editor.name=HTML Editor
-HTML_Files.name=HTML Files
-HTML_Source.name=HTML Source
-HTML_Templates.name=HTML Templates
-HTML_Styles.name=HTML Styles
-HTML_Validation=HTML Validation
-WebContentSettings.name=Web Content Settings
-Device_Profile_Entry_Provider_Extension.name=Device Profile Entry Provider Extension
-All_HTML_context_type_Extension_Element.name=All HTML
-HTML_New_context_type_Extension_Element.name=New HTML
-HTML_Tag_context_type_Extension_Element.name=HTML Tag
-HTML_Attribute_context_type_Extension_Element.name=HTML Attribute
-HTML_Attribute_value_context_type_Extension_Element.name=HTML Attribute value
-HTML_Syntax_Validator.name=HTML Syntax Validator
-###############################################################################
-#org.eclipse.ui.newWizards extension point
-_UI_WIZARD_NAME = HTML
-_UI_WIZARD_CREATE_NEW_FILE = Create a new HTML page
-##
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-SelectRuler.label=Select Ruler
-##
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-ToggleComment_label=Toggle Comment
-ToggleComment_tooltip=Toggle Comment
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-StructureSelectEnclosing_label=Enclosing Element
-StructureSelectEnclosing_tooltip=Expand selection to include enclosing element
-StructureSelectNext_label=Next Element
-StructureSelectNext_tooltip=Expand selection to include next sibling
-StructureSelectPrevious_label=Previous Element
-StructureSelectPrevious_tooltip=Expand selection to include previous sibling
-StructureSelectHistory_label=Restore Last Selection
-StructureSelectHistory_tooltip=Restore last selection
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 5d13f79ee1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/plugin.xml
+++ /dev/null
@@ -1,461 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="deviceProfileEntryProvider" name="%Device_Profile_Entry_Provider_Extension.name" schema="schema/deviceProfileEntryProvider.exsd"/>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%HTML_Source_Page_Editor.name"
- icon="$nl$/icons/full/obj16/sourceEditor.gif"
- contributorClass="org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML"
- class="org.eclipse.wst.sse.ui.StructuredTextEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.html.core.htmlsource.source">
- <contentTypeBinding
- contentTypeId="org.eclipse.wst.html.core.htmlsource" />
- </editor>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML"
- target="org.eclipse.wst.html.core.htmlsource" />
- <contentOutlineConfiguration
- class="org.eclipse.wst.html.ui.views.contentoutline.HTMLContentOutlineConfiguration"
- target="org.eclipse.wst.html.core.htmlsource" />
- <propertySheetConfiguration
- class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="sourceeditingtexttools"
- class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="characterpairmatcher"
- class="org.eclipse.wst.html.ui.internal.text.HTMLDocumentRegionEdgeMatcher"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="structuredtextfoldingprovider"
- class="org.eclipse.wst.html.ui.internal.projection.StructuredTextFoldingProviderHTML"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalConfiguration
- type="correctionassistant"
- class="org.eclipse.wst.html.ui.internal.correction.CorrectionAssistantProviderHTML"
- target="org.eclipse.wst.html.core.htmlsource" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.html.ui.preferences, org.eclipse.wst.html.ui.preferences.source, org.eclipse.wst.html.ui.preferences.templates, org.eclipse.wst.html.ui.preferences.styles, org.eclipse.wst.html.ui.preferences.validation"
- target="org.eclipse.wst.html.core.htmlsource" />
- </extension>
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- contentTypeId="org.eclipse.wst.html.core.htmlsource"
- class="org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModelFactory" />
- </extension>
- <extension
- point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
- <adapterFactoryDescription
- class="org.eclipse.wst.html.ui.internal.registry.AdapterFactoryProviderForHTML">
- <contentType id="org.eclipse.wst.html.core.htmlsource" />
- </adapterFactoryDescription>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <!-- HTML PREFERENCE PAGES-->
- <page
- name="%HTML_Files.name"
- category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
- class="org.eclipse.wst.html.ui.internal.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.internal.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.internal.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.internal.preferences.ui.HTMLColorPage"
- id="org.eclipse.wst.html.ui.preferences.styles">
- </page>
- <page
- name="%HTML_Validation"
- category="org.eclipse.wst.html.ui.preferences"
- class="org.eclipse.wst.html.ui.internal.preferences.ui.HTMLValidationPreferencePage"
- id="org.eclipse.wst.html.ui.preferences.validation">
- </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.internal.contentproperties.ui.ProjectWebContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.dynamicprojectpropertypage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="wst.web" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- </page>
- <page
- objectClass="org.eclipse.core.resources.IFile"
- adaptable="true"
- name="%WebContentSettings.name"
- class="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage"
- id="org.eclipse.wst.html.ui.internal.contentproperties.ui.WebContentSettingsPropertyPage">
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.core.resources.IFile">
- <or>
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.wst.html.core.htmlsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.jspsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.jspfragmentsource" />
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.cssjspfragmentsource" />
- </or>
- </adapt>
- </and>
- </enabledWhen>
- </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.core.htmlsource.source">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <part id="org.eclipse.wst.html.core.htmlsource.source">
- </part>
- </actionSetPartAssociation>
- </extension>
-
- <!-- Templates -->
- <extension point="org.eclipse.ui.editors.templates">
- <contextType
- name="%All_HTML_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_all">
- </contextType>
- <contextType
- name="%HTML_New_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_new">
- </contextType>
- <contextType
- name="%HTML_Tag_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_tag">
- </contextType>
- <contextType
- name="%HTML_Attribute_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_attribute">
- </contextType>
- <contextType
- name="%HTML_Attribute_value_context_type_Extension_Element.name"
- class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
- id="html_attribute_value">
- </contextType>
- <include
- file="templates/htmldefault-templates.xml"
- translations="$nl$/templates/htmldefault-templates.properties">
- </include>
- </extension>
- <!-- initialize html ui preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceInitializer" />
- </extension>
-
- <!--======================================================================================-->
- <!-- Document provider for ExternalFileEditorInput -->
- <!--======================================================================================-->
- <extension point="org.eclipse.ui.editors.documentProviders">
- <provider
- inputTypes="org.eclipse.wst.html.ui.internal.hyperlink.ExternalFileEditorInput"
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- id="org.eclipse.wst.html.ui.internal.ExternalFileDocumentProvider">
- </provider>
- </extension>
-
- <!--======================================================================================-->
- <!-- Workbench validation -->
- <!--======================================================================================-->
- <extension
- id="HTMLValidator"
- name="%HTML_Syntax_Validator.name"
- point="org.eclipse.wst.validation.validator">
- <validator>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.html">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.htm">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xhtml">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.htpl">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.wml">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jsp">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jspf">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jsf">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jsv">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jtpl">
- </filter>
- <helper
- class="org.eclipse.wst.html.internal.validation.HTMLValidationWorkbenchHelper">
- </helper>
-
- <run
- async="true"
- fullBuild="true"
- incremental="true"
- enabled="true"
- class="org.eclipse.wst.html.internal.validation.HTMLValidator">
- </run>
- </validator>
- </extension>
-
- <!--======================================================================================-->
- <!-- As you type validation -->
- <!--======================================================================================-->
-
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.wst.html.internal.validation.HTMLValidator"
- id="org.eclipse.wst.html.ui.internal.validation.htmlsyntaxvalidator">
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- <validator
- scope="total"
- class="org.eclipse.wst.xml.ui.internal.validation.MarkupValidator"
- id="org.eclipse.wst.html.ui.internal.validation.markupvalidator">
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
-
- <!-- New HTML wizard -->
- <extension point="org.eclipse.ui.newWizards">
- <wizard
- id="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
- name="%_UI_WIZARD_NAME"
- class="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard"
- category="org.eclipse.wst.web.ui"
- icon="$nl$/icons/full/etool16/newhtml_wiz.gif">
- <description>%_UI_WIZARD_CREATE_NEW_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <!-- Add new HTML wizard to J2EE Project Navigator -->
- <extension
- id="org.eclipse.wst.html.commonWizard.newHTML"
- point="org.eclipse.ui.navigator.navigatorContent">
- <commonWizard
- menuGroupId="org.eclipse.wst.web.ui"
- type="new"
- wizardId="org.eclipse.wst.html.ui.internal.wizard.NewHTMLWizard">
- <enablement>
- <or>
- <adapt type="org.eclipse.core.resources.IResource">
- <or>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="wst.web"/>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web"/>
- </or>
- </adapt>
- </or>
- </enablement>
- </commonWizard>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.wst.html.core.htmlsource.source.RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- </viewerContribution>
- </extension>
-
- <extension point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.eclipse.wst.html.core.htmlsource.source.editorActions"
- targetID="org.eclipse.wst.html.core.htmlsource.source">
- <action
- id="CleanupDocument"
- label="%CleanupDocument_label"
- definitionId="org.eclipse.wst.sse.ui.cleanup.document"
- tooltip="%CleanupDocument_tooltip"
- class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate"
- actionID="CleanupDocument">
- </action>
- <action
- id="ToggleComment"
- label="%ToggleComment_label"
- definitionId="org.eclipse.wst.sse.ui.toggle.comment"
- tooltip="%ToggleComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate"
- actionID="ToggleComment">
- </action>
- <action
- id="AddBlockComment"
- label="%AddBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.add.block.comment"
- tooltip="%AddBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate"
- actionID="AddBlockComment">
- </action>
- <action
- id="RemoveBlockComment"
- label="%RemoveBlockComment_label"
- definitionId="org.eclipse.wst.sse.ui.remove.block.comment"
- tooltip="%RemoveBlockComment_tooltip"
- class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate"
- actionID="RemoveBlockComment">
- </action>
- <action
- id="FindOccurrences"
- label="%FindOccurrences_label"
- definitionId="org.eclipse.wst.sse.ui.search.find.occurrences"
- class="org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesActionDelegate"
- actionID="FindOccurrences">
- </action>
- <action
- id="StructureSelectEnclosing"
- label="%StructureSelectEnclosing_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- tooltip="%StructureSelectEnclosing_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate"
- actionID="StructureSelectEnclosing">
- </action>
- <action
- id="StructureSelectNext"
- label="%StructureSelectNext_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.next"
- tooltip="%StructureSelectNext_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate"
- actionID="StructureSelectNext">
- </action>
- <action
- id="StructureSelectPrevious"
- label="%StructureSelectPrevious_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.previous"
- tooltip="%StructureSelectPrevious_tooltip"
- class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate"
- actionID="StructureSelectPrevious">
- </action>
- <action
- id="StructureSelectHistory"
- label="%StructureSelectHistory_label"
- definitionId="org.eclipse.wst.sse.ui.structure.select.last"
- tooltip="%StructureSelectHistory_tooltip"
- class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate"
- actionID="StructureSelectHistory">
- </action>
- </editorContribution>
- <editorContribution
- targetID="org.eclipse.wst.html.core.htmlsource.source"
- id="org.eclipse.wst.html.core.htmlsource.ruler.actions">
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction"/>
- <action
- label="%SelectRuler.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction"/>
- </editorContribution>
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd b/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
deleted file mode 100644
index 742f82f5ab..0000000000
--- a/bundles/org.eclipse.wst.html.ui/schema/deviceProfileEntryProvider.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.html.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.html.ui" id="deviceProfileEntryProvider" name="Device Profile Entry Provider Extension"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="deviceProfileEntryProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="deviceProfileEntryProvider">
- <complexType>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is deprecated and should not be used by any other plugins.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java
deleted file mode 100644
index 828c78ad62..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationReporter.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.core.internal.validate.ValidationReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-public class HTMLValidationReporter implements ValidationReporter {
-
- private IValidator owner = null;
- private IReporter reporter = null;
- private IFile file = null;
- private IStructuredModel model = null;
- private HTMLValidationResult result = null;
-
- /**
- */
- public HTMLValidationReporter(IValidator owner, IReporter reporter, IFile file, IStructuredModel model) {
- super();
- this.owner = owner;
- this.reporter = reporter;
- this.file = file;
- this.model = model;
- }
-
- /**
- */
- public void clear() {
- if (this.file == null)
- return;
-
- this.result = null;
-
- if (this.reporter != null) {
- this.reporter.removeAllMessages(this.owner, this.file);
- }
- else {
- // remove by myself?
- String id = HTMLValidator.class.getName();
- try {
- // TaskListHelper API changed
- // TaskListHelper.getTaskList().removeAllTasks(id, this.file,
- // null);
- TaskListHelper.getTaskList().removeAllTasks(this.file, id, null);
- }
- catch (CoreException ex) {
- }
- }
- }
-
-
- /**
- */
- public HTMLValidationResult getResult() {
- if (this.result == null)
- this.result = new HTMLValidationResult();
- return this.result;
- }
-
- /**
- */
- public void report(ValidationMessage message) {
- if (message == null || message.getSeverity() == ValidationMessage.IGNORE)
- return;
- if (this.file == null)
- return;
-
- IMessage mes = translateMessage(message);
-
- if (this.reporter != null) {
- this.reporter.addMessage(this.owner, mes);
- }
- else {
- // add by myself?
- String id = HTMLValidator.class.getName();
- String location = Integer.toString(mes.getLineNumber());
- String name = ""; //$NON-NLS-1$
- IPath filePath = this.file.getFullPath();
- if (filePath != null) {
- name = filePath.toString();
- }
- try {
- TaskListHelper.getTaskList().addTask(id, this.file, location, mes.getId(), mes.getText(), mes.getSeverity(), name, mes.getGroupName(), mes.getOffset(), mes.getLength());
- }
- catch (CoreException ex) {
- }
- }
- }
-
- /**
- * Translate ValidationMessage to IMessage and generate result log
- */
- private IMessage translateMessage(ValidationMessage message) {
- int severity = IMessage.LOW_SEVERITY;
- HTMLValidationResult result = getResult();
- switch (message.getSeverity()) {
- case ValidationMessage.ERROR :
- severity = IMessage.HIGH_SEVERITY;
- result.addError();
- break;
- case ValidationMessage.WARNING :
- severity = IMessage.NORMAL_SEVERITY;
- result.addWarning();
- break;
- case ValidationMessage.INFORMATION:
- result.addInformation();
- break;
- default :
- break;
- }
-
- IMessage mes = new LocalizedMessage(severity, message.getMessage(), this.file);
- mes.setOffset(message.getOffset());
- mes.setLength(message.getLength());
- if (this.model != null) {
- IStructuredDocument flatModel = this.model.getStructuredDocument();
- if (flatModel != null) {
- int line = flatModel.getLineOfOffset(message.getOffset());
- mes.setLineNo(line + 1);
- }
- }
-
- return mes;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.java
deleted file mode 100644
index 90c9f771cf..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationResult.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
- *******************************************************************************/
-package org.eclipse.wst.html.internal.validation;
-
-public class HTMLValidationResult {
- private int errors = 0;
- private int warnings = 0;
- private int informations = 0;
-
- /**
- */
- public HTMLValidationResult() {
- }
-
- /**
- */
- public void addError() {
- this.errors++;
- }
-
- /**
- */
- public void addInformation() {
- this.informations++;
- }
-
- /**
- */
- public void addWarning() {
- this.warnings++;
- }
-
- /**
- */
- public int getErrors() {
- return this.errors;
- }
-
- /**
- */
- public int getInformations() {
- return this.informations;
- }
-
- /**
- */
- public int getWarnings() {
- return this.warnings;
- }
-
- /**
- */
- public boolean isValid() {
- return (this.errors == 0 && this.warnings == 0 && this.informations == 0);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
deleted file mode 100644
index 90bfde5134..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidationWorkbenchHelper.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
-
-public class HTMLValidationWorkbenchHelper extends WorkbenchContext {
- /**
- */
- public HTMLValidationWorkbenchHelper() {
- super();
- }
-
- /**
- * When an IValidator associates a target object with an IMessage, the
- * WorkbenchReporter eventually resolves that target object with an
- * IResource. Sometimes more than one target object resolves to the same
- * IResource (usually the IProject, which is the default IResource when an
- * IFile cannot be found). This method is called, by the
- * WorkbenchReporter, so that the WorkbenchReporter can distinguish
- * between the IMessages which are on the same IResource, but refer to
- * different target objects. This is needed for the
- * removeAllMessages(IValidator, Object) method, so that when one target
- * object removes all of its messages, that it doesn't remove another
- * target object's messages.
- *
- * This method may return null only if object is null. Otherwise, an id
- * which can uniquely identify a particular object must be returned. The
- * id needs to be unique only within one particular IValidator.
- */
- public String getTargetObjectName(Object object) {
- if (object == null)
- return null;
- if (object instanceof IFile)
- return getPortableName((IFile) object);
- return object.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
deleted file mode 100644
index a7963d7871..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/HTMLValidator.java
+++ /dev/null
@@ -1,517 +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.internal.validation;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.resources.IContainer;
-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.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-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.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.sse.core.internal.validate.ValidationAdapter;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Text;
-
-public class HTMLValidator implements IValidatorJob, ISourceValidator {
- private static final String ORG_ECLIPSE_JST_JSP_CORE_JSPSOURCE = "org.eclipse.jst.jsp.core.jspsource"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE = "org.eclipse.wst.html.core.htmlsource"; //$NON-NLS-1$
-
- static boolean shouldValidate(IFile file) {
- IResource resource = file;
- do {
- if (resource.isDerived() || resource.isTeamPrivateMember() || !resource.isAccessible() || (resource.getName().charAt(0) == '.' && resource.getType() == IResource.FOLDER)) {
- return false;
- }
- resource = resource.getParent();
- }
- while ((resource.getType() & IResource.PROJECT) == 0);
- return true;
- }
-
- private IDocument fDocument;
-
- public HTMLValidator() {
- super();
- }
-
- /**
- */
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
- /**
- */
- protected IDOMModel getModel(IProject project, IFile file) {
- if (project == null || file == null)
- return null;
- if (!file.exists())
- return null;
- if (!canHandle(file))
- return null;
-
- IStructuredModel model = null;
- IModelManager manager = StructuredModelManager.getModelManager();
-
- try {
- try {
- model = manager.getModelForRead(file);
- }
- catch (UnsupportedEncodingException ex) {
- // retry ignoring META charset for invalid META charset
- // specification
- // recreate input stream, because it is already partially read
- model = manager.getModelForRead(file, new String(), null);
- }
- }
- catch (UnsupportedEncodingException ex) {
- }
- catch (IOException ex) {
- }
- catch (CoreException ex) {
- }
-
- if (model == null)
- return null;
- if (!(model instanceof IDOMModel)) {
- releaseModel(model);
- return null;
- }
- return (IDOMModel) model;
- }
-
- /**
- */
- protected HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
- return new HTMLValidationReporter(this, reporter, file, model);
- }
-
- /**
- * Check file extension to validate
- */
- private boolean canHandle(IFile file) {
- boolean result = false;
- if (file != null) {
- try {
- IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
-
- IContentDescription contentDescription = file.getContentDescription();
- IContentType htmlContentType = contentTypeManager.getContentType(ORG_ECLIPSE_WST_HTML_CORE_HTMLSOURCE);
- if (contentDescription != null) {
- IContentType fileContentType = contentDescription.getContentType();
-
- if (htmlContentType != null) {
- if (fileContentType.isKindOf(htmlContentType)) {
- result = true;
- }
- else {
- // ISSUE: here's a little "backwards" dependancy.
- // there should be a "JSPEMBEDDEDHTML validator"
- // contributed by JSP plugin.
- IContentType jspContentType = contentTypeManager.getContentType(ORG_ECLIPSE_JST_JSP_CORE_JSPSOURCE);
- if (jspContentType != null) {
- result = fileContentType.isKindOf(jspContentType);
- }
- }
- }
- }
- else if (htmlContentType != null) {
- result = htmlContentType.isAssociatedWith(file.getName());
- }
- }
- catch (CoreException e) {
- // should be rare, but will ignore to avoid logging "encoding
- // exceptions" and the like here.
- // Logger.logException(e);
- }
- }
- return result;
- }
-
- /**
- */
- private boolean hasHTMLFeature(IDOMDocument document) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return false;
- return adapter.hasFeature("HTML");//$NON-NLS-1$
- }
-
- /**
- */
- protected void releaseModel(IStructuredModel model) {
- if (model != null)
- model.releaseFromRead();
- }
-
- /**
- */
- public void validate(IValidationContext helper, IReporter reporter) {
- if (helper == null)
- return;
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
- String[] deltaArray = helper.getURIs();
- if (deltaArray != null && deltaArray.length > 0) {
- validateDelta(helper, reporter);
- }
- else {
- validateFull(helper, reporter);
- }
- }
-
- /**
- * This validate call is for the ISourceValidator partial document
- * validation approach
- *
- * @param dirtyRegion
- * @param helper
- * @param reporter
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
- */
- public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
-
- if (helper == null || fDocument == null)
- return;
-
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
-
- IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (model == null)
- return; // error
-
- try {
-
- IDOMDocument document = null;
- if (model instanceof IDOMModel) {
- document = ((IDOMModel) model).getDocument();
- }
-
- if (document == null || !hasHTMLFeature(document))
- return; // ignore
-
- ITextFileBuffer fb = FileBufferModelManager.getInstance().getBuffer(fDocument);
- if (fb == null)
- return;
-
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fb.getLocation());
- if (file == null || !file.exists())
- return;
-
- // this will be the wrong region if it's Text (instead of Element)
- // we don't know how to validate Text
- IndexedRegion ir = getCoveringNode(dirtyRegion); // model.getIndexedRegion(dirtyRegion.getOffset());
- if (ir instanceof Text) {
- while (ir != null && ir instanceof Text) {
- // it's assumed that this gets the IndexedRegion to
- // the right of the end offset
- ir = model.getIndexedRegion(ir.getEndOffset());
- }
- }
-
- if (ir instanceof INodeNotifier) {
-
- INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
- ValidationAdapter adapter = (ValidationAdapter) factory.adapt((INodeNotifier) ir);
- if (adapter == null)
- return; // error
-
- if (reporter != null) {
- HTMLValidationReporter rep = null;
- rep = getReporter(reporter, file, (IDOMModel) model);
- rep.clear();
- adapter.setReporter(rep);
-
- String fileName = ""; //$NON-NLS-1$
- IPath filePath = file.getFullPath();
- if (filePath != null) {
- fileName = filePath.toString();
- }
- String args[] = new String[]{fileName};
-
- Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(HTMLUIMessages.MESSAGE_HTML_VALIDATION_MESSAGE_UI_, args));
- mess.setParams(args);
- reporter.displaySubtask(this, mess);
- }
- adapter.validate(ir);
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- private IndexedRegion getCoveringNode(IRegion dirtyRegion) {
-
- IndexedRegion largestRegion = null;
- if(fDocument instanceof IStructuredDocument) {
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- try {
- if(sModel != null) {
- IStructuredDocumentRegion[] regions = ((IStructuredDocument)fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
- largestRegion = getLargest(regions);
- }
- }
- finally {
- if(sModel != null)
- sModel.releaseFromRead();
- }
- }
- return largestRegion;
- }
- protected IndexedRegion getLargest(IStructuredDocumentRegion[] sdRegions) {
-
- if(sdRegions == null || sdRegions.length == 0)
- return null;
-
- IndexedRegion currentLargest = getCorrespondingNode(sdRegions[0]);
- for (int i = 0; i < sdRegions.length; i++) {
- if(!sdRegions[i].isDeleted()) {
- IndexedRegion corresponding = getCorrespondingNode(sdRegions[i]);
-
- if(currentLargest instanceof Text)
- currentLargest = corresponding;
-
- if(corresponding != null) {
- if(!(corresponding instanceof Text)) {
- if (corresponding.getStartOffset() <= currentLargest.getStartOffset()
- && corresponding.getEndOffset() >= currentLargest.getEndOffset() )
- currentLargest = corresponding;
- }
- }
-
- }
- }
- return currentLargest;
- }
- protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- IndexedRegion indexedRegion = null;
- try {
- if (sModel != null)
- indexedRegion = sModel.getIndexedRegion(sdRegion.getStart());
- } finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- return indexedRegion;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
- */
- public void connect(IDocument document) {
- fDocument = document;
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator
- */
- public void disconnect(IDocument document) {
- // don't need to do anything
- }
-
- /**
- */
- protected HTMLValidationResult validate(IDOMModel model, IFile file) {
- IProject prj = null;
- if (file != null) {
- prj = file.getProject();
- }
- if ((prj == null) && (model != null)) {
- URIResolver res = model.getResolver();
- if (res != null) {
- prj = res.getProject();
- }
- }
- final WorkbenchReporter reporter = new WorkbenchReporter(prj, new NullProgressMonitor());
- return validate(reporter, file, model);
- }
-
- /**
- */
- private HTMLValidationResult validate(IReporter reporter, IFile file, IDOMModel model) {
- if (file == null || model == null)
- return null; // error
- IDOMDocument document = model.getDocument();
- if (document == null)
- return null; // error
- if (!hasHTMLFeature(document))
- return null; // ignore
-
- INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
- ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
- if (adapter == null)
- return null; // error
-
- HTMLValidationReporter rep = getReporter(reporter, file, model);
- rep.clear();
- adapter.setReporter(rep);
- if (reporter != null) {
- String fileName = ""; //$NON-NLS-1$
- IPath filePath = file.getFullPath();
- if (filePath != null) {
- fileName = filePath.toString();
- }
- String args[] = new String[]{fileName};
-
- // Message mess = new Message("HTMLValidation", //$NON-NLS-1$
- // SeverityEnum.LOW_SEVERITY,
- // "MESSAGE_HTML_VALIDATION_MESSAGE_UI_", //$NON-NLS-1$
- // args);
- Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, NLS.bind(HTMLUIMessages.MESSAGE_HTML_VALIDATION_MESSAGE_UI_, args));
- mess.setParams(args);
- reporter.displaySubtask(this, mess);
- }
- adapter.validate(document);
- return rep.getResult();
- }
-
- /**
- */
- private void validateContainer(IValidationContext helper, IReporter reporter, IContainer container) {
- try {
- IResource[] resourceArray = container.members(false);
- for (int i = 0; i < resourceArray.length; i++) {
- IResource resource = resourceArray[i];
- if (resource == null)
- continue;
- if (resource instanceof IFile) {
- validateFile(helper, reporter, (IFile) resource);
- }
- else if (resource instanceof IContainer) {
- validateContainer(helper, reporter, (IContainer) resource);
- }
- }
- }
- catch (CoreException ex) {
- }
- }
-
- /**
- */
- private void validateDelta(IValidationContext helper, IReporter reporter) {
- String[] deltaArray = helper.getURIs();
- for (int i = 0; i < deltaArray.length; i++) {
- String delta = deltaArray[i];
- if (delta == null)
- continue;
- IResource resource = getResource(delta);
- if (resource == null || !(resource instanceof IFile))
- continue;
- validateFile(helper, reporter, (IFile) resource);
- }
- }
-
- /**
- */
- private void validateFile(IValidationContext helper, IReporter reporter, IFile file) {
- if ((reporter != null) && (reporter.isCancelled() == true)) {
- throw new OperationCanceledException();
- }
- if (!shouldValidate(file)) {
- return;
- }
- IDOMModel model = getModel(file.getProject(), file);
- if (model == null)
- return;
-
- try {
- validate(reporter, file, model);
- }
- finally {
- releaseModel(model);
- }
- }
-
- /**
- */
- private void validateFull(IValidationContext helper, IReporter reporter) {
- IProject project = null;
- String[] fileDelta = helper.getURIs();
- if (helper instanceof IWorkbenchContext) {
- IWorkbenchContext wbHelper = (IWorkbenchContext) helper;
- project = wbHelper.getProject();
- }
- else {
- // won't work for project validation (b/c nothing in file delta)
- project = getResource(fileDelta[0]).getProject();
- }
- if (project == null)
- return;
- validateContainer(helper, reporter, project);
- }
-
- /*
- * added to get rid or dependency on IWorkbenchHelper
- *
- */
- public IResource getResource(String delta) {
- return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(delta));
- }
-
- public ISchedulingRule getSchedulingRule(IValidationContext helper) {
- return null;
- }
-
- public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
- // Exception catching was removed, see
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=123600
- IStatus status = Status.OK_STATUS;
- validate(helper, reporter);
- return status;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
deleted file mode 100644
index 5eba12947d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/LocalizedMessage.java
+++ /dev/null
@@ -1,65 +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.internal.validation;
-
-import java.util.Locale;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.internal.core.Message;
-
-/**
- * copied from org.eclipse.wst.validation.internal.operations.LocalizedMessage
- *
- * This class is provided for validators which run only in Eclipse and whose messages, because they
- * come from another tool, are already localized. LocalizedMessage cannot be used by any validator
- * which needs to run in both WebSphere and Eclipse.
- */
-public class LocalizedMessage extends Message {
- private String _message = null;
-
- public LocalizedMessage(int severity, String messageText) {
- this(severity, messageText, null);
- }
-
- public LocalizedMessage(int severity, String messageText, IResource targetObject) {
- this(severity, messageText, (Object) targetObject);
- }
-
- public LocalizedMessage(int severity, String messageText, Object targetObject) {
- super(null, severity, null);
- setLocalizedMessage(messageText);
- setTargetObject(targetObject);
- }
-
- public void setLocalizedMessage(String message) {
- _message = message;
- }
-
- public String getLocalizedMessage() {
- return _message;
- }
-
- public String getText() {
- return getLocalizedMessage();
- }
-
- public String getText(ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l, ClassLoader cl) {
- return getLocalizedMessage();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java
deleted file mode 100644
index 71ede2d9d7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListHelper.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.internal.validation;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- *
- * Class to help this Problem's list.
- *
- */
-class TaskListHelper {
- private static TaskListHelper _taskListHelper = null;
-
- public static TaskListHelper getTaskList() {
- if (_taskListHelper == null) {
- _taskListHelper = new TaskListHelper();
- }
- return _taskListHelper;
- }
-
- /**
- * This method adds a message to a resource in the task list.
- */
- public void addTask(String pluginId, IResource resource, String location, String messageId, String message, int markerType, String targetObjectName, String groupName, int offset, int length) throws CoreException {
- TaskListUtility.addTask(pluginId, resource, location, messageId, message, markerType, targetObjectName, groupName, offset, length);
- }
-
- /**
- * This method removes all messages from a resource in the task list.
- */
- public void removeAllTasks(IResource resource, String owner, String objectName) throws CoreException {
- TaskListUtility.removeAllTasks(resource, owner, objectName);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java b/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
deleted file mode 100644
index dcc3c5a2f6..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src-html-validation/org/eclipse/wst/html/internal/validation/TaskListUtility.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * This class must be called only by the validation framework.
- *
- * This singleton interacts with the eclipse workbench's Task list.
- * TaskListUtility adds and removes tasks from the list.
- *
- * This class must not be called outside of an IWorkspaceRunnable or
- * IRunnableWithProgress. Many resource deltas can be generated by the methods
- * in this class.
- *
- * This came from TaskListUtility
- */
-public class TaskListUtility {
- // private static final String PLUGIN_ID = ValidationPlugin.PLUGIN_ID;
- private static final String PLUGIN_ID = HTMLUIPlugin.ID;
- private static final String VALIDATION_MARKER = PLUGIN_ID + ".problemmarker"; //$NON-NLS-1$ // The extension which is used to add validation markers to the task list
- private static final String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$ // The IValidator who owns the IMarker on the task list
- private static final String VALIDATION_MARKER_SEVERITY = "validationSeverity"; //$NON-NLS-1$ // one of the IMessage values
- private static final String VALIDATION_MARKER_TARGETOBJECT = "targetObject"; //$NON-NLS-1$ // When more than one target object resolves to the same IResource, this field identifies which targetObject owns a particular message.
- private static final String VALIDATION_MARKER_GROUP = "groupName"; //$NON-NLS-1$ // For incremental validation, this field associates a message with a group, so that a subset of messages may be removed from a file.
- private static final String VALIDATION_MARKER_MESSAGEID = "messageId"; //$NON-NLS-1$ // Persist the message id of the message, not just the translated text.
- private static final int DEPTH_INFINITE = IResource.DEPTH_INFINITE;
- private static final int DEPTH_ZERO = IResource.DEPTH_ZERO;
- private final static IMarker[] NO_MARKERS = new IMarker[0];
-
- /**
- * This method adds a message to a resource in the task list.
- */
- public static IMarker addTask(String pluginId, IResource resource, String location, String messageId, String message, int markerType, String targetObjectName, String groupName, int offset, int length) throws CoreException {
- if ((message == null) || (resource == null)) {
- return null;
- }
-
- int severity = getSeverity(markerType);
-
- // Allow duplicate entries in the task list.
- // Prior to a full validation, the validation framework will remove
- // all messages owned
- // by a validator before it is executed.
- // Prior to an incremental validation, the validation framework will
- // remove all messages,
- // on each of the changed resources, owned by a validator before it is
- // invoked.
- //
- // It is up to the validator to make sure that it is not adding the
- // same message
- // in more than one place, and also to clear out any old messages
- // which are not cleared
- // by the validation framework.
- IMarker item = resource.createMarker(VALIDATION_MARKER); // add a
- // validation
- // marker
-
- // For performance reasons, replace the multiple setAttribute
- // calls above with a single setAttributes call.
- boolean offsetSet = ((offset != IMessage.OFFSET_UNSET) && (length != IMessage.OFFSET_UNSET));
- int size = (offsetSet) ? 10 : 8; // add CHAR_START, CHAR_END only
- // if the offset is set. If the
- // offset is set, it takes
- // precendence over the line
- // number. (eclipse's rule, not
- // mine.)
- String[] attribNames = new String[size];
- Object[] attribValues = new Object[size];
-
- // Very first thing, add the owner. That way, if the code dies
- // before things are persisted, hopefully this marker will be
- // persisted.
- // Hopefully, eclipse WILL persist this field, as requested.
- attribNames[0] = VALIDATION_MARKER_OWNER;
- attribValues[0] = pluginId;
- attribNames[1] = VALIDATION_MARKER_SEVERITY; // this validation
- // severity is stored,
- // in addition to the
- // marker severity, to
- // enable more than
- // one severity of
- // message to be
- // displayed. e.g.
- // ERROR | WARNING
- // (using binary OR).
- // The IMarker
- // constants are
- // regular decimal
- // constants.
- attribValues[1] = new Integer(markerType);
- attribNames[2] = VALIDATION_MARKER_TARGETOBJECT; // to distinguish
- // between
- // messages which
- // are registered
- // on an
- // IResource, but
- // against
- // different
- // target objects
- attribValues[2] = ((targetObjectName == null) ? "" : targetObjectName); //$NON-NLS-1$
- attribNames[3] = VALIDATION_MARKER_GROUP;
- attribValues[3] = ((groupName == null) ? "" : groupName); //$NON-NLS-1$
- attribNames[4] = IMarker.MESSAGE;
- attribValues[4] = message;
- attribNames[5] = VALIDATION_MARKER_MESSAGEID;
- attribValues[5] = messageId;
-
- attribNames[6] = IMarker.SEVERITY; // IMarker.SEVERITY_ERROR,
- // IMarker.SEVERITY_WARNING,
- // IMarker.SEVERITY_INFO
- attribValues[6] = new Integer(severity);
- try {
- // If the location is a line number, store it as a line number
- Integer lineNumber = Integer.valueOf(location);
- attribNames[7] = IMarker.LINE_NUMBER;
- attribValues[7] = lineNumber;
- }
- catch (NumberFormatException exc) {
- // Otherwise, store it as a text location
- attribNames[7] = IMarker.LOCATION;
- attribValues[7] = location;
- }
-
- if (offsetSet) {
- attribNames[8] = IMarker.CHAR_START;
- attribValues[8] = new Integer(offset);
- attribNames[9] = IMarker.CHAR_END;
- attribValues[9] = new Integer(offset + length);
- }
-
- item.setAttributes(attribNames, attribValues);
-
- return item;
- }
-
- /**
- * Given one of the SeverityEnum severities, return the IMarker severity
- * int that is its equivalent.
- */
- private static int getSeverity(int severityEnumValue) {
- switch (severityEnumValue) {
- case (IMessage.HIGH_SEVERITY) : {
- return IMarker.SEVERITY_ERROR;
- }
-
- case (IMessage.LOW_SEVERITY) : {
- return IMarker.SEVERITY_INFO;
- }
-
- case (IMessage.NORMAL_SEVERITY) : {
- return IMarker.SEVERITY_WARNING;
- }
-
- case (IMessage.ALL_MESSAGES) :
- case (IMessage.ERROR_AND_WARNING) :
- default : {
- // assume it's a warning.
- return IMarker.SEVERITY_WARNING;
- }
- }
- }
-
- private static int getDepth(IResource resource) {
- if (resource instanceof IProject) {
- return DEPTH_INFINITE; // DEPTH_INFINITE means get this project's
- // markers, and the markers belonging to
- // the project's children.
- }
- else if (resource instanceof IWorkspaceRoot) {
- // Needed for the ValidationMigrator when it checks for orphan
- // tasks.
- return DEPTH_INFINITE; // DEPTH_INFINITE means get all of the
- // markers in the workspace
- }
-
- return DEPTH_ZERO; // DEPTH_ZERO means just this resource, not its
- // children
- }
-
- private static IMarker[] getValidationTasks(IResource resource, int severity, int depth) {
- IMarker[] tempMarkers = null;
- int validCount = 0;
- try {
- IMarker[] allMarkers = null;
- try {
- allMarkers = resource.findMarkers(VALIDATION_MARKER, false, depth); // false
- // means
- // only
- // consider
- // PROBLEM_MARKER,
- // not
- // variants
- // of
- // PROBLEM_MARKER.
- // Since
- // addTask
- // only
- // adds
- // PROBLEM_MARKER,
- // we
- // don't
- // need
- // to
- // consider
- // its
- // subtypes.
- }
- catch (CoreException exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry = ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(IResource,
- // int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- return NO_MARKERS;
- }
-
- // Now filter in the markers, based on severity type.
- if (allMarkers.length != 0) {
- tempMarkers = new IMarker[allMarkers.length];
- for (int i = 0; i < allMarkers.length; i++) {
- IMarker marker = allMarkers[i];
- Integer filterSeverity = (Integer) marker.getAttribute(VALIDATION_MARKER_SEVERITY);
- if (filterSeverity == null) {
- // odd...marker wasn't created correctly. How could
- // this happen?
- // Default to the current severity and add it to the
- // list.
- try {
- marker.setAttribute(IMarker.SEVERITY, getSeverity(severity));
- }
- catch (CoreException exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry =
- // ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(int,
- // IResource, int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- continue;
- }
- catch (Throwable exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry =
- // ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(int,
- // IResource, int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- continue;
- }
- }
- else if ((severity & filterSeverity.intValue()) == 0) {
- continue;
- }
- tempMarkers[validCount++] = marker;
- }
- }
- }
- catch (CoreException exc) {
- // Logger logger = ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry = ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(int,
- // IResource, int)"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- }
-
- if (validCount == 0) {
- return NO_MARKERS;
- }
-
- IMarker[] validMarkers = new IMarker[validCount];
- System.arraycopy(tempMarkers, 0, validMarkers, 0, validCount);
- return validMarkers;
- }
-
- private static IMarker[] getValidationTasks(IResource resource, String[] messageOwners, int depth) {
- IMarker[] markers = getValidationTasks(resource, IMessage.ALL_MESSAGES, depth);
- if (markers.length == 0) {
- return NO_MARKERS;
- }
-
- IMarker[] temp = new IMarker[markers.length];
- int validCount = 0;
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
-
- try {
- Object owner = marker.getAttribute(VALIDATION_MARKER_OWNER);
- if ((owner == null) || !(owner instanceof String)) {
- // The ValidationMigrator will remove any "unowned"
- // validation markers.
- continue;
- }
-
- for (int j = 0; j < messageOwners.length; j++) {
- String messageOwner = messageOwners[j];
- if (((String) owner).equals(messageOwner)) {
- temp[validCount++] = marker;
- break;
- }
- }
- }
- catch (CoreException exc) {
- // Logger logger =
- // ValidationPlugin.getPlugin().getMsgLogger();
- // if (logger.isLoggingLevel(Level.SEVERE)) {
- // LogEntry entry = ValidationPlugin.getLogEntry();
- // entry.setSourceID("TaskListUtility.getValidationTasks(project,
- // String[])"); //$NON-NLS-1$
- // entry.setTargetException(exc);
- // logger.write(Level.SEVERE, entry);
- // }
- return NO_MARKERS;
- }
- }
-
- IMarker[] result = new IMarker[validCount];
- System.arraycopy(temp, 0, result, 0, validCount);
- return result;
- }
-
- /**
- * This method retrieves all validation tasks from the resource. If depth
- * is INFINITE, child tasks are returned as well. Only the tasks which are
- * owned by the specified messageOwner, and apply to the named IMessage's
- * target object (objectName) will be returned.
- */
- private static IMarker[] getValidationTasks(IResource resource, String[] messageOwner, String objectName, String groupName, int depth) throws CoreException {
- if ((messageOwner == null) || (resource == null)) {
- return NO_MARKERS;
- }
-
- int validCount = 0;
- IMarker[] validList = null;
- IMarker[] markers = getValidationTasks(resource, messageOwner, depth);
- if (markers != null) {
- validList = new IMarker[markers.length];
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
-
- // If more than one target object resolves to the same
- // resource, removing one target's
- // messages should not remove the other target object's
- // messages.
- if (objectName != null) {
- Object targetObject = marker.getAttribute(VALIDATION_MARKER_TARGETOBJECT);
- if ((targetObject == null) || !(targetObject instanceof String) || !(((String) targetObject).equals(objectName))) {
- continue;
- }
- }
-
- if (groupName != null) {
- Object group = marker.getAttribute(VALIDATION_MARKER_GROUP);
- if ((group == null) || !(group instanceof String) || !(((String) group).equals(groupName))) {
- continue;
- }
- }
-
- validList[validCount++] = marker;
- }
- }
-
- if (validCount == 0) {
- return NO_MARKERS;
- }
-
- IMarker[] result = new IMarker[validCount];
- System.arraycopy(validList, 0, result, 0, validCount);
- return result;
- }
-
- /**
- * This method removes all messages from a resource in the task list.
- */
- public static void removeAllTasks(IResource resource, String owner, String objectName) throws CoreException {
- removeAllTasks(resource, new String[]{owner}, objectName);
- }
-
- public static void removeAllTasks(IResource resource, String[] owners, String objectName) throws CoreException {
- removeAllTasks(resource, owners, objectName, getDepth(resource));
- }
-
- protected static void removeAllTasks(IResource resource, String[] owners, String objectName, int depth) throws CoreException {
- removeTaskSubset(resource, owners, objectName, null, depth); // null
- // means
- // no
- // group
- // name
- }
-
- /**
- * This method removes a subset of tasks from the project, including child
- * tasks. Every task which belongs to the group, identified by groupName,
- * will be removed.
- */
- protected static void removeTaskSubset(IResource resource, String[] owners, String objectName, String groupName, int depth) throws CoreException {
- if ((owners == null) || (resource == null)) {
- return;
- }
-
- IMarker[] allTasks = getValidationTasks(resource, owners, objectName, groupName, depth);
- if (allTasks.length > 0) {
- ResourcesPlugin.getWorkspace().deleteMarkers(allTasks);
- }
- }
-} \ 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 80cbe16ead..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.Vector;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForEmbeddedCSS;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.html.ui.internal.autoedit.AutoEditStrategyForTabs;
-import org.eclipse.wst.html.ui.internal.autoedit.StructuredAutoEditStrategyHTML;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML;
-import org.eclipse.wst.html.ui.internal.hyperlink.XMLHyperlinkDetector;
-import org.eclipse.wst.html.ui.internal.style.LineStyleProviderForHTML;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLInformationProvider;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.style.LineStyleProviderForJavaScript;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptInformationProvider;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-
-/**
- * Configuration for a source viewer which shows HTML content.
- * <p>
- * Clients can subclass and override just those methods which must be specific
- * to their needs.
- * </p>
- *
- * @see org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- * @since 1.0
- */
-public class StructuredTextViewerConfigurationHTML extends StructuredTextViewerConfiguration {
- /*
- * One instance per configuration because not sourceviewer-specific and
- * it's a String array
- */
- private String[] fConfiguredContentTypes;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForEmbeddedCSS;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForHTML;
- /*
- * One instance per configuration
- */
- private LineStyleProvider fLineStyleProviderForJavascript;
- /*
- * One instance per configuration
- */
- private StructuredTextViewerConfiguration fXMLSourceViewerConfiguration;
-
- /**
- * Create new instance of StructuredTextViewerConfigurationHTML
- */
- public StructuredTextViewerConfigurationHTML() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) {
- allStrategies.add(new StructuredAutoEditStrategyHTML());
- }
-
- // be sure this is added last in list, so it has a change to modify
- // previous results.
- // add auto edit strategy that handles when tab key is pressed
- allStrategies.add(new AutoEditStrategyForTabs());
-
- return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (fConfiguredContentTypes == null) {
- String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
- String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes();
- fConfiguredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length];
-
- fConfiguredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION;
- fConfiguredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION;
-
- int index = 0;
- System.arraycopy(xmlTypes, 0, fConfiguredContentTypes, index += 2, xmlTypes.length);
- System.arraycopy(htmlTypes, 0, fConfiguredContentTypes, index += xmlTypes.length, htmlTypes.length);
- }
-
- return fConfiguredContentTypes;
- }
-
- protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
- IContentAssistProcessor[] processors = null;
-
- if ((partitionType == IHTMLPartitions.HTML_DEFAULT) || (partitionType == IHTMLPartitions.HTML_COMMENT)) {
- processors = new IContentAssistProcessor[]{new HTMLContentAssistProcessor()};
- }
- else if (partitionType == IHTMLPartitions.SCRIPT) {
- processors = new IContentAssistProcessor[]{new JavaScriptContentAssistProcessor()};
- }
- else if (partitionType == ICSSPartitions.STYLE) {
- processors = new IContentAssistProcessor[]{new CSSContentAssistProcessor()};
- }
- else if (partitionType == IStructuredPartitions.UNKNOWN_PARTITION) {
- processors = new IContentAssistProcessor[]{new NoRegionContentAssistProcessorForHTML()};
- }
-
- return processors;
- }
-
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitions.HTML_DEFAULT);
-
- formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-
- return formatter;
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- if (contentType == IHTMLPartitions.HTML_DEFAULT) {
- // use xml's doubleclick strategy
- return getXMLSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, IXMLPartitions.XML_DEFAULT);
- }
- else
- return super.getDoubleClickStrategy(sourceViewer, contentType);
- }
-
- public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
- if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
- return null;
-
- List allDetectors = new ArrayList(0);
- allDetectors.add(new XMLHyperlinkDetector());
-
- IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
- for (int m = 0; m < superDetectors.length; m++) {
- IHyperlinkDetector detector = superDetectors[m];
- if (!allDetectors.contains(detector)) {
- allDetectors.add(detector);
- }
- }
- return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
- }
-
- public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- Vector vector = new Vector();
-
- // prefix[0] is either '\t' or ' ' x tabWidth, depending on preference
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- int indentationWidth = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
- String indentCharPref = preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR);
- boolean useSpaces = HTMLCorePreferenceNames.SPACE.equals(indentCharPref);
-
- for (int i = 0; i <= indentationWidth; i++) {
- StringBuffer prefix = new StringBuffer();
- boolean appendTab = false;
-
- if (useSpaces) {
- for (int j = 0; j + i < indentationWidth; j++)
- prefix.append(' ');
-
- if (i != 0)
- appendTab = true;
- }
- else {
- for (int j = 0; j < i; j++)
- prefix.append(' ');
-
- if (i != indentationWidth)
- appendTab = true;
- }
-
- if (appendTab) {
- prefix.append('\t');
- vector.add(prefix.toString());
- // remove the tab so that indentation - tab is also an indent
- // prefix
- prefix.deleteCharAt(prefix.length() - 1);
- }
- vector.add(prefix.toString());
- }
-
- vector.add(""); //$NON-NLS-1$
-
- return (String[]) vector.toArray(new String[vector.size()]);
- }
-
- protected IInformationProvider getInformationProvider(ISourceViewer sourceViewer, String partitionType) {
- IInformationProvider provider = null;
- if (partitionType == IHTMLPartitions.HTML_DEFAULT) {
- // HTML
- provider = new HTMLInformationProvider();
- }
- else if (partitionType == IHTMLPartitions.SCRIPT) {
- // HTML JavaScript
- provider = new JavaScriptInformationProvider();
- }
- return provider;
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- LineStyleProvider[] providers = null;
-
- if (partitionType == IHTMLPartitions.HTML_DEFAULT || partitionType == IHTMLPartitions.HTML_COMMENT || partitionType == IHTMLPartitions.HTML_DECLARATION) {
- providers = new LineStyleProvider[]{getLineStyleProviderForHTML()};
- }
- else if (partitionType == IHTMLPartitions.SCRIPT) {
- providers = new LineStyleProvider[]{getLineStyleProviderForJavascript()};
- }
- else if (partitionType == ICSSPartitions.STYLE) {
- providers = new LineStyleProvider[]{getLineStyleProviderForEmbeddedCSS()};
- }
-
- return providers;
- }
-
- private LineStyleProvider getLineStyleProviderForEmbeddedCSS() {
- if (fLineStyleProviderForEmbeddedCSS == null) {
- fLineStyleProviderForEmbeddedCSS = new LineStyleProviderForEmbeddedCSS();
- }
- return fLineStyleProviderForEmbeddedCSS;
- }
-
- private LineStyleProvider getLineStyleProviderForHTML() {
- if (fLineStyleProviderForHTML == null) {
- fLineStyleProviderForHTML = new LineStyleProviderForHTML();
- }
- return fLineStyleProviderForHTML;
- }
-
- private LineStyleProvider getLineStyleProviderForJavascript() {
- if (fLineStyleProviderForJavascript == null) {
- fLineStyleProviderForJavascript = new LineStyleProviderForJavaScript();
- }
- return fLineStyleProviderForJavascript;
- }
-
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- ITextHover textHover = null;
-
- // look for appropriate text hover processor to return based on
- // content type and state mask
- TextHoverManager manager = SSEUIPlugin.getDefault().getTextHoverManager();
- TextHoverManager.TextHoverDescriptor[] hoverDescs = manager.getTextHovers();
- int i = 0;
- while (i < hoverDescs.length && textHover == null) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
- // check if script or html is needed
- if (contentType == IHTMLPartitions.SCRIPT) {
- textHover = manager.createBestMatchHover(new JavaScriptTagInfoHoverProcessor());
- }
- else if (contentType == IHTMLPartitions.HTML_DEFAULT) {
- textHover = manager.createBestMatchHover(new HTMLTagInfoHoverProcessor());
- }
- }
- else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType))
- // check if script or html is needed
- if (contentType == IHTMLPartitions.SCRIPT) {
- textHover = new JavaScriptTagInfoHoverProcessor();
- }
- else if (contentType == IHTMLPartitions.HTML_DEFAULT) {
- textHover = new HTMLTagInfoHoverProcessor();
- }
- }
- i++;
- }
-
- // no appropriate text hovers found, try super
- if (textHover == null) {
- textHover = super.getTextHover(sourceViewer, contentType, stateMask);
- }
- return textHover;
- }
-
- private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
- if (fXMLSourceViewerConfiguration == null) {
- fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
- }
- return fXMLSourceViewerConfiguration;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
deleted file mode 100644
index 17bf857e26..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by HTML UI
- *
- * @plannedfor 1.0
- */
-public class HTMLUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.html.ui.internal.HTMLUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, HTMLUIMessages.class);
- }
-
- private HTMLUIMessages() {
- // cannot create new instance of this class
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-
- public static String Label_Elements;
- public static String Sample_HTML_doc;
- public static String HTMLFilesPreferencePage_0;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _ERROR_FILENAME_MUST_END_HTML;
- public static String _WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT;
- public static String ResourceGroup_nameExists;
- public static String NewHTMLTemplatesWizardPage_0;
- public static String NewHTMLTemplatesWizardPage_1;
- public static String NewHTMLTemplatesWizardPage_2;
- public static String NewHTMLTemplatesWizardPage_3;
- public static String NewHTMLTemplatesWizardPage_4;
- public static String NewHTMLTemplatesWizardPage_5;
- public static String NewHTMLTemplatesWizardPage_6;
- public static String Creating_files_encoding;
- public static String MESSAGE_HTML_VALIDATION_MESSAGE_UI_;
- public static String CleanupDocument_label; // resource bundle
- public static String CleanupDocument_tooltip; // resource bundle
- public static String CleanupDocument_description; // resource bundle
- public static String ToggleComment_label; // resource bundle
- public static String ToggleComment_tooltip; // resource bundle
- public static String ToggleComment_description; // resource bundle
- public static String AddBlockComment_label; // resource bundle
- public static String AddBlockComment_tooltip; // resource bundle
- public static String AddBlockComment_description; // resource bundle
- public static String RemoveBlockComment_label; // resource bundle
- public static String RemoveBlockComment_tooltip; // resource bundle
- public static String RemoveBlockComment_description; // resource bundle
- public static String FindOccurrences_label; // resource bundle
- public static String Creating_files;
- public static String Encoding_desc;
- public static String UI_Description_of_role_of_following_DOCTYPE;
- public static String UI_Default_HTML_DOCTYPE_ID___1;
- public static String UI_Public_ID;
- public static String UI_System_ID;
- public static String UI_none;
- public static String UI_CSS_profile___2;
- public static String Validation_description;
- public static String Validation_Missing_End_Tag;
- public static String Validation_Missing_Start_Tag;
- public static String WebContentSettingsPropertyPage_0;
- public static String ProjectWebContentSettingsPropertyPage_0;
-
- public static String Preferred_markup_case_UI_;
- public static String Tag_names__UI_;
- public static String Tag_names_Upper_case_UI_;
- public static String Tag_names_Lower_case_UI_;
- public static String Attribute_names__UI_;
- public static String Attribute_names_Upper_case_UI_;
- public static String Attribute_names_Lower_case_UI_;
- public static String Cleanup_UI_;
- public static String Tag_name_case_for_HTML_UI_;
- public static String Tag_name_case_As_is_UI_;
- public static String Tag_name_case_Lower_UI_;
- public static String Tag_name_case_Upper_UI_;
- public static String Attribute_name_case_for_HTML_UI_;
- public static String Attribute_name_case_As_is_UI_;
- public static String Attribute_name_case_Lower_UI_;
- public static String Attribute_name_case_Upper_UI_;
- public static String Insert_required_attributes_UI_;
- public static String Insert_missing_tags_UI_;
- public static String Quote_attribute_values_UI_;
- public static String Format_source_UI_;
- public static String Convert_EOL_codes_UI_;
- public static String EOL_Windows_UI;
- public static String EOL_Unix_UI;
- public static String EOL_Mac_UI;
- public static String Validation_Warning;
- public static String Validation_Error;
- public static String Validation_Ignore;
- public static String Validation_Title;
- public static String Validation_Workspace;
-
- // below are possibly unused strings that may be deleted
- public static String HTMLFilesPreferencePage_1;
- public static String HTMLFilesPreferencePage_2;
- public static String HTMLFilesPreferencePage_3;
- // above are possibly unused strings that may be deleted
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
deleted file mode 100644
index e77314f6e1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import java.io.IOException;
-
-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.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryRegistryImpl;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- protected static HTMLUIPlugin 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 HTMLUIPlugin() {
- super();
- instance = this;
- }
-
- public static HTMLUIPlugin getDefault() {
- return instance;
- }
-
- public synchronized static HTMLUIPlugin getInstance() {
- return instance;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /**
- * 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(), HTMLUIPreferenceNames.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) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsHTML.ALL);
- registry.addContextType(TemplateContextTypeIdsHTML.NEW);
- registry.addContextType(TemplateContextTypeIdsHTML.TAG);
- registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE);
- registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
-
- fContextTypeRegistry = registry;
- }
-
- return fContextTypeRegistry;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
deleted file mode 100644
index 8db5c46340..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ /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
-###############################################################################
-## 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>
-
-HTMLFilesPreferencePage_0=Loading files...
-#
-_UI_WIZARD_NEW_TITLE = New HTML Page
-_UI_WIZARD_NEW_HEADING = HTML Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML Page.
-_ERROR_FILENAME_MUST_END_HTML = The file name must end in one of the following extensions {0}.
-_WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT = Files created outside of the Web Content folder will not be included in your deployed Web application.
-ResourceGroup_nameExists = The same name already exists.
-NewHTMLTemplatesWizardPage_0=Select HTML Template
-NewHTMLTemplatesWizardPage_1=Select a template as initial content in the HTML page.
-NewHTMLTemplatesWizardPage_2=Name
-NewHTMLTemplatesWizardPage_3=Description
-NewHTMLTemplatesWizardPage_4=Use HTML Template
-NewHTMLTemplatesWizardPage_5=Preview
-NewHTMLTemplatesWizardPage_6=Templates are 'New HTML' templates found in the <a>HTML Templates</a> preference page.
-#
-Creating_files_encoding=Creating files encoding preference
-MESSAGE_HTML_VALIDATION_MESSAGE_UI_=HTML Syntax : {0}
-# Copied from sse.ui
-CleanupDocument_label=Cleanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-ToggleComment_label=Toggle Comment
-ToggleComment_tooltip=Toggle Comment
-ToggleComment_description=Toggle Comment
-AddBlockComment_label=Add Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_description=Add Block Comment
-RemoveBlockComment_label=Remove Block Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_description=Remove Block Comment
-FindOccurrences_label=Occurrences in File
-Creating_files=Creating files
-Encoding_desc=The following encoding will apply:
-Preferred_markup_case_UI_=Preferred markup case for content assist, and code generation
-Tag_names__UI_=Tag names:
-Tag_names_Upper_case_UI_=&Uppercase
-Tag_names_Lower_case_UI_=&Lowercase
-Attribute_names__UI_=Attribute names:
-Attribute_names_Upper_case_UI_=U&ppercase
-Attribute_names_Lower_case_UI_=L&owercase
-Cleanup_UI_=Cleanup
-Tag_name_case_for_HTML_UI_=Tag name case for HTML:
-Tag_name_case_As_is_UI_=&As-is
-Tag_name_case_Lower_UI_=&Lower
-Tag_name_case_Upper_UI_=&Upper
-Attribute_name_case_for_HTML_UI_=Attribute name case for HTML:
-Attribute_name_case_As_is_UI_=A&s-is
-Attribute_name_case_Lower_UI_=L&ower
-Attribute_name_case_Upper_UI_=U&pper
-Insert_required_attributes_UI_=Insert &required attributes
-Insert_missing_tags_UI_=&Insert missing tags
-Quote_attribute_values_UI_=&Quote attribute values
-Format_source_UI_=&Format source
-Convert_EOL_codes_UI_=Convert line &delimiters to
-EOL_Windows_UI=&Windows
-EOL_Unix_UI=U&NIX
-EOL_Mac_UI=&Mac
-
-# web content settings
-UI_Description_of_role_of_following_DOCTYPE=Use the following default document type when no DOCTYPE is declared in a file:
-UI_Default_HTML_DOCTYPE_ID___1=Document type:
-UI_Public_ID=Public ID:
-UI_System_ID=System ID:
-UI_none=none
-UI_CSS_profile___2=CSS profile:
-WebContentSettingsPropertyPage_0=The properties used that cannot or are not specified in web files. The project setting is used if you specify "none."
-ProjectWebContentSettingsPropertyPage_0=The properties for J2EE Web projects act as "project" default to be looked up when no properties are specified for a particular web file.
-
-#HTML Validation Preferences
-Validation_Warning=Warning
-Validation_Error=Error
-Validation_Ignore=Ignore
-
-Validation_Title=Validation Settings Changed
-Validation_Workspace=The validation settings have changed. A full validation is required for changes to take effect. Validate now?
-Validation_description=Select the severity level for the following validation problems:
-Validation_Missing_Start_Tag=Missing start tag:
-Validation_Missing_End_Tag=Missing end tag:
-
-# below are possibly unused strings that may be deleted
-HTMLFilesPreferencePage_1=Add this suffix (if not specified):
-HTMLFilesPreferencePage_2=Insert DOCTYPE declaration
-HTMLFilesPreferencePage_3=Insert GENERATOR with META tag
-# above are possibly unused strings that may be deleted
-Label_Elements=Elements
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 926001320e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
+++ /dev/null
@@ -1,160 +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 com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- 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, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void 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/autoedit/AutoEditStrategyForTabs.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
deleted file mode 100644
index 0eb394ccf9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/AutoEditStrategyForTabs.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*********************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.autoedit;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ConfigurableLineTracker;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ILineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * AutoEditStrategy to handle characters inserted when Tab key is pressed
- */
-public class AutoEditStrategyForTabs implements IAutoEditStrategy {
- private final String TAB_CHARACTER = "\t"; //$NON-NLS-1$
-
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- // if not in smart insert mode just ignore
- if (!isSmartInsertMode())
- return;
-
- // spaces for tab character
- if (command.length == 0 && command.text != null && command.text.length() > 0 && command.text.indexOf(TAB_CHARACTER) != -1)
- smartInsertForTab(command, document);
- }
-
- /**
- * Insert spaces for tabs
- *
- * @param command
- */
- private void smartInsertForTab(DocumentCommand command, IDocument document) {
- // tab key was pressed. now check preferences to see if need to insert
- // spaces instead of tab
- int indentationWidth = getIndentationWidth();
- if (indentationWidth > -1) {
- String originalText = command.text;
- StringBuffer newText = new StringBuffer(originalText);
-
- // determine where in line this command begins
- int lineOffset = -1;
- try {
- IRegion lineInfo = document.getLineInformationOfOffset(command.offset);
- lineOffset = command.offset - lineInfo.getOffset();
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- ILineTracker lineTracker = getLineTracker(document, originalText);
-
- int startIndex = 0;
- int index = newText.indexOf(TAB_CHARACTER);
- while (index != -1) {
- String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
-
- // replace \t character with spaces
- newText.replace(index, index + 1, indent);
- if (lineTracker != null) {
- try {
- lineTracker.replace(index, 1, indent);
- } catch (BadLocationException e) {
- // if something goes wrong with replacing text, just
- // reset to current string
- lineTracker.set(newText.toString());
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
-
- startIndex = index + indent.length();
- index = newText.indexOf(TAB_CHARACTER, startIndex);
- }
- command.text = newText.toString();
- }
- }
-
- /**
- * Calculate number of spaces for next tab stop
- */
- private String getIndentString(int indentationWidth, int lineOffset, ILineTracker lineTracker, int index) {
- int indentSize = indentationWidth;
- int offsetInLine = -1;
- if (lineTracker != null) {
- try {
- IRegion lineInfo = lineTracker.getLineInformationOfOffset(index);
- if (lineInfo.getOffset() == 0 && lineOffset > -1)
- offsetInLine = lineOffset + index;
- else
- offsetInLine = index - lineInfo.getOffset();
- } catch (BadLocationException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- } else {
- if (lineOffset > -1) {
- offsetInLine = lineOffset + index;
- }
- }
- if (offsetInLine > -1 && indentationWidth > 0) {
- int remainder = offsetInLine % indentationWidth;
- indentSize = indentationWidth - remainder;
- }
-
- StringBuffer indent = new StringBuffer();
- for (int i = 0; i < indentSize; i++)
- indent.append(' ');
- return indent.toString();
- }
-
- /**
- * Set up a line tracker for text within command if text is multi-line
- */
- private ILineTracker getLineTracker(IDocument document, String originalText) {
- ConfigurableLineTracker lineTracker = null;
- int[] delims = TextUtilities.indexOf(document.getLegalLineDelimiters(), originalText, 0);
- if (delims[0] != -1 || delims[1] != -1) {
- lineTracker = new ConfigurableLineTracker(document.getLegalLineDelimiters());
- lineTracker.set(originalText);
- }
- return lineTracker;
- }
-
- /**
- * Return true if active editor is in smart insert mode, false otherwise
- *
- * @return
- */
- private boolean isSmartInsertMode() {
- boolean isSmartInsertMode = false;
-
- ITextEditor textEditor = null;
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor)
- textEditor = (ITextEditor)editor;
- else
- textEditor = (ITextEditor)editor.getAdapter(ITextEditor.class);
- }
- }
- }
-
- // check if smart insert mode
- if (textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT)
- isSmartInsertMode = true;
- return isSmartInsertMode;
- }
-
- /**
- * Returns indentation width if using spaces for indentation, -1 otherwise
- *
- * @return
- */
- private int getIndentationWidth() {
- int width = -1;
-
- Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
- if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
- width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);
-
- return width;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
deleted file mode 100644
index d17d678141..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/autoedit/StructuredAutoEditStrategyHTML.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.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.autoedit;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.w3c.dom.Node;
-
-/**
- * Automatically inserts closing comment tag or end tag when appropriate.
- */
-public class StructuredAutoEditStrategyHTML implements IAutoEditStrategy {
- /*
- * NOTE: copies of this class exists in
- * org.eclipse.wst.xml.ui.internal.autoedit
- * org.eclipse.wst.html.ui.internal.autoedit
- */
- public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
- Object textEditor = getActiveTextEditor();
- if (!(textEditor instanceof ITextEditorExtension3 && ((ITextEditorExtension3) textEditor).getInsertMode() == ITextEditorExtension3.SMART_INSERT))
- return;
-
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model != null) {
- if (command.text != null) {
- smartInsertForComment(command, document, model);
- smartInsertForEndTag(command, document, model);
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- private boolean isCommentNode(IDOMNode node) {
- return (node != null && node instanceof IDOMElement && ((IDOMElement) node).isCommentTag());
- }
-
- private boolean isDocumentNode(IDOMNode node) {
- return (node != null && node.getNodeType() == Node.DOCUMENT_NODE);
- }
-
- private void smartInsertForComment(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("-") && document.getLength() >= 3 && document.get(command.offset - 3, 3).equals("<!-")) { //$NON-NLS-1$ //$NON-NLS-2$
- command.text += " -->"; //$NON-NLS-1$
- command.shiftsCaret = false;
- command.caretOffset = command.offset + 2;
- command.doit = false;
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
-
- }
-
- private void smartInsertForEndTag(DocumentCommand command, IDocument document, IStructuredModel model) {
- try {
- if (command.text.equals("/") && document.getLength() >= 1 && document.get(command.offset - 1, 1).equals("<")) { //$NON-NLS-1$ //$NON-NLS-2$
- IDOMNode parentNode = (IDOMNode) ((IDOMNode) model.getIndexedRegion(command.offset - 1)).getParentNode();
- if (isCommentNode(parentNode)) {
- // loop and find non comment node parent
- while (parentNode != null && isCommentNode(parentNode)) {
- parentNode = (IDOMNode) parentNode.getParentNode();
- }
- }
-
- if (!isDocumentNode(parentNode)) {
- // only add end tag if one does not already exist or if
- // add '/' does not create one already
- IStructuredDocumentRegion endTagStructuredDocumentRegion = parentNode.getEndStructuredDocumentRegion();
- if (endTagStructuredDocumentRegion == null) {
- StringBuffer toAdd = new StringBuffer(parentNode.getNodeName());
- if (toAdd.length() > 0) {
- toAdd.append(">"); //$NON-NLS-1$
- String suffix = toAdd.toString();
- if ((document.getLength() < command.offset + suffix.length()) || (!suffix.equals(document.get(command.offset, suffix.length())))) {
- command.text += suffix;
- }
- }
- }
- }
- }
- }
- catch (BadLocationException e) {
- Logger.logException(e);
- }
- }
-
- /**
- * Return the active text editor if possible, otherwise the active editor
- * part.
- *
- * @return Object
- */
- private Object getActiveTextEditor() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IEditorPart editor = page.getActiveEditor();
- if (editor != null) {
- if (editor instanceof ITextEditor)
- return editor;
- ITextEditor textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- if (textEditor != null)
- return textEditor;
- return editor;
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
deleted file mode 100644
index 3d08fde914..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.IRegion;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-/**
- * Purpose of this class is to make the additional proposal info into content
- * fit for an HTML viewer (by escaping characters)
- */
-class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
- // copies of this class exist in:
- // org.eclipse.jst.jsp.ui.internal.contentassist
- // org.eclipse.wst.html.ui.internal.contentassist
- // org.eclipse.wst.xml.ui.internal.contentassist
-
- public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
- super(template, context, region, image, relevance);
- }
-
- public String getAdditionalProposalInfo() {
- String additionalInfo = super.getAdditionalProposalInfo();
- return StringUtils.convertToHTMLContent(additionalInfo);
- }
-}
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 5f31eaae8e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-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.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-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 INodeAdapterFactory factoryForCSS = null;
- protected IPreferenceStore fPreferenceStore = null;
- protected boolean isXHTML = false;
- private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
- private List fTemplateContexts = new ArrayList();
-
- public HTMLContentAssistProcessor() {
-
- super();
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE);
- super.addAttributeNameProposals(contentAssistRequest);
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
- super.addAttributeValueProposals(contentAssistRequest);
- }
-
- /**
- * Add the proposals for a completely empty document
- */
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW);
- }
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- super.addPCDATAProposal(nodeName, contentAssistRequest);
- }
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- addEmptyDocumentProposals(contentAssistRequest);
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG);
- super.addTagInsertionProposals(contentAssistRequest, childPosition);
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
- addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- * @param startOffset
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
- if (contentAssistRequest == null)
- return;
-
- // if already adding template proposals for a certain context type, do
- // not add again
- if (!fTemplateContexts.contains(context)) {
- fTemplateContexts.add(context);
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
-
- if (getTemplateCompletionProcessor() != null) {
- getTemplateCompletionProcessor().setContextType(context);
- ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
- for (int i = 0; i < proposals.length; ++i) {
- if (useProposalList)
- contentAssistRequest.addProposal(proposals[i]);
- else
- contentAssistRequest.addMacro(proposals[i]);
- }
- }
- }
- }
-
- 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);
- }
-
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
- ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- // bug115927 use original document position for all/any region templates
- addTemplates(request, TemplateContextTypeIdsHTML.ALL, documentPosition);
- return request;
- }
-
- /**
- * 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) {
- fTemplateContexts.clear();
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) textViewer, documentPosition);
- IDOMNode node = (IDOMNode) 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() == DOMRegionContext.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() == DOMRegionContext.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() == DOMRegionContext.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(DOMRegionContext.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) {
- IModelManager mm = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- ICompletionProposal result = null;
- try {
- if (mm != null) {
- model = mm.getExistingModelForRead(viewer.getDocument());
-
- if (model != null) {
- IDOMDocument doc = ((IDOMModel) model).getDocument();
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
- if (mq != null) {
-
- // 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)
- */
- HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
- result = proposal;
- }
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- return result;
- }
-
- /**
- * @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, IDOMNode 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$
- }
-
- private HTMLTemplateCompletionProcessor 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 IDOMDocument)
- return ((IDOMDocument) 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 = HTMLUIPreferenceNames.AUTO_PROPOSE;
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- 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(HTMLUIPreferenceNames.AUTO_PROPOSE) == 0 || property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE) == 0) {
- reinit();
- }
- }
-
- protected IPreferenceStore getPreferenceStore() {
- if (fPreferenceStore == null)
- fPreferenceStore = HTMLUIPlugin.getDefault().getPreferenceStore();
-
- return fPreferenceStore;
- }
-
- 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 f3daa1ae65..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.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.internal.contentassist;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.ui.internal.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(HTMLCorePreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(HTMLCorePreferenceNames.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 HTMLCorePreferenceNames.LOWER :
- {
- name = name.toLowerCase();
- }
- break;
- case HTMLCorePreferenceNames.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 6d9d6fa485..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-
-
-/**
- * Completion processor for HTML Templates. Most of the work is already done
- * by the HTML Content Assist processor, so by the time the
- * HTMLTemplateCompletionProcessor is asked for content assist proposals, the
- * HTML content assist processor has already set the context type for
- * templates.
- */
-class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
- private static final class ProposalComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
- }
- }
-
- private static final Comparator fgProposalComparator = new ProposalComparator();
- private String fContextTypeId = null;
-
- /*
- * Copied from super class except instead of calling createContext(viewer,
- * region) call createContext(viewer, region, offset) instead
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
-
- ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
-
- // adjust offset to end of normalized selection
- if (selection.getOffset() == offset)
- offset = selection.getOffset() + selection.getLength();
-
- String prefix = extractPrefix(viewer, offset);
- Region region = new Region(offset - prefix.length(), prefix.length());
- TemplateContext context = createContext(viewer, region, offset);
- if (context == null)
- return new ICompletionProposal[0];
- // name of the selection variables {line, word}_selection
- context.setVariable("selection", selection.getText()); //$NON-NLS-1$
-
- Template[] templates = getTemplates(context.getContextType().getId());
-
- List matches = new ArrayList();
- for (int i = 0; i < templates.length; i++) {
- Template template = templates[i];
- try {
- context.getContextType().validate(template.getPattern());
- }
- catch (TemplateException e) {
- continue;
- }
- if (template.matches(prefix, context.getContextType().getId()))
- matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
- }
-
- Collections.sort(matches, fgProposalComparator);
-
- return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
- }
-
- /**
- * Creates a concrete template context for the given region in the
- * document. This involves finding out which context type is valid at the
- * given location, and then creating a context of this type. The default
- * implementation returns a <code>SmartReplaceTemplateContext</code> for
- * the context type at the given location. This takes the offset at which
- * content assist was invoked into consideration.
- *
- * @param viewer
- * the viewer for which the context is created
- * @param region
- * the region into <code>document</code> for which the
- * context is created
- * @param offset
- * the original offset where content assist was invoked
- * @return a template context that can handle template insertion at the
- * given location, or <code>null</code>
- */
- private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
- // pretty much same code as super.createContext except create
- // SmartReplaceTemplateContext
- TemplateContextType contextType = getContextType(viewer, region);
- if (contextType != null) {
- IDocument document = viewer.getDocument();
- return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
- }
- return null;
- }
-
- protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
- return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
- }
-
- protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
- TemplateContextType type = null;
-
- ContextTypeRegistry registry = getTemplateContextRegistry();
- if (registry != null)
- type = registry.getContextType(fContextTypeId);
-
- return type;
- }
-
- protected Image getImage(Template template) {
- // just return the same image for now
- return HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
- }
-
- private ContextTypeRegistry getTemplateContextRegistry() {
- return HTMLUIPlugin.getDefault().getTemplateContextRegistry();
- }
-
- protected Template[] getTemplates(String contextTypeId) {
- Template templates[] = null;
-
- TemplateStore store = getTemplateStore();
- if (store != null)
- templates = store.getTemplates(contextTypeId);
-
- return templates;
- }
-
- private TemplateStore getTemplateStore() {
- return HTMLUIPlugin.getDefault().getTemplateStore();
- }
-
- void setContextType(String contextTypeId) {
- fContextTypeId = contextTypeId;
- }
-}
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 d4512f2734..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
-
-/**
- *
- * @author pavery
- */
-public class NoRegionContentAssistProcessorForHTML extends NoRegionContentAssistProcessor {
- protected void initPartitionToProcessorMap() {
-
- super.initPartitionToProcessorMap();
- IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
- addPartitionProcessor(IHTMLPartitions.HTML_DEFAULT, htmlProcessor);
- addPartitionProcessor(IHTMLPartitions.HTML_COMMENT, htmlProcessor);
-
- IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
- addPartitionProcessor(IHTMLPartitions.SCRIPT, jsContentAssistProcessor);
-
- IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
- addPartitionProcessor(ICSSPartitions.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/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
deleted file mode 100644
index eef89629b9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateBuffer;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateException;
-
-/**
- * Just like DocumentTemplateContext except if an insert offset is passed in,
- * during evaluation, the "prefix" before the template will be checked to see
- * if it matches the template name. If so, overwrite the template name.
- * Otherwise, just insert the template at the insert offset location (by not
- * overwriting the prefix text)
- */
-public class ReplaceNameTemplateContext extends DocumentTemplateContext {
- private int fInsertOffset = -1;
-
- /**
- * Creates a document template context.
- *
- * @param type
- * the context type
- * @param document
- * the document this context applies to
- * @param offset
- * the offset of the document region
- * @param length
- * the length of the document region
- */
- public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
- this(type, document, new Position(offset, length));
- }
-
- /**
- * Creates a document template context. The supplied <code>Position</code>
- * will be queried to compute the <code>getStart</code> and
- * <code>getEnd</code> methods, which will therefore answer updated
- * position data if it is registered with the document.
- *
- * @param type
- * the context type
- * @param document
- * the document this context applies to
- * @param position
- * the position describing the area of the document which forms
- * the template context
- * @since 3.1
- */
- public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
- super(type, document, position);
- }
-
- /**
- * Creates a document template context.
- *
- * @param type
- * the context type
- * @param document
- * the document this context applies to
- * @param offset
- * the offset of the document region
- * @param length
- * the length of the document region
- * @param insertOffset
- * the offset of the document region where insert was
- * originally requested
- */
- public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
- this(type, document, new Position(offset, length));
- fInsertOffset = insertOffset;
- }
-
- /*
- * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
- */
- public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
- TemplateBuffer buffer = super.evaluate(template);
- if (buffer != null) {
- if (fInsertOffset > -1 && fInsertOffset > getStart()) {
- String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
- if (!template.getName().startsWith(prefix)) {
- // generate a new buffer that actually contains the
- // text that was going to be overwritten
- buffer = new TemplateBuffer(prefix + buffer.getString(), buffer.getVariables());
- }
- }
- }
- return buffer;
- }
-}
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 b6f9af7a02..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.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.ui.internal.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/contentoutline/HTMLNodeActionManager.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
deleted file mode 100644
index 6da4ce2451..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.contentoutline;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.html.core.internal.HTMLContentBuilder;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- *
- */
-public class HTMLNodeActionManager extends XMLNodeActionManager {
- protected int fTagCase;
- protected int 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;
- String one = fModel.getModelHandler().getAssociatedContentTypeId();
- String modelContentTypeId = fModel.getContentTypeIdentifier();
- if (one != modelContentTypeId) {
- System.out.println("not equal"); //$NON-NLS-1$
- }
- if (modelContentTypeId.equals(ContentTypeIdForHTML.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 == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fTagCase == HTMLCorePreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- if (fAttrCase == HTMLCorePreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fAttrCase == HTMLCorePreferenceNames.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 (fModel != null) {
- String modelContentTypeId = fModel.getContentTypeIdentifier();
- if (modelContentTypeId != null) {
- if (modelContentTypeId.equals(ContentTypeIdForHTML.ContentTypeID_HTML)) {
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences(); //$NON-NLS-1$
- fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
- }
- }
- }
- }
-
- public void reformat(Node newElement, boolean deep) {
- try {
- // tell the model that we are about to make a big model change
- fModel.aboutToChangeModel();
-
- // format selected node
- IStructuredFormatProcessor formatProcessor = new HTMLFormatProcessorImpl();
- formatProcessor.formatNode(newElement);
- }
- finally {
- // tell the model that we are done with the big model change
- fModel.changedModel();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
deleted file mode 100644
index 0881b05d14..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/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.internal.contentoutline;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.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 INodeAdapterFactory copy() {
- return new JFaceNodeAdapterFactoryForHTML(getAdapterKey(), isShouldRegisterAdapter());
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
deleted file mode 100644
index d38bcf4b72..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.contentoutline;
-
-
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-import org.w3c.dom.Node;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-public class JFaceNodeAdapterForHTML extends JFaceNodeAdapter {
-
- private Image createHTMLImage(String imageResourceName) {
- return HTMLEditorPluginImageHelper.getInstance().getImage(imageResourceName);
- }
-
- /**
- * Constructor for JFaceNodeAdapterForHTML.
- *
- * @param adapterFactory
- */
- public JFaceNodeAdapterForHTML(JFaceNodeAdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- protected Image createImage(Object object) {
- Image image = null;
-
- Node node = (Node) object;
- 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;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
deleted file mode 100644
index b5d028d59e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.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.html.ui.internal.contentproperties.ui;
-
-/**
- * @deprecated Not needed. See BUG118359
- */
-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/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
deleted file mode 100644
index 44f0bc560b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.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.internal.contentproperties.ui;
-
-import java.util.Iterator;
-
-/**
- * @deprecated Not needed. See BUG118359
- */
-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/internal/contentproperties/ui/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
deleted file mode 100644
index 375ad6b95e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.contentproperties.ui;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboList;
-
-/**
- * @deprecated This class only contains helper methods that you should
- * actually implement yourself.
- */
-public final class ContentSettingsRegistry {
-
- private static final String NONE = HTMLUIMessages.UI_none;
-
- 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/internal/contentproperties/ui/DeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
deleted file mode 100644
index 0be791b4e0..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.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.wst.html.ui.internal.contentproperties.ui;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients directly.
- * Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
- * </p>
- *
- * @deprecated Not needed. See BUG118359
- */
-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/internal/contentproperties/ui/DeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
deleted file mode 100644
index 8e7260b1cf..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.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.internal.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>
- *
- * @deprecated Not needed. See BUG118359
- */
-public interface DeviceProfileEntryProvider {
- public Iterator getDeviceProfileEntries();
-
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
deleted file mode 100644
index 6e5ad050f2..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.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.internal.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;
-
-/**
- * @deprecated Not needed. See BUG118359
- */
-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/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
deleted file mode 100644
index ec1fb0097a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.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.PlatformUI;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
-
-/**
- * @deprecated Use WebContentSettingsPropertyPage instead
- */
-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(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- 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();
- PlatformUI.getWorkbench().getHelpSystem().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(HTMLUIMessages.UI_Public_ID);
- 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(HTMLUIMessages.UI_System_ID);
- 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/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
deleted file mode 100644
index 5188e0572d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/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.internal.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.PlatformUI;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.internal.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.internal.contentproperties.ui.ContentSettingsPropertyPage;
-
-/**
- * @deprecated Use ProjectHTMLContentSettingsPropertyPage instead
- */
-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(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- 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();
- PlatformUI.getWorkbench().getHelpSystem().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(HTMLUIMessages.UI_Public_ID);
- 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(HTMLUIMessages.UI_System_ID);
- 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/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
deleted file mode 100644
index 6ccbe4cec4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectWebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-
-public class ProjectWebContentSettingsPropertyPage extends WebContentSettingsPropertyPage {
- public ProjectWebContentSettingsPropertyPage() {
- setDescription(HTMLUIMessages.ProjectWebContentSettingsPropertyPage_0);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
deleted file mode 100644
index 4bd999ca07..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/WebContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.contentproperties.ui;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentProperties;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.internal.contentproperties.HTMLContentProperties;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-public class WebContentSettingsPropertyPage extends PropertyPage {
- private static final String SELECT_NONE = HTMLUIMessages.UI_none;
- private String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
-
- private class ComboSelectionListener implements SelectionListener {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int index = fDocumentTypeCombo.getSelectionIndex();
- String doctype = (String) fDocumentTypeIds.get(index);
- updateDoctypeText(index, doctype);
- }
- }
-
- Combo fDocumentTypeCombo;
- List fDocumentTypeIds;
- private Text fPublicIdText;
- private Text fSystemIdText;
- private Combo fProfileCombo;
- private List fProfileIds;
- private SelectionListener fListener;
-
- public WebContentSettingsPropertyPage() {
- super();
- setDescription(HTMLUIMessages.WebContentSettingsPropertyPage_0);
- }
-
- private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Composite propertyPage = createComposite(parent, 2);
-
- createDoctypeContents(propertyPage);
- createCSSProfileContents(propertyPage);
-
- populateValues();
- initializeValues();
- computeMaxWidthHint();
-
- fListener = new ComboSelectionListener();
- fDocumentTypeCombo.addSelectionListener(fListener);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- return propertyPage;
- }
-
- private void createCSSProfileContents(Composite parent) {
- // CSS Profile
- Text languageLabel = new Text(parent, SWT.READ_ONLY);
- languageLabel.setText(HTMLUIMessages.UI_CSS_profile___2);
- fProfileCombo = new Combo(parent, SWT.READ_ONLY);
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fProfileCombo.setLayoutData(data);
- }
-
- private void createDoctypeContents(Composite parent) {
- // create description of implicit DOCTYPE
- Text doctypeLabel = new Text(parent, SWT.READ_ONLY);
- doctypeLabel.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- data.horizontalSpan = 2;
- doctypeLabel.setLayoutData(data);
-
- // document type
- Text languageLabel = new Text(parent, SWT.READ_ONLY);
- languageLabel.setText(HTMLUIMessages.UI_Default_HTML_DOCTYPE_ID___1);
- fDocumentTypeCombo = new Combo(parent, SWT.READ_ONLY);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fDocumentTypeCombo.setLayoutData(data);
-
- // public ID
- Text publicIdLabel = new Text(parent, SWT.READ_ONLY);
- publicIdLabel.setText(HTMLUIMessages.UI_Public_ID);
- fPublicIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fPublicIdText.setLayoutData(data);
-
- // system ID
- Text systemIdLabel = new Text(parent, SWT.READ_ONLY);
- systemIdLabel.setText(HTMLUIMessages.UI_System_ID);
- fSystemIdText = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
- data = new GridData(GridData.FILL, GridData.FILL, true, false);
- data.horizontalIndent = 0;
- fSystemIdText.setLayoutData(data);
-
- // create separator
- Label label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- data.verticalSpan = 8;
- label.setLayoutData(data);
- }
-
- /**
- * Get the resource this properties page is for
- *
- * @return IResource for this properties page or null if there is no
- * IResource
- */
- private IResource getResource() {
- IResource resource = null;
- if (getElement() instanceof IResource) {
- resource = (IResource) getElement();
- }
- return resource;
- }
-
- private 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;
- }
-
- private void initializeValues() {
- initializeDoctypeValues();
- initializeCSSProfileValues();
- }
-
- private void initializeCSSProfileValues() {
- int index = 0;
- String profile = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, getResource(), false);
- if (profile != null && profile.length() > 0) {
- /*
- * If item is already part of combo, select it. Otherwise, select
- * none.
- */
- index = fProfileIds.indexOf(profile);
- }
- index = index >= 0 ? index : 0;
- fProfileCombo.select(index);
- }
-
- private void initializeDoctypeValues() {
- int index = 0;
- String doctype = HTMLContentProperties.getProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), false);
- if (doctype != null && doctype.length() > 0) {
- /*
- * If item is already part of combo, select it. Otherwise, select
- * none.
- */
- index = fDocumentTypeIds.indexOf(doctype);
- }
-
- // set combobox
- index = index >= 0 ? index : 0;
- fDocumentTypeCombo.select(index);
-
- updateDoctypeText(index, doctype);
- }
-
- void updateDoctypeText(int index, String doctype) {
- if (index > 0) {
- // set public/system id text
- fPublicIdText.setText(doctype);
- String systemId = getSystemIdFrom(doctype);
- if (systemId != null)
- fSystemIdText.setText(systemId);
- else
- fSystemIdText.setText(""); //$NON-NLS-1$
- }
- else {
- // set public/system id text
- fPublicIdText.setText(""); //$NON-NLS-1$
- fSystemIdText.setText(""); //$NON-NLS-1$
- }
- }
-
- private void populateValues() {
- populateDoctypeValues();
- populateCSSProfileValues();
- }
-
- private void populateCSSProfileValues() {
- fProfileIds = new ArrayList();
- // add none first
- fProfileCombo.add(SELECT_NONE);
- fProfileIds.add(null);
-
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- fProfileCombo.add(name);
- fProfileIds.add(id);
- }
- }
-
- private void populateDoctypeValues() {
- fDocumentTypeIds = new ArrayList();
- // add none first
- fDocumentTypeCombo.add(SELECT_NONE);
- fDocumentTypeIds.add(null);
-
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- String publicId = entry.getPublicId();
- String displayName = entry.getDisplayName();
- displayName = displayName != null ? displayName : publicId;
-
- fDocumentTypeCombo.add(displayName);
- fDocumentTypeIds.add(publicId);
-
- if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length()) {
- maxLengthStringInHTMLDocumentTypeRegistry = displayName;
- }
-
- if (entry.getSystemId() == null)
- continue; // if HTML entry
-
-
- if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
- }
- }
-
- private void computeMaxWidthHint() {
- // maxLengthString was set populateDoctypeValues was called
- String maxLengthString = maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = fSystemIdText.getText();
- fSystemIdText.setText(maxLengthString);
- int maxWidthHint = fSystemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- fSystemIdText.setText(backup);
-
- if (fDocumentTypeCombo.getLayoutData() != null)
- ((GridData) fDocumentTypeCombo.getLayoutData()).widthHint = maxWidthHint;
- if (fPublicIdText.getLayoutData() != null)
- ((GridData) fPublicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (fSystemIdText.getLayoutData() != null)
- ((GridData) fSystemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (fProfileCombo.getLayoutData() != null)
- ((GridData) fProfileCombo.getLayoutData()).widthHint = maxWidthHint;
- }
-
- private void performCSSProfileDefaults() {
- int index = fProfileCombo.indexOf(SELECT_NONE);
- if (index > -1)
- fProfileCombo.select(index);
-
- super.performDefaults();
- }
-
- private boolean performCSSProfileOk() {
- int index = fProfileCombo.getSelectionIndex();
- if (index > -1) {
- String id = (String) fProfileIds.get(index);
- if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- id = null;
- }
- try {
- CSSContentProperties.setProperty(CSSContentProperties.CSS_PROFILE, getResource(), id);
- }
- catch (CoreException e) {
- // maybe in future, let user know there was a problem saving
- // file
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- return true;
- }
-
- protected void performDefaults() {
- super.performDefaults();
-
- performDoctypeDefaults();
- performCSSProfileDefaults();
- }
-
- private void performDoctypeDefaults() {
- fPublicIdText.setText("");//$NON-NLS-1$
- fSystemIdText.setText(""); //$NON-NLS-1$
- }
-
- private boolean performDoctypeOk() {
- int index = fDocumentTypeCombo.getSelectionIndex();
- if (index > -1) {
- String id = (String) fDocumentTypeIds.get(index);
- if (id == null || id.length() == 0 || id.equalsIgnoreCase(SELECT_NONE)) {
- // if none, use null
- id = null;
- }
- try {
- HTMLContentProperties.setProperty(HTMLContentProperties.DOCUMENT_TYPE, getResource(), id);
- }
- catch (CoreException e) {
- // maybe in future, let user know there was a problem saving
- // file
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- return true;
- }
-
- public boolean performOk() {
- performDoctypeOk();
- performCSSProfileOk();
-
- return super.performOk();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
deleted file mode 100644
index acc458abba..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*********************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.correction;
-
-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.source.ISourceViewer;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
-
-/**
- * Correction assistant for HTML
- */
-public class CorrectionAssistantProviderHTML extends CorrectionAssistantProvider {
-
- public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = null;
-
- if (sourceViewer != null) {
- ContentAssistant assistant = new ContentAssistant();
-
- if (sourceViewer != null) {
- IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
- assistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitions.HTML_DEFAULT);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI);
- assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET);
- }
- ca = assistant;
- }
-
- return ca;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
deleted file mode 100644
index c638fb1c5a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/derived/SingleCharReader.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*********************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-
-package org.eclipse.wst.html.ui.internal.derived;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/*
- * Copied from org.eclipse.jdt.internal.corext.javadoc.SingleCharReader.
- * Modification was made to fix statement unnecessarily nested within else
- * clause warning in read(..).
- */
-public abstract class SingleCharReader extends Reader {
-
- /**
- * @see Reader#read()
- */
- public abstract int read() throws IOException;
-
- /**
- * @see Reader#read(char[],int,int)
- */
- public int read(char cbuf[], int off, int len) throws IOException {
- int end = off + len;
- for (int i = off; i < end; i++) {
- int ch = read();
- if (ch == -1) {
- if (i == off) {
- return -1;
- }
- return i - off;
- }
- cbuf[i] = (char) ch;
- }
- return len;
- }
-
- /**
- * @see Reader#ready()
- */
- public boolean ready() throws IOException {
- return true;
- }
-
- /**
- * Gets the content as a String
- */
- public String getString() throws IOException {
- StringBuffer buf = new StringBuffer();
- int ch;
- while ((ch = read()) != -1) {
- buf.append((char) ch);
- }
- return buf.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
deleted file mode 100644
index 3e5870b8ef..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.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.edit.ui;
-
-import org.eclipse.wst.xml.ui.internal.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.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
-
- 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/internal/edit/ui/CleanupActionHTMLDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
deleted file mode 100644
index 4d553f8959..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.edit.ui;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-/**
- * Cleanup action delegate for HTML editor
- */
-public class CleanupActionHTMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
- private IEditorPart fEditor;
- private IStructuredCleanupProcessor fCleanupProcessor;
-
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- fEditor = targetEditor;
- }
-
- public void dispose() {
- // nulling out just in case
- fEditor = null;
- fCleanupProcessor = null;
- }
-
- public void init(IAction action) {
- if (action != null) {
- action.setText(HTMLUIMessages.CleanupDocument_label);
- action.setToolTipText(HTMLUIMessages.CleanupDocument_tooltip);
- action.setDescription(HTMLUIMessages.CleanupDocument_description);
- }
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void init(IViewPart view) {
- // do nothing
- }
-
- public void run(IAction action) {
- if (fEditor instanceof ITextEditor) {
- final ITextEditor editor = (ITextEditor) fEditor;
- CleanupDialogHTML cleanupDialog = new CleanupDialogHTML(editor.getSite().getShell());
- cleanupDialog.setisXHTMLType(isXHTML());
- if (cleanupDialog.open() == Window.OK) {
- // setup runnable
- Runnable runnable = new Runnable() {
- public void run() {
- IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor();
- if (cleanupProcessor != null) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null)
- cleanupProcessor.cleanupModel(model);
- }
- finally {
- if (model != null)
- model.releaseFromEdit();
- }
- }
- }
- };
-
- // TODO: make independent of 'model'.
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput()));
- if (model != null) {
- // begin recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
-
- // tell the model that we are about to make a big
- // model change
- model.aboutToChangeModel();
-
- // run
- BusyIndicator.showWhile(fEditor.getEditorSite().getWorkbenchWindow().getShell().getDisplay(), runnable);
- }
- }
- finally {
- if (model != null) {
- // tell the model that we are done with the big
- // model
- // change
- model.changedModel();
-
- // end recording
- ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
- model.endRecording(this, selection.getOffset(), selection.getLength());
- model.releaseFromEdit();
- }
- }
- }
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new HTMLCleanupProcessorImpl();
-
- return fCleanupProcessor;
- }
-
- private boolean isXHTML() {
- boolean isxhtml = false;
- if (fEditor instanceof ITextEditor) {
- ITextEditor textEditor = (ITextEditor) fEditor;
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (model instanceof IDOMModel) {
- IDOMDocument domDocument = ((IDOMModel) model).getDocument();
- if (domDocument != null)
- isxhtml = domDocument.isXMLType();
- }
- }
- finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- }
- return isxhtml;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
deleted file mode 100644
index af2526043c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.edit.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-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.PlatformUI;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-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 Preferences fPreferences = null;
- private boolean fIsXHTML = false;
- private Group fTagNameCase;
- private Group fAttrNameCase;
-
- public CleanupDialogHTML(Shell shell) {
- super(shell);
- }
-
- protected Control createDialogArea(Composite parent) {
- getShell().setText(HTMLUIMessages.Cleanup_UI_);
- Composite composite = new Composite(parent, SWT.NULL);
-
- createDialogAreaInComposite(composite);
- initializeOptions();
-
- return composite;
- }
-
- protected Control createButtonBar(Composite parent) {
- Control c = super.createButtonBar(parent);
- okButtonEnablement();
- return c;
- }
-
- protected void createDialogAreaInCompositeForHTML(Composite composite) {
- // Convert tag name case
- // d257064 need to associate group w/ radio buttons so radio buttons
- // header can be read
- fTagNameCase = new Group(composite, SWT.NONE);
- fTagNameCase.setText(HTMLUIMessages.Tag_name_case_for_HTML_UI_);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- fTagNameCase.setLayout(hLayout);
- fRadioButtonTagNameCaseAsis = new Button(fTagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseAsis.setText(HTMLUIMessages.Tag_name_case_As_is_UI_);
- fRadioButtonTagNameCaseAsis.addSelectionListener(this);
- fRadioButtonTagNameCaseLower = new Button(fTagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseLower.setText(HTMLUIMessages.Tag_name_case_Lower_UI_);
- fRadioButtonTagNameCaseLower.addSelectionListener(this);
- fRadioButtonTagNameCaseUpper = new Button(fTagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseUpper.setText(HTMLUIMessages.Tag_name_case_Upper_UI_);
- fRadioButtonTagNameCaseUpper.addSelectionListener(this);
-
- // Convert attr name case
- // d257064 need to associate group w/ radio buttons so radio buttons
- // header can be read
- fAttrNameCase = new Group(composite, SWT.NONE);
- fAttrNameCase.setText(HTMLUIMessages.Attribute_name_case_for_HTML_UI_);
- fAttrNameCase.setLayout(hLayout);
- fRadioButtonAttrNameCaseAsis = new Button(fAttrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseAsis.setText(HTMLUIMessages.Attribute_name_case_As_is_UI_);
- fRadioButtonAttrNameCaseAsis.addSelectionListener(this);
- fRadioButtonAttrNameCaseLower = new Button(fAttrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseLower.setText(HTMLUIMessages.Attribute_name_case_Lower_UI_);
- fRadioButtonAttrNameCaseLower.addSelectionListener(this);
- fRadioButtonAttrNameCaseUpper = new Button(fAttrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseUpper.setText(HTMLUIMessages.Attribute_name_case_Upper_UI_);
- fRadioButtonAttrNameCaseUpper.addSelectionListener(this);
- }
-
- protected void createDialogAreaInComposite(Composite composite) {
- createDialogAreaInCompositeForHTML(composite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.CLEANUP_HTML_HELPID); // use
- // HTML
- // 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(HTMLUIMessages.Insert_required_attributes_UI_);
- fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
-
- // Insert missing begin/end tags
- fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
- fCheckBoxInsertMissingTags.setText(HTMLUIMessages.Insert_missing_tags_UI_);
- fCheckBoxInsertMissingTags.addSelectionListener(this);
-
- // Quote attribute values
- fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
- fCheckBoxQuoteAttrValues.setText(HTMLUIMessages.Quote_attribute_values_UI_);
- fCheckBoxQuoteAttrValues.addSelectionListener(this);
-
- // Format source
- fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
- fCheckBoxFormatSource.setText(HTMLUIMessages.Format_source_UI_);
- fCheckBoxFormatSource.addSelectionListener(this);
-
- // Convert EOL code
- fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
- fCheckBoxConvertEOLCodes.setText(HTMLUIMessages.Convert_EOL_codes_UI_);
- 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(HTMLUIMessages.EOL_Windows_UI);
- fRadioButtonConvertEOLWindows.addSelectionListener(this);
- fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLUnix.setText(HTMLUIMessages.EOL_Unix_UI);
- fRadioButtonConvertEOLUnix.addSelectionListener(this);
- fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLMac.setText(HTMLUIMessages.EOL_Mac_UI);
- fRadioButtonConvertEOLMac.addSelectionListener(this);
- }
-
- protected void okPressed() {
- storeOptions();
-
- super.okPressed();
- }
-
- protected void initializeOptionsForHTML() {
- boolean caseSensitive = isXHTMLType();
-
- if (caseSensitive) {
- fRadioButtonTagNameCaseLower.setSelection(true);
- } else {
- int tagNameCase = getModelPreferences().getInt(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE);
- if (tagNameCase == HTMLCorePreferenceNames.UPPER) {
- fRadioButtonTagNameCaseUpper.setSelection(true);
- } else if (tagNameCase == HTMLCorePreferenceNames.LOWER)
- fRadioButtonTagNameCaseLower.setSelection(true);
- else
- fRadioButtonTagNameCaseAsis.setSelection(true);
- }
-
- if (caseSensitive) {
- fRadioButtonAttrNameCaseLower.setSelection(true);
- } else {
- int attrNameCase = getModelPreferences().getInt(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE);
- if (attrNameCase == HTMLCorePreferenceNames.UPPER) {
- fRadioButtonAttrNameCaseUpper.setSelection(true);
- } else if (attrNameCase == HTMLCorePreferenceNames.LOWER)
- fRadioButtonAttrNameCaseLower.setSelection(true);
- else
- fRadioButtonAttrNameCaseAsis.setSelection(true);
- }
-
- enableCaseControls(!caseSensitive);
- }
-
- protected void initializeOptions() {
- initializeOptionsForHTML();
-
- fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS));
- fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.INSERT_MISSING_TAGS));
- fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES));
- fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.FORMAT_SOURCE));
- fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(HTMLCorePreferenceNames.CONVERT_EOL_CODES));
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- String EOLCode = getModelPreferences().getString(HTMLCorePreferenceNames.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 (!isXHTMLType() && fRadioButtonTagNameCaseUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else if (fRadioButtonTagNameCaseLower.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_TAG_NAME_CASE, HTMLCorePreferenceNames.ASIS);
-
- if (!isXHTMLType() && fRadioButtonAttrNameCaseUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else if (fRadioButtonAttrNameCaseLower.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_ATTR_NAME_CASE, HTMLCorePreferenceNames.ASIS);
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- protected void storeOptions() {
- storeOptionsForHTML();
-
- getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
- getModelPreferences().setValue(HTMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
-
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- if (fRadioButtonConvertEOLUnix.getSelection()) {
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
- } else if (fRadioButtonConvertEOLMac.getSelection()) {
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
- } else {
- getModelPreferences().setValue(HTMLCorePreferenceNames.CLEANUP_EOL_CODE, 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) {
- if (e.widget == fCheckBoxConvertEOLCodes)
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
-
- okButtonEnablement();
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- private boolean isXHTMLType() {
- return fIsXHTML;
- }
-
- 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);
- }
- }
-
- /**
- * Enables/disables the tag/attr case radio buttons
- */
- private void enableCaseControls(boolean enable) {
- fTagNameCase.setEnabled(enable);
- fRadioButtonTagNameCaseAsis.setEnabled(enable);
- fRadioButtonTagNameCaseLower.setEnabled(enable);
- fRadioButtonTagNameCaseUpper.setEnabled(enable);
-
- fAttrNameCase.setEnabled(enable);
- fRadioButtonAttrNameCaseAsis.setEnabled(enable);
- fRadioButtonAttrNameCaseLower.setEnabled(enable);
- fRadioButtonAttrNameCaseUpper.setEnabled(enable);
- }
-
- /**
- * Enables/disables OK button
- *
- */
- private void okButtonEnablement() {
- boolean tagNameCaseCheck = ((fRadioButtonTagNameCaseUpper != null && fRadioButtonTagNameCaseUpper.getSelection()) || fRadioButtonTagNameCaseLower.getSelection());
- boolean attrNameCaseCheck = ((fRadioButtonAttrNameCaseUpper != null && fRadioButtonAttrNameCaseUpper.getSelection()) || fRadioButtonAttrNameCaseLower.getSelection());
- boolean eolCheck = fCheckBoxConvertEOLCodes.getSelection() && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection());
- boolean buttonEnabled = tagNameCaseCheck || attrNameCaseCheck || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || eolCheck;
- getButton(IDialogConstants.OK_ID).setEnabled(buttonEnabled);
- }
-
- void setisXHTMLType(boolean isXHTML) {
- fIsXHTML = isXHTML;
- }
-} \ 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 3e4863d336..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.internal.HTMLUIPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- */
-public class HTMLEditorPluginImageHelper {
- private final String PLUGINID = HTMLUIPlugin.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 ffc1e7d57c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.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.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_GENERIC = "icons/full/obj16/tag-generic.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_TEMPLATE = "icons/full/obj16/tag-template.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$
- public static final String IMG_WIZBAN_NEWHTMLFILE = "icons/full/wizban/newhfile_wiz.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 0afe5048b3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.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.editor;
-
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-
-/**
- * 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 = HTMLUIPlugin.ID + "."; //$NON-NLS-1$
-
- // // figured out on the fly
- // // HTML Source page editor
- // public static final String HTML_SOURCEVIEW_HELPID =
- // ContentTypeIdForHTML.ContentTypeID_HTML +"_source_HelpId";
- // //$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$
-
- // HTML New File Wizard - Template Page
- public static final String HTML_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "htmlw0010"; //$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/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 4bc2468d79..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * EditorInput for external files. Copied from
- * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
- */
-class ExternalFileEditorInput implements IPathEditorInput, ILocationProvider {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- /**
- * The workbench adapter which simply provides the label.
- *
- * @see Eclipse 3.1
- */
- private class WorkbenchAdapter implements IWorkbenchAdapter {
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return ((ExternalFileEditorInput) o).getName();
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
- }
-
- private File fFile;
- private WorkbenchAdapter fWorkbenchAdapter = new WorkbenchAdapter();
-
- public ExternalFileEditorInput(File file) {
- super();
- fFile = file;
- fWorkbenchAdapter = new WorkbenchAdapter();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return fFile.exists();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return fFile.getName();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fFile.getAbsolutePath();
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (ILocationProvider.class.equals(adapter))
- return this;
- if (IWorkbenchAdapter.class.equals(adapter))
- return fWorkbenchAdapter;
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
- */
- public IPath getPath(Object element) {
- if (element instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) element;
- return Path.fromOSString(input.fFile.getAbsolutePath());
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IPathEditorInput#getPath()
- * @since 3.1
- */
- public IPath getPath() {
- return Path.fromOSString(fFile.getAbsolutePath());
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o) {
- if (o == this)
- return true;
-
- if (o instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) o;
- return fFile.equals(input.fFile);
- }
-
- if (o instanceof IPathEditorInput) {
- IPathEditorInput input= (IPathEditorInput)o;
- return getPath().equals(input.getPath());
- }
-
- return false;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fFile.hashCode();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index 07b14ed0e1..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * Hyperlink for external files.
- */
-class ExternalFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fHyperlinkRegion;
- private File fHyperlinkFile;
-
- public ExternalFileHyperlink(IRegion region, File file) {
- fHyperlinkFile = file;
- fHyperlinkRegion = region;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public String getHyperlinkText() {
- return null;
- }
-
- public void open() {
- if (fHyperlinkFile != null) {
- IEditorInput input = new ExternalFileEditorInput(fHyperlinkFile);
- IEditorDescriptor descriptor;
- try {
- descriptor = IDE.getEditorDescriptor(input.getName(), true);
- if (descriptor != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, input, descriptor.getId(), true);
- }
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 8ee3ac1db0..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * Hyperlink for files within the workspace. (As long as there is an IFile,
- * this can be used) Opens the default editor for the file.
- */
-class WorkspaceFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fRegion;
- private IFile fFile;
- private IRegion fHighlightRange;
-
- public WorkspaceFileHyperlink(IRegion region, IFile file) {
- fRegion = region;
- fFile = file;
- }
-
- public WorkspaceFileHyperlink(IRegion region, IFile file, IRegion range) {
- fRegion = region;
- fFile = file;
- fHighlightRange = range;
- }
-
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- if (fFile != null && fFile.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, fFile, true);
- // highlight range in editor if possible
- if (fHighlightRange != null && editor instanceof ITextEditor) {
- ((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
- }
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index c4be166338..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,503 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- *
- */
-public class XMLHyperlinkDetector implements IHyperlinkDetector {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
- private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
- private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
- private final String XMLNS = "xmlns"; //$NON-NLS-1$
- private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- /**
- * Create the appropriate hyperlink
- *
- * @param uriString
- * @param hyperlinkRegion
- * @return IHyperlink
- */
- private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
- IHyperlink link = null;
-
- if (isHttp(uriString)) {
- link = new URLHyperlink(hyperlinkRegion, uriString);
- }
- else {
- // try to locate the file in the workspace
- File systemFile = getFileFromUriString(uriString);
- if (systemFile != null) {
- String systemPath = systemFile.getPath();
- IFile file = getFile(systemPath);
- if (file != null) {
- // this is a WorkspaceFileHyperlink since file exists in
- // workspace
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- }
- else {
- // this is an ExternalFileHyperlink since file does not
- // exist in workspace
- link = new ExternalFileHyperlink(hyperlinkRegion, systemFile);
- }
- }
- }
- return link;
- }
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- // for now, only capable of creating 1 hyperlink
- List hyperlinks = new ArrayList(0);
-
- if (region != null && textViewer != null) {
- IDocument document = textViewer.getDocument();
- Node currentNode = getCurrentNode(document, region.getOffset());
- if (currentNode != null) {
- String uriString = null;
- if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- // doctype nodes
- uriString = getURIString(currentNode, document);
- }
- else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
- // element nodes
- Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
- if (currentAttr != null) {
- // try to find link for current attribute
- // resolve attribute value
- uriString = getURIString(currentAttr, document);
- // verify validity of uri string
- if (uriString == null || !isValidURI(uriString))
- // reset current attribute
- currentAttr = null;
- }
- if (currentAttr == null) {
- // try to find a linkable attribute within element
- currentAttr = getLinkableAttr((Element) currentNode);
- if (currentAttr != null) {
- uriString = getURIString(currentAttr, document);
- }
- }
- currentNode = currentAttr;
- }
- // try to create hyperlink from information gathered
- if (uriString != null && currentNode != null && isValidURI(uriString)) {
- IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
- IHyperlink hyperlink = createHyperlink(uriString, hyperlinkRegion, document, currentNode);
- if (hyperlink != null) {
- hyperlinks.add(hyperlink);
- }
- }
- }
- }
- if (hyperlinks.size() == 0)
- return null;
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Get the base location from the current model (local file system)
- */
- private String getBaseLocation(IDocument document) {
- String baseLoc = null;
-
- // get the base location from the current model
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- IPath location = new Path(sModel.getBaseLocation());
- if (location.toFile().exists()) {
- baseLoc = location.toString();
- }
- else {
- if (location.segmentCount() > 1)
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(location).getLocation().toString();
- else
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(location).toString();
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return baseLoc;
- }
-
- /**
- * Get the CMElementDeclaration for an element
- *
- * @param element
- * @return CMElementDeclaration
- */
- private CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration ed = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- ed = mq.getCMElementDeclaration(element);
- }
- return ed;
- }
-
- /**
- * Returns the attribute node within node at offset
- *
- * @param node
- * @param offset
- * @return Attr
- */
- private Attr getCurrentAttrNode(Node node, int offset) {
- if ((node instanceof IndexedRegion) && ((IndexedRegion) node).contains(offset) && (node.hasAttributes())) {
- NamedNodeMap attrs = node.getAttributes();
- // go through each attribute in node and if attribute contains
- // offset, return that attribute
- for (int i = 0; i < attrs.getLength(); ++i) {
- // assumption that if parent node is of type IndexedRegion,
- // then its attributes will also be of type IndexedRegion
- IndexedRegion attRegion = (IndexedRegion) attrs.item(i);
- if (attRegion.contains(offset)) {
- return (Attr) attrs.item(i);
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null)
- inode = sModel.getIndexedRegion(offset - 1);
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- if (inode instanceof Node) {
- return (Node) inode;
- }
- return null;
- }
-
- /**
- * Returns an IFile from the given uri if possible, null if cannot find
- * file from uri.
- *
- * @param fileString
- * file system path
- * @return returns IFile if fileString exists in the workspace
- */
- private IFile getFile(String fileString) {
- IFile file = null;
-
- if (fileString != null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
- for (int i = 0; i < files.length && file == null; i++)
- if (files[i].exists())
- file = files[i];
- }
-
- return file;
- }
-
- /**
- * Create a file from the given uri string
- *
- * @param uriString -
- * assumes uriString is not http://
- * @return File created from uriString if possible, null otherwise
- */
- private File getFileFromUriString(String uriString) {
- File file = null;
- try {
- // first just try to create a file directly from uriString as
- // default in case create file from uri does not work
- file = new File(uriString);
-
- // try to create file from uri
- URI uri = new URI(uriString);
- file = new File(uri);
- }
- catch (Exception e) {
- // if exception is thrown while trying to create File just ignore
- // and file will be null
- }
- return file;
- }
-
- private IRegion getHyperlinkRegion(Node node) {
- IRegion hyperRegion = null;
-
- if (node != null) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- ITextRegion valueRegion = att.getValueRegion();
- if (valueRegion != null) {
- int regLength = valueRegion.getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue)) {
- ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- }
- return hyperRegion;
- }
-
- /**
- * Attempts to find an attribute within element that is openable.
- *
- * @param element -
- * cannot be null
- * @return Attr attribute that can be used for open on, null if no
- * attribute could be found
- */
- private Attr getLinkableAttr(Element element) {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- // get the list of attributes for this node
- NamedNodeMap attrs = element.getAttributes();
- for (int i = 0; i < attrs.getLength(); ++i) {
- // check if this attribute is "openOn-able"
- Attr att = (Attr) attrs.item(i);
- if (isLinkableAttr(att, ed)) {
- return att;
- }
- }
- return null;
- }
-
- /**
- * Find the location hint for the given namespaceURI if it exists
- *
- * @param elementNode -
- * cannot be null
- * @param namespaceURI -
- * cannot be null
- * @return location hint (systemId) if it was found, null otherwise
- */
- private String getLocationHint(Element elementNode, String namespaceURI) {
- Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
- if (schemaLocNode != null) {
- StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
- while (st.hasMoreTokens()) {
- String publicId = st.hasMoreTokens() ? st.nextToken() : null;
- String systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // found location hint
- if (namespaceURI.equalsIgnoreCase(publicId))
- return systemId;
- }
- }
- return null;
- }
-
- /**
- * Returns the URI string
- *
- * @param node -
- * assumes not null
- */
- private String getURIString(Node node, IDocument document) {
- String resolvedURI = null;
- // need the base location, publicId, and systemId for URIResolver
- String baseLoc = null;
- String publicId = null;
- String systemId = null;
-
- short nodeType = node.getNodeType();
- // handle doc type node
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- baseLoc = getBaseLocation(document);
- publicId = ((DocumentType) node).getPublicId();
- systemId = ((DocumentType) node).getSystemId();
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute node
- Attr attrNode = (Attr) node;
- String attrName = attrNode.getName();
- String attrValue = attrNode.getValue();
- attrValue = StringUtils.strip(attrValue);
- if (attrValue != null && attrValue.length() > 0) {
- baseLoc = getBaseLocation(document);
-
- // handle schemaLocation attribute
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- publicId = attrValue;
- systemId = getLocationHint(attrNode.getOwnerElement(), publicId);
- if (systemId == null) {
- systemId = attrValue;
- }
- }
- else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
- // for now just use the first pair
- // need to look into being more precise
- StringTokenizer st = new StringTokenizer(attrValue);
- publicId = st.hasMoreTokens() ? st.nextToken() : null;
- systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // else check if xmlns publicId = value
- }
- else {
- systemId = attrValue;
- }
- }
- }
-
- resolvedURI = resolveURI(baseLoc, publicId, systemId);
- return resolvedURI;
- }
-
- /**
- * Returns true if this uriString is an http string
- *
- * @param uriString
- * @return true if uriString is http string, false otherwise
- */
- private boolean isHttp(String uriString) {
- boolean isHttp = false;
- if (uriString != null) {
- String tempString = uriString.toLowerCase();
- if (tempString.startsWith(HTTP_PROTOCOL))
- isHttp = true;
- }
- return isHttp;
- }
-
- /**
- * Checks to see if the given attribute is openable. Attribute is openable
- * if it is a namespace declaration attribute or if the attribute value is
- * of type URI.
- *
- * @param attr
- * cannot be null
- * @param cmElement
- * CMElementDeclaration associated with the attribute (can be
- * null)
- * @return true if this attribute is "openOn-able" false otherwise
- */
- private boolean isLinkableAttr(Attr attr, CMElementDeclaration cmElement) {
- String attrName = attr.getName();
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- // determine if attribute is namespace declaration
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName)))
- return true;
-
- // determine if attribute contains schema location
- if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attr))) && ((SCHEMA_LOCATION.equals(unprefixedName)) || (NO_NAMESPACE_SCHEMA_LOCATION.equals(unprefixedName))))
- return true;
-
- // determine if attribute value is of type URI
- if (cmElement != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) cmElement.getAttributes().getNamedItem(attrName);
- if ((attrDecl != null) && (attrDecl.getAttrType() != null) && (CMDataType.URI.equals(attrDecl.getAttrType().getDataTypeName()))) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Checks whether the given uriString is really pointing to a file
- *
- * @param uriString
- * @return boolean
- */
- private boolean isValidURI(String uriString) {
- boolean isValid = false;
-
- if (isHttp(uriString))
- isValid = true;
- else {
- File file = getFileFromUriString(uriString);
- if (file != null)
- isValid = file.isFile();
- }
- return isValid;
- }
-
- /**
- * Resolves the given URI information
- *
- * @param baseLocation
- * @param publicId
- * @param systemId
- * @return String resolved uri.
- */
- private String resolveURI(String baseLocation, String publicId, String systemId) {
- // dont resolve if there's nothing to resolve
- if ((baseLocation == null) && (publicId == null) && (systemId == null))
- return null;
- return URIResolverPlugin.createResolver().resolve(baseLocation, publicId, systemId);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
deleted file mode 100644
index 36fee03b09..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.eclipse.wst.html.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Sets default values for HTML UI preferences
- */
-public class HTMLUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = HTMLUIPlugin.getDefault().getPreferenceStore();
-
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE, true);
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<");//$NON-NLS-1$
-
- // HTML Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-
- styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
- store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
-
- styleValue = ColorHelper.getColorString(128, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 95) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
-
- styleValue = ColorHelper.getColorString(191, 95, 63) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
-
- // set default new html file template to use in new file wizard
- /*
- * Need to find template name that goes with default template id (name
- * may change for differnt language)
- */
- String templateName = ""; //$NON-NLS-1$
- Template template = HTMLUIPlugin.getDefault().getTemplateStore().findTemplateById("org.eclipse.wst.html.ui.templates.html"); //$NON-NLS-1$
- if (template != null)
- templateName = template.getName();
- store.setDefault(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
deleted file mode 100644
index b4fc96894d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.preferences;
-
-/**
- * Preference keys for HTML UI
- */
-public class HTMLUIPreferenceNames {
- /**
- * A named preference that controls if code assist gets auto activated.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String AUTO_PROPOSE = getAutoProposeKey();
-
- private static String getAutoProposeKey() {
- return "autoPropose";//$NON-NLS-1$
- }
-
- /**
- * A named preference that holds the characters that auto activate code
- * assist.
- * <p>
- * Value is of type <code>String</code>. All characters that trigger
- * auto code assist.
- * </p>
- */
- public static final String AUTO_PROPOSE_CODE = getAutoProposeCodeKey();
-
- private static String getAutoProposeCodeKey() {
- return "autoProposeCode";//$NON-NLS-1$
- }
-
- /**
- * The key to store customized templates.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String TEMPLATES_KEY = getTemplatesKey();
-
- private static String getTemplatesKey() {
- return "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
- }
-
- /**
- * The key to store the last template name used in new HTML file wizard.
- * Template name is stored instead of template id because user-created
- * templates do not have template ids.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String NEW_FILE_TEMPLATE_NAME = "newFileTemplateName"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
deleted file mode 100644
index e3b463157e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.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.html.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-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.internal.preferences.ui.StyledTextColorPicker;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage;
-
-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, (String)i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- public String getSampleText() {
- return HTMLUIMessages.Sample_HTML_doc;
-
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
-
- initCommonContextStyleMap(contextStyleMap);
- initDocTypeContextStyleMap(contextStyleMap);
- // FIXME: these were "brute forced" commented out when moving XMLJSPRegionContexts
- // effect is unknown, but thought just to effect preference page
- //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) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForHTML.ContentTypeID_HTML).getParser());
-
- // 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);
-
- // 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);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
- return c;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- HTMLUIPlugin.getDefault().savePluginPreferences();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
deleted file mode 100644
index 165153b2e5..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.preferences.WorkbenchDefaultEncodingSettings;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
-
-public class HTMLFilesPreferencePage extends XMLFilesPreferencePage {
- private WorkbenchDefaultEncodingSettings fInputEncodingSettings = null;
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- 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);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(scrolledComposite, IHelpContextIds.HTML_PREFWEBX_FILES_HELPID);
-
- setSize(scrolledComposite);
- loadPreferences();
-
- return scrolledComposite;
- }
-
- protected void createContentsForLoadingGroup(Composite parent) {
- Group group = createGroup(parent, 1);
- group.setText(HTMLUIMessages.HTMLFilesPreferencePage_0);
-
- fInputEncodingSettings = new WorkbenchDefaultEncodingSettings(group);
- }
-
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
- }
-
- 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);
- }
-
- protected void storeValues() {
- super.storeValues();
- storeValuesForLoadingGroup();
- }
-
- protected void storeValuesForLoadingGroup() {
- getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
- }
-
- protected void createContentsForCreatingGroup(Composite parent) {
- super.createContentsForCreatingGroup(parent);
- // Group creatingGroup = createGroup(parent, 2);
- // creatingGroup.setText(HTMLUIMessages.Creating_files);
- //
- // // Encoding..
- // Label label = createLabel(creatingGroup,
- // HTMLUIMessages.Encoding_desc);
- // ((GridData)label.getLayoutData()).horizontalSpan = 2;
- // fEncodingSettings = new EncodingSettings(creatingGroup);
- // ((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
deleted file mode 100644
index b055458787..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-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.PlatformUI;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.xml.ui.internal.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(HTMLUIMessages.Preferred_markup_case_UI_);
-
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group tagNameGroup = createGroup(caseGroup, 1);
- tagNameGroup.setText(HTMLUIMessages.Tag_names__UI_);
- fTagNameUpper = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Upper_case_UI_);
- fTagNameLower = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Lower_case_UI_);
-
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group attrNameGroup = createGroup(caseGroup, 1);
- attrNameGroup.setText(HTMLUIMessages.Attribute_names__UI_);
- fAttrNameUpper = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Upper_case_UI_);
- fAttrNameLower = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Lower_case_UI_);
-
- return parent;
-
- }
-
- protected void performDefaults() {
- fTagNameUpper.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getDefaultInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
-
- super.performDefaults();
- }
-
- protected void initializeValues() {
- fTagNameUpper.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.TAG_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE) == HTMLCorePreferenceNames.LOWER);
-
- super.initializeValues();
- }
-
- protected void storeValues() {
- if (fTagNameUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.TAG_NAME_CASE, HTMLCorePreferenceNames.LOWER);
- if (fAttrNameUpper.getSelection())
- getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.UPPER);
- else
- getModelPreferences().setValue(HTMLCorePreferenceNames.ATTR_NAME_CASE, HTMLCorePreferenceNames.LOWER);
-
- super.storeValues();
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- HTMLUIPlugin.getDefault().savePluginPreferences(); // UI
- HTMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().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/internal/preferences/ui/HTMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
deleted file mode 100644
index 2bf1f90202..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.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.preferences.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-
-/**
- * Preference page for HTML templates
- */
-public class HTMLTemplatePreferencePage extends TemplatePreferencePage {
-
- public HTMLTemplatePreferencePage() {
- HTMLUIPlugin htmlEditorPlugin = HTMLUIPlugin.getDefault();
-
- 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();
- HTMLUIPlugin.getDefault().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);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IHelpContextIds.HTML_PREFWEBX_TEMPLATES_HELPID);
- return c;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
deleted file mode 100644
index f4cd52cd76..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-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.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-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.MessageBox;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-import org.eclipse.wst.validation.internal.ui.ValidateAction;
-import org.eclipse.wst.validation.internal.ui.ValidationUIMessages;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class HTMLValidationPreferencePage extends AbstractPreferencePage {
-
- private static final int[] SEVERITIES = {ValidationMessage.ERROR, ValidationMessage.WARNING, ValidationMessage.IGNORE};
-
- private List fCombos;
- private SelectionListener fSelectionListener;
-
- private IPreferencesService fPreferencesService = null;
-
- private IScopeContext[] fScopeContext = null;
-
- private class ComboData {
- private String fKey;
- private int[] fSeverities;
- private int fIndex;
- int originalSeverity = -2;
-
- public ComboData(String key, int[] severities, int index) {
- fKey = key;
- fSeverities = severities;
- fIndex = index;
- }
-
- public String getKey() {
- return fKey;
- }
-
- public void setIndex(int index) {
- fIndex = index;
- }
-
- public int getIndex() {
- return fIndex;
- }
-
- /**
- * Sets the severity index based on <code>severity</code>.
- * If the severity doesn't exist, the index is set to -1.
- *
- * @param severity the severity level
- */
- public void setSeverity(int severity) {
- for(int i = 0; fSeverities != null && i < fSeverities.length; i++) {
- if(fSeverities[i] == severity) {
- fIndex = i;
- return;
- }
- }
-
- fIndex = -1;
- }
-
- public int getSeverity() {
- return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
- }
-
- boolean isChanged() {
- return fSeverities[fIndex] != originalSeverity;
- }
- }
-
- public HTMLValidationPreferencePage() {
- super();
- fCombos = new ArrayList();
- fPreferencesService = Platform.getPreferencesService();
- }
-
- protected Control createContents(Composite parent) {
- final Composite page = new Composite(parent, SWT.NULL);
-
- //GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- page.setLayout(layout);
-
- final Composite content = createValidationSection(page);
-
- GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true);
- content.setLayoutData(gridData);
-
- return page;
- }
-
- private Composite createValidationSection(Composite page) {
- int nColumns = 3;
- new Label(page, SWT.NONE).setText(HTMLUIMessages.Validation_description);
-
- Group validationGroup = createGroup(page, nColumns);
- validationGroup.setText(HTMLUIMessages.Label_Elements);
-
- String[] errorWarningIgnoreLabel = new String[] { HTMLUIMessages.Validation_Error, HTMLUIMessages.Validation_Warning, HTMLUIMessages.Validation_Ignore };
-
- addComboBox(validationGroup, HTMLUIMessages.Validation_Missing_Start_Tag, HTMLCorePreferenceNames.ELEM_MISSING_START, SEVERITIES, errorWarningIgnoreLabel, 0);
- addComboBox(validationGroup, HTMLUIMessages.Validation_Missing_End_Tag, HTMLCorePreferenceNames.ELEM_MISSING_END, SEVERITIES, errorWarningIgnoreLabel, 0);
-
- return page;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#performOk()
- */
- public boolean performOk() {
- if(super.performOk() && shouldRevalidateOnSettingsChange()) {
- MessageBox mb = new MessageBox(this.getShell(), SWT.APPLICATION_MODAL | SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_INFORMATION | SWT.RIGHT);
- mb.setText(HTMLUIMessages.Validation_Title);
- /* Choose which message to use based on if its project or workspace settings */
- mb.setMessage(HTMLUIMessages.Validation_Workspace);
- switch(mb.open()) {
- case SWT.CANCEL:
- return false;
- case SWT.YES:
- Job validationJob = new Job(ValidationUIMessages.RunValidationDialogTitle) {
-
- protected IStatus run(IProgressMonitor monitor) {
- ValidateAction vaction = new ValidateAction();
- vaction.selectionChanged(new StructuredSelection(ResourcesPlugin.getWorkspace().getRoot().getProjects()));
- vaction.run();
- return Status.OK_STATUS;
- }
-
- };
- validationJob.schedule();
- case SWT.NO:
- default:
- return true;
- }
- }
- return true;
- }
-
- protected boolean shouldRevalidateOnSettingsChange() {
- Iterator it = fCombos.iterator();
-
- while (it.hasNext()) {
- ComboData data = (ComboData) ((Combo) it.next()).getData();
- if (data.isChanged())
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- resetSeverities();
- super.performDefaults();
- }
-
- protected void resetSeverities() {
- IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
- for(int i = 0; i < fCombos.size(); i++) {
- ComboData data = (ComboData)((Combo)fCombos.get(i)).getData();
- int severity = defaultContext.getInt(data.getKey(), ValidationMessage.WARNING);
- data.setSeverity(severity);
- ((Combo)fCombos.get(i)).select(data.getIndex());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- public void dispose() {
- super.dispose();
- }
-
- protected String getPreferenceNodeQualifier() {
- return HTMLCorePlugin.getDefault().getBundle().getSymbolicName();
- }
-
- protected Combo addComboBox(Composite parent, String label, String key, int[] values, String[] valueLabels, int indent) {
- GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
- gd.horizontalIndent= indent;
-
- Label labelControl= new Label(parent, SWT.LEFT);
- labelControl.setFont(JFaceResources.getDialogFont());
- labelControl.setText(label);
- labelControl.setLayoutData(gd);
-
- Combo comboBox= newComboControl(parent, key, values, valueLabels);
- comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- return comboBox;
- }
-
- /**
- * Creates a combo box and associates the combo data with the
- * combo box.
- *
- * @param composite the composite to create the combo box in
- * @param key the unique key to identify the combo box
- * @param values the values represented by the combo options
- * @param valueLabels the values displayed in the combo box
- *
- * @return the generated combo box
- */
- protected Combo newComboControl(Composite composite, String key, int[] values, String[] valueLabels) {
- ComboData data = new ComboData(key, values, -1);
-
- Combo comboBox= new Combo(composite, SWT.READ_ONLY);
- comboBox.setItems(valueLabels);
- comboBox.setData(data);
- comboBox.addSelectionListener(getSelectionListener());
- comboBox.setFont(JFaceResources.getDialogFont());
-
- int severity = -1;
- if (key != null)
- severity = fPreferencesService.getInt(getPreferenceNodeQualifier(), key, ValidationMessage.WARNING, createPreferenceScopes());
-
- if (severity == ValidationMessage.ERROR || severity == ValidationMessage.WARNING || severity == ValidationMessage.IGNORE) {
- data.setSeverity(severity);
- data.originalSeverity = severity;
- }
-
- if(data.getIndex() >= 0)
- comboBox.select(data.getIndex());
-
- fCombos.add(comboBox);
- return comboBox;
- }
-
- protected SelectionListener getSelectionListener() {
- if (fSelectionListener == null) {
- fSelectionListener= new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- controlChanged(e.widget);
- }
- };
- }
- return fSelectionListener;
- }
-
- protected IScopeContext[] createPreferenceScopes() {
- if (fScopeContext == null)
- fScopeContext = new IScopeContext[]{new InstanceScope(), new DefaultScope()};
- return fScopeContext;
- }
-
- protected void controlChanged(Widget widget) {
- ComboData data= (ComboData) widget.getData();
- if (widget instanceof Combo) {
- data.setIndex(((Combo)widget).getSelectionIndex());
- } else {
- return;
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#storeValues()
- */
- protected void storeValues() {
- if(fCombos == null || fCombos.size() == 0)
- return;
-
- Iterator it = fCombos.iterator();
-
- IScopeContext[] contexts = createPreferenceScopes();
-
- while (it.hasNext()) {
- ComboData data = (ComboData) ((Combo)it.next()).getData();
- if (data.getKey() != null)
- contexts[0].getNode(getPreferenceNodeQualifier()).putInt(data.getKey(), data.getSeverity());
- }
-
- for (int i = 0; i < contexts.length; i++) {
- try {
- contexts[i].getNode(getPreferenceNodeQualifier()).flush();
- }
- catch (BackingStoreException e) {
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java
deleted file mode 100644
index 2273bb7462..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionAnnotationModelChanges.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.w3c.dom.Node;
-
-/**
- * Contains a set of projection model additions/deletions/modifications
- */
-class ProjectionAnnotationModelChanges {
- // copies of this class located in:
- // org.eclipse.wst.xml.ui.internal.projection
- // org.eclipse.wst.css.ui.internal.projection
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
- private Node fNode;
- private Annotation[] fDeletions;
- private Map fAdditions;
- private Annotation[] fModifications;
-
- public ProjectionAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
- fNode = node;
- fDeletions = deletions;
- fAdditions = additions;
- fModifications = modifications;
- }
-
- public Map getAdditions() {
- return fAdditions;
- }
-
- public Annotation[] getDeletions() {
- return fDeletions;
- }
-
- public Annotation[] getModifications() {
- return fModifications;
- }
-
- public Node getNode() {
- return fNode;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index 32c7a35c5a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- /**
- * List of projection viewers currently associated with this projection
- * model node adapter factory.
- */
- private HashMap fProjectionViewers;
-
- public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- public ProjectionModelNodeAdapterFactoryHTML(Object adapterKey) {
- super(adapterKey);
- }
-
- public ProjectionModelNodeAdapterFactoryHTML() {
- this(ProjectionModelNodeAdapterHTML.class);
- }
-
- /**
- * Actually creates an adapter for the parent of target if target is the
- * "adapt-able" node
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if ((isActive()) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
- Node node = (Node) target;
- if (isNodeProjectable(node)) {
-
- // actually work with the parent node to listen for add,
- // delete events
- Node parent = node.getParentNode();
- if (parent instanceof INodeNotifier) {
- INodeNotifier parentNotifier = (INodeNotifier) parent;
- ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (parentAdapter == null) {
- // create a new adapter for parent
- parentAdapter = new ProjectionModelNodeAdapterHTML(this);
- parentNotifier.addAdapter(parentAdapter);
- }
- // call update on parent because a new node has just been
- // added
- parentAdapter.updateAdapter(parent);
- }
- }
- }
-
- return null;
- }
-
- /**
- * Returns true if node is a node type able to fold
- *
- * @param node
- * @return boolean true if node is projectable, false otherwise
- */
- boolean isNodeProjectable(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String tagName = node.getNodeName();
- // node is only projectable if it is head, body, script, style,
- // table, ul, ol tags
- if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.UL.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.OL.equalsIgnoreCase(tagName))
- return true;
- }
- return false;
- }
-
- /**
- * Return true if this factory is currently actively managing projection
- *
- * @return
- */
- boolean isActive() {
- return (fProjectionViewers != null && !fProjectionViewers.isEmpty());
- }
-
- /**
- * Updates projection annotation model if document is not in flux.
- * Otherwise, queues up the changes to be applied when document is ready.
- *
- * @param node
- * @param deletions
- * @param additions
- * @param modifications
- */
- void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications) {
- queueAnnotationModelChanges(node, deletions, additions, modifications, null);
- }
-
- /**
- * Updates projection annotation model for a specific projection viewer if
- * document is not in flux. Otherwise, queues up the changes to be applied
- * when document is ready.
- *
- * @param node
- * @param deletions
- * @param additions
- * @param modifications
- * @param viewer
- */
- void queueAnnotationModelChanges(Node node, Annotation[] deletions, Map additions, Annotation[] modifications, ProjectionViewer viewer) {
- // create a change object for latest change and add to queue
- ProjectionAnnotationModelChanges newChange = new ProjectionAnnotationModelChanges(node, deletions, additions, modifications);
- if (fProjectionViewers != null) {
- if (viewer != null) {
- ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.get(viewer);
- if (info != null) {
- info.queueAnnotationModelChanges(newChange);
- }
- }
- else {
- Iterator infos = fProjectionViewers.values().iterator();
- while (infos.hasNext()) {
- ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
- info.queueAnnotationModelChanges(newChange);
- }
- }
- }
- }
-
- public void release() {
- // go through every projectionviewer and call
- // removeProjectionViewer(viewer);
- if (fProjectionViewers != null) {
- Iterator infos = fProjectionViewers.values().iterator();
- while (infos.hasNext()) {
- ProjectionViewerInformation info = (ProjectionViewerInformation) infos.next();
- info.dispose();
- infos.remove();
- }
- fProjectionViewers = null;
- }
- super.release();
- }
-
- /**
- * Adds viewer to list of projection viewers this factory is associated
- * with
- *
- * @param viewer -
- * assumes viewer's document and projection annotation model
- * are not null
- */
- void addProjectionViewer(ProjectionViewer viewer) {
- // remove old entry if it exists
- removeProjectionViewer(viewer);
-
- if (fProjectionViewers == null) {
- fProjectionViewers = new HashMap();
- }
-
- // create new object containing projection viewer and its info
- ProjectionViewerInformation info = new ProjectionViewerInformation(viewer);
- fProjectionViewers.put(viewer, info);
- info.initialize();
- }
-
- /**
- * Removes the given viewer from the list of projection viewers this
- * factor is associated with
- *
- * @param viewer
- */
- void removeProjectionViewer(ProjectionViewer viewer) {
- if (fProjectionViewers != null) {
- // remove entry from list of viewers
- ProjectionViewerInformation info = (ProjectionViewerInformation) fProjectionViewers.remove(viewer);
- if (info != null) {
- info.dispose();
- }
- // if removing last projection viewer, clear out everything
- if (fProjectionViewers.isEmpty()) {
- fProjectionViewers = null;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index 6544f7aeed..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
- private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private class TagProjectionAnnotation extends ProjectionAnnotation {
- private boolean fIsVisible = false; /* workaround for BUG85874 */
- private Node fNode;
-
- public TagProjectionAnnotation(Node node, boolean isCollapsed) {
- super(isCollapsed);
- fNode = node;
- }
-
- public Node getNode() {
- return fNode;
- }
-
- public void setNode(Node node) {
- fNode = node;
- }
-
- /**
- * Does not paint hidden annotations. Annotations are hidden when they
- * only span one line.
- *
- * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
- * org.eclipse.swt.widgets.Canvas,
- * org.eclipse.swt.graphics.Rectangle)
- */
- public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
- /* workaround for BUG85874 */
- /*
- * only need to check annotations that are expanded because hidden
- * annotations should never have been given the chance to
- * collapse.
- */
- if (!isCollapsed()) {
- // working with rectangle, so line height
- FontMetrics metrics = gc.getFontMetrics();
- if (metrics != null) {
- // do not draw annotations that only span one line and
- // mark them as not visible
- if ((rectangle.height / metrics.getHeight()) <= 1) {
- fIsVisible = false;
- return;
- }
- }
- }
- fIsVisible = true;
- super.paint(gc, canvas, rectangle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
- */
- public void markCollapsed() {
- /* workaround for BUG85874 */
- // do not mark collapsed if annotation is not visible
- if (fIsVisible)
- super.markCollapsed();
- }
- }
-
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
- private Map fTagAnnotations = new HashMap();
-
- public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
- fAdapterFactory = factory;
- }
-
- /**
- * Create a projection position from the given node. Able to get
- * projection position if node isNodeProjectable.
- *
- * @param node
- * @return null if no projection position possible, a Position otherwise
- */
- private Position createProjectionPosition(Node node) {
- Position pos = null;
- if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
- // IDocument document =
- // fAdapterFactory.getProjectionViewer().getDocument();
- // if (document != null) {
- IndexedRegion inode = (IndexedRegion) node;
- int start = inode.getStartOffset();
- int end = inode.getEndOffset();
- if (start >= 0 && start < end) {
- // region-based
- // extra line when collapsed, but no region
- // increase when add newline
- pos = new Position(start, end - start);
- // try {
- // // line-based
- // // extra line when collapsed, but no region
- // // increase when add newline
- // IRegion startLineRegion =
- // document.getLineInformationOfOffset(start);
- // IRegion endLineRegion =
- // document.getLineInformationOfOffset(end);
- // int startOffset = startLineRegion.getOffset();
- // int endOffset = endLineRegion.getOffset() +
- // endLineRegion.getLength();
- // if (endOffset > startOffset) {
- // pos = new Position(startOffset, endOffset -
- // startOffset);
- // }
- //
- // // line-based
- // // no extra line when collapsed, but region increase
- // // when add newline
- // int startLine = document.getLineOfOffset(start);
- // int endLine = document.getLineOfOffset(end);
- // if (endLine + 1 < document.getNumberOfLines()) {
- // int offset = document.getLineOffset(startLine);
- // int endOffset = document.getLineOffset(endLine + 1);
- // pos = new Position(offset, endOffset - offset);
- // }
- // }
- // catch (BadLocationException x) {
- // Logger.log(Logger.WARNING_DEBUG, null, x);
- // }
- }
- }
- // }
- return pos;
- }
-
- /**
- * Find TagProjectionAnnotation for node in the current list of projection
- * annotations for this adapter
- *
- * @param node
- * @return TagProjectionAnnotation
- */
- private TagProjectionAnnotation getExistingAnnotation(Node node) {
- TagProjectionAnnotation anno = null;
-
- if ((node != null) && (!fTagAnnotations.isEmpty())) {
- Iterator it = fTagAnnotations.keySet().iterator();
- while (it.hasNext() && anno == null) {
- TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
- Node n = a.getNode();
- if (node.equals(n)) {
- anno = a;
- }
- }
- }
- return anno;
- }
-
- public boolean isAdapterForType(Object type) {
- return type == ProjectionModelNodeAdapterHTML.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // check if folding is even enabled, if not, just ignore notifyChanged
- // events
- if (!fAdapterFactory.isActive()) {
- return;
- }
-
- if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
- updateAdapter((Node) notifier);
- }
- }
-
- /**
- * Update the projection annotation of all the nodes that are children of
- * node
- *
- * @param node
- */
- void updateAdapter(Node node) {
- updateAdapter(node, null);
- }
-
- /**
- * Update the projection annotation of all the nodes that are children of
- * node and adds all projection annotations to viewer (for newly added
- * viewers)
- *
- * @param node
- * @param viewer
- */
- void updateAdapter(Node node, ProjectionViewer viewer) {
- long start = System.currentTimeMillis();
-
- Map additions = new HashMap();
- Map projectionAnnotations = new HashMap();
-
- // go through immediate child nodes and figure out projection
- // model annotations
- if (node != null) {
- Node childNode = node.getFirstChild();
- while (childNode != null) {
- Position newPos = createProjectionPosition(childNode);
- if (newPos != null) {
- TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
- TagProjectionAnnotation existing = getExistingAnnotation(childNode);
- if (existing == null) {
- // add to map containing all annotations for this
- // adapter
- projectionAnnotations.put(newAnnotation, newPos);
- // add to map containing annotations to add
- additions.put(newAnnotation, newPos);
- }
- else {
- // add to map containing all annotations for this
- // adapter
- projectionAnnotations.put(existing, newPos);
- // remove from map containing annotations to delete
- fTagAnnotations.remove(existing);
- }
- }
- childNode = childNode.getNextSibling();
- }
-
- // in the end, want to delete anything leftover in old list, add
- // everything in additions, and update everything in
- // projectionAnnotations
- ProjectionAnnotation[] oldList = null;
- if (!fTagAnnotations.isEmpty()) {
- oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
- }
- ProjectionAnnotation[] modifyList = null;
- if (!projectionAnnotations.isEmpty()) {
- modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
- }
-
- // specifically add all annotations to viewer
- if (viewer != null && !projectionAnnotations.isEmpty()) {
- fAdapterFactory.queueAnnotationModelChanges(node, null, projectionAnnotations, null, viewer);
- }
-
- // only update when there is something to update
- if ((oldList != null && oldList.length > 0) || (!additions.isEmpty()) || (modifyList != null && modifyList.length > 0))
- fAdapterFactory.queueAnnotationModelChanges(node, oldList, additions, modifyList);
- }
-
- // save new list of annotations
- fTagAnnotations = projectionAnnotations;
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
- System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java
deleted file mode 100644
index 675efa57da..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionViewerInformation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * Contains information about a projection viewer and also manages updating
- * the viewer's projection annotation model
- */
-class ProjectionViewerInformation {
- // copies of this class located in:
- // org.eclipse.wst.xml.ui.internal.projection
- // org.eclipse.wst.css.ui.internal.projection
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- /**
- * Listens to document to be aware of when to update the projection
- * annotation model.
- */
- private class DocumentListener implements IDocumentListener {
- private ProjectionViewerInformation fInfo;
-
- public DocumentListener(ProjectionViewerInformation info) {
- fInfo = info;
- }
-
- public void documentAboutToBeChanged(DocumentEvent event) {
- IDocument document = event.getDocument();
- if (fInfo.getDocument() == document) {
- fInfo.setIsDocumentChanging(true);
- }
- }
-
- public void documentChanged(DocumentEvent event) {
- // register a post notification replace so that projection
- // annotation model will be updated after all documentChanged
- // listeners have been notified
- IDocument document = event.getDocument();
- if (document instanceof IDocumentExtension && fInfo.getDocument() == document) {
- if (fInfo.hasChangesQueued())
- ((IDocumentExtension) document).registerPostNotificationReplace(this, new PostDocumentChangedListener(fInfo));
- }
- }
- }
-
- /**
- * Essentially a post document changed listener because it is called after
- * documentchanged has been fired.
- */
- private class PostDocumentChangedListener implements IDocumentExtension.IReplace {
- private ProjectionViewerInformation fInfo;
-
- public PostDocumentChangedListener(ProjectionViewerInformation info) {
- fInfo = info;
- }
-
- public void perform(IDocument document, IDocumentListener owner) {
- fInfo.applyAnnotationModelChanges();
- fInfo.setIsDocumentChanging(false);
- }
- }
-
- /**
- * Projection annotation model current associated with this projection
- * viewer
- */
- private ProjectionAnnotationModel fProjectionAnnotationModel;
- /**
- * Document currently associated with this projection viewer
- */
- private IDocument fDocument;
- /**
- * Listener to fProjectionViewer's document
- */
- private IDocumentListener fDocumentListener;
- /**
- * Indicates whether or not document is in the middle of changing
- */
- private boolean fIsDocumentChanging = false;
- /**
- * List of projection annotation model changes that need to be applied
- */
- private List fQueuedAnnotationChanges;
-
- public ProjectionViewerInformation(ProjectionViewer viewer) {
- fDocument = viewer.getDocument();
- fProjectionAnnotationModel = viewer.getProjectionAnnotationModel();
- }
-
- IDocument getDocument() {
- return fDocument;
- }
-
- private List getQueuedAnnotationChanges() {
- if (fQueuedAnnotationChanges == null) {
- fQueuedAnnotationChanges = new ArrayList();
- }
- return fQueuedAnnotationChanges;
- }
-
- void setIsDocumentChanging(boolean changing) {
- fIsDocumentChanging = changing;
- }
-
- private boolean isDocumentChanging() {
- return fIsDocumentChanging;
- }
-
- /**
- * Applies the pending projection annotation model changes to the
- * projection annotation model.
- */
- void applyAnnotationModelChanges() {
- List queuedChanges = getQueuedAnnotationChanges();
- // go through all the pending annotation changes and apply
- // them to
- // the projection annotation model
- while (!queuedChanges.isEmpty()) {
- ProjectionAnnotationModelChanges changes = (ProjectionAnnotationModelChanges) queuedChanges.remove(0);
- try {
- fProjectionAnnotationModel.modifyAnnotations(changes.getDeletions(), changes.getAdditions(), changes.getModifications());
- }
- catch (Exception e) {
- // if anything goes wrong, log it and continue
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-
- /**
- * Returns true if there are annotation changes queued up, false otherwise
- *
- * @return boolean
- */
- boolean hasChangesQueued() {
- return !getQueuedAnnotationChanges().isEmpty();
- }
-
- /**
- * Updates projection annotation model if document is not in flux.
- * Otherwise, queues up the changes to be applied when document is ready.
- */
- public void queueAnnotationModelChanges(ProjectionAnnotationModelChanges newChange) {
- /*
- * future_TODO: maybe improve by checking if annotation projection
- * model change already exists for node. if so, throw out old change.
- */
- getQueuedAnnotationChanges().add(newChange);
-
- // if document isn't changing, go ahead and apply it
- if (!isDocumentChanging()) {
- applyAnnotationModelChanges();
- }
- }
-
- public void initialize() {
- // add document listener
- if (fDocumentListener == null) {
- fDocumentListener = new DocumentListener(this);
- }
- getDocument().addDocumentListener(fDocumentListener);
- }
-
- public void dispose() {
- // remove document listener
- if (fDocumentListener != null) {
- getDocument().removeDocumentListener(fDocumentListener);
- }
-
- // clear out list of queued changes since it may no longer
- // be accurate
- if (fQueuedAnnotationChanges != null) {
- fQueuedAnnotationChanges.clear();
- fQueuedAnnotationChanges = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
deleted file mode 100644
index a117ccab8c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package org.eclipse.wst.html.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextInputListener;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for HTML.
- */
-public class StructuredTextFoldingProviderHTML implements IStructuredTextFoldingProvider, IProjectionListener, ITextInputListener {
- private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private IDocument fDocument;
- private ProjectionViewer fViewer;
- private boolean fProjectionNeedsToBeEnabled = false;
- /**
- * Maximum number of child nodes to add adapters to (limit for performance
- * sake)
- */
- private final int MAX_CHILDREN = 10;
- /**
- * Maximum number of sibling nodes to add adapters to (limit for
- * performance sake)
- */
- private final int MAX_SIBLINGS = 1000;
-
- /**
- * Adds an adapter to node and its children
- *
- * @param node
- * @param childLevel
- */
- private void addAdapterToNodeAndChildren(Node node, int childLevel) {
- // stop adding initial adapters MAX_CHILDREN levels deep for
- // performance sake
- if (node instanceof INodeNotifier && childLevel < MAX_CHILDREN) {
- INodeNotifier notifier = (INodeNotifier) node;
-
- // try and get the adapter for the current node and update the
- // adapter with projection information
- ProjectionModelNodeAdapterHTML adapter = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (adapter != null) {
- adapter.updateAdapter(node, fViewer);
- }
- else {
- // just call getadapter so the adapter is created and
- // automatically initialized
- notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
- }
- int siblingLevel = 0;
- Node nextChild = node.getFirstChild();
- while (nextChild != null && siblingLevel < MAX_SIBLINGS) {
- Node childNode = nextChild;
- nextChild = childNode.getNextSibling();
-
- addAdapterToNodeAndChildren(childNode, childLevel + 1);
- ++siblingLevel;
- }
- }
- }
-
- /**
- * Goes through every node and adds an adapter onto each for tracking
- * purposes
- */
- private void addAllAdapters() {
- long start = System.currentTimeMillis();
-
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- int startOffset = 0;
- IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
- if (startNode instanceof Node) {
- int siblingLevel = 0;
- Node nextSibling = (Node) startNode;
- while (nextSibling != null && siblingLevel < MAX_SIBLINGS) {
- Node currentNode = nextSibling;
- nextSibling = currentNode.getNextSibling();
-
- addAdapterToNodeAndChildren(currentNode, 0);
- ++siblingLevel;
- }
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- }
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderHTML.addAllAdapters: " + (end - start)); //$NON-NLS-1$
- }
- }
-
- /**
- * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
- * provider.
- *
- * @return ProjectionModelNodeAdapterFactoryHTML
- */
- private ProjectionModelNodeAdapterFactoryHTML getAdapterFactory(boolean createIfNeeded) {
- long start = System.currentTimeMillis();
-
- ProjectionModelNodeAdapterFactoryHTML factory = null;
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
- // getting the projectionmodelnodeadapter for the first
- // time
- // so do some initializing
- if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
- ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
- // add factory to factory registry
- factoryRegistry.addFactory(newFactory);
-
- // add factory to propogating adapter
- IDOMModel domModel = (IDOMModel) sModel;
- Document document = domModel.getDocument();
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- if (propagatingAdapter != null) {
- propagatingAdapter.addAdaptOnCreateFactory(newFactory);
- }
- }
-
- // try and get the factory
- factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- }
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderHTML.getAdapterFactory: " + (end - start)); //$NON-NLS-1$
- }
- return factory;
- }
-
- /**
- * Initialize this provider with the correct document. Assumes projection
- * is enabled. (otherwise, only install would have been called)
- */
- public void initialize() {
- if (!isInstalled())
- return;
-
- // clear out old info
- projectionDisabled();
-
- fDocument = fViewer.getDocument();
-
- // set projection viewer on new document's adapter factory
- if (fViewer.getProjectionAnnotationModel() != null) {
- ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(true);
- if (factory != null) {
- factory.addProjectionViewer(fViewer);
- }
-
- addAllAdapters();
- }
- fProjectionNeedsToBeEnabled = false;
- }
-
- /**
- * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
- *
- * @param viewer -
- * assumes not null
- */
- public void install(ProjectionViewer viewer) {
- // uninstall before trying to install new viewer
- if (isInstalled()) {
- uninstall();
- }
- fViewer = viewer;
- fViewer.addProjectionListener(this);
- fViewer.addTextInputListener(this);
- }
-
- private boolean isInstalled() {
- return fViewer != null;
- }
-
- public void projectionDisabled() {
- ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(false);
- if (factory != null) {
- factory.removeProjectionViewer(fViewer);
- }
-
- // clear out all annotations
- if (fViewer.getProjectionAnnotationModel() != null)
- fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
- removeAllAdapters();
-
- fDocument = null;
- fProjectionNeedsToBeEnabled = false;
- }
-
- public void projectionEnabled() {
- initialize();
- }
-
- /**
- * Removes an adapter from node and its children
- *
- * @param node
- * @param level
- */
- private void removeAdapterFromNodeAndChildren(Node node, int level) {
- if (node instanceof INodeNotifier) {
- INodeNotifier notifier = (INodeNotifier) node;
-
- // try and get the adapter for the current node and remove it
- INodeAdapter adapter = notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (adapter != null) {
- notifier.removeAdapter(adapter);
- }
-
- Node nextChild = node.getFirstChild();
- while (nextChild != null) {
- Node childNode = nextChild;
- nextChild = childNode.getNextSibling();
-
- removeAdapterFromNodeAndChildren(childNode, level + 1);
- }
- }
- }
-
- /**
- * Goes through every node and removes adapter from each for cleanup
- * purposes
- */
- private void removeAllAdapters() {
- long start = System.currentTimeMillis();
-
- if (fDocument != null) {
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- int startOffset = 0;
- IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
- if (startNode instanceof Node) {
- Node nextSibling = (Node) startNode;
- while (nextSibling != null) {
- Node currentNode = nextSibling;
- nextSibling = currentNode.getNextSibling();
-
- removeAdapterFromNodeAndChildren(currentNode, 0);
- }
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- }
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderHTML.removeAllAdapters: " + (end - start)); //$NON-NLS-1$
- }
- }
-
- public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) {
- // if folding is enabled and new document is going to be a totally
- // different document, disable projection
- if (fDocument != null && fDocument != newInput) {
- // disable projection and disconnect everything
- projectionDisabled();
- fProjectionNeedsToBeEnabled = true;
- }
- }
-
- public void inputDocumentChanged(IDocument oldInput, IDocument newInput) {
- // if projection was previously enabled before input document changed
- // and new document is different than old document
- if (fProjectionNeedsToBeEnabled && fDocument == null && newInput != null) {
- projectionEnabled();
- fProjectionNeedsToBeEnabled = false;
- }
- }
-
- /**
- * Disconnect this IStructuredTextFoldingProvider from projection viewer
- */
- public void uninstall() {
- if (isInstalled()) {
- projectionDisabled();
-
- fViewer.removeProjectionListener(this);
- fViewer.removeTextInputListener(this);
- fViewer = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
deleted file mode 100644
index 58bb496896..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.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.html.ui.internal.registry;
-
-import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
-import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.internal.provisional.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-
-public class AdapterFactoryProviderForHTML implements AdapterFactoryProvider {
-
-
- 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 IDOMModel) {
- addPropagatingAdapters(structuredModel);
- }
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
-
- FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- INodeAdapterFactory factory = null;
-
- factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
- if (factory == null) {
- factory = new JFaceNodeAdapterFactoryForHTML();
- factoryRegistry.addFactory(factory);
- }
- }
-
- protected void addPropagatingAdapters(IStructuredModel structuredModel) {
- // no propagating to add
- }
-
- /*
- * @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/internal/search/HTMLFindOccurrencesActionDelegate.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
deleted file mode 100644
index 23c2c49085..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate;
-
-/**
- * Sets up FindOccurrencesActionDelegate for html find occurrences processors
- */
-public class HTMLFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate {
- private List fProcessors;
-
- protected List getProcessors() {
- if (fProcessors == null) {
- fProcessors = new ArrayList();
- HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor();
- fProcessors.add(htmlProcessor);
- }
- return fProcessors;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
deleted file mode 100644
index 2e2a696a58..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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 org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-/**
- * Configures a FindOccurrencesProcessor with HTML partitions and regions
- */
-public class HTMLFindOccurrencesProcessor extends FindOccurrencesProcessor {
-
- protected String[] getPartitionTypes() {
- return new String[]{IHTMLPartitions.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT};
- }
-
- protected String[] getRegionTypes() {
- return new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE};
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
deleted file mode 100644
index 5c7c88decc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/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.internal.style;
-
-import org.eclipse.wst.xml.ui.internal.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/internal/style/LineStyleProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
deleted file mode 100644
index a2b5e7aa49..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.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.wst.html.ui.internal.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-import org.eclipse.wst.xml.ui.internal.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() == DOMRegionContext.BLOCK_TEXT) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- // first try "standard" tag attributes from super class
- return super.getAttributeFor(region);
- }
-
- 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 (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);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider#getColorPreferences()
- */
- protected IPreferenceStore getColorPreferences() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
deleted file mode 100644
index 4e9cb00a1d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-/**
- * Provides context information for HTML tags (Shows tooltip description)
- */
-public class HTMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
-
- private ITextHover fTextHover = null;
-
- public HTMLInformationProvider() {
- fTextHover = SSEUIPlugin.getDefault().getTextHoverManager().createBestMatchHover(new HTMLTagInfoHoverProcessor());
- }
-
- /*
- * (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/internal/taginfo/HTMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
deleted file mode 100644
index b8f7103d94..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/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.internal.taginfo;
-
-
-
-import org.eclipse.wst.xml.ui.internal.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/internal/templates/EncodingTemplateVariableResolverHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
deleted file mode 100644
index aca7d175e7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-
-public class EncodingTemplateVariableResolverHTML extends SimpleTemplateVariableResolver {
- private static final String ENCODING_TYPE = getEncodingType();
-
- private static String getEncodingType() {
- return "encoding"; //$NON-NLS-1$
- }
-
- /**
- * Creates a new encoding variable
- */
- public EncodingTemplateVariableResolverHTML() {
- super(ENCODING_TYPE, HTMLUIMessages.Creating_files_encoding);
- }
-
- protected String resolve(TemplateContext context) {
- return HTMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
deleted file mode 100644
index bf775f4ce4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.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.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for HTML template context types. Templates of this context type
- * apply to any place within HTML content type.
- */
-public class TemplateContextTypeHTML extends TemplateContextType {
-
- public TemplateContextTypeHTML() {
- super();
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new EncodingTemplateVariableResolverHTML());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
deleted file mode 100644
index 794b13db36..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.templates;
-
-
-public class TemplateContextTypeIdsHTML {
-
- public static final String ALL = getAll();
-
- public static final String ATTRIBUTE = getAttribute();
-
- public static final String ATTRIBUTE_VALUE = getAttributeValue();
-
- public static final String NEW = getNew();
-
- public static final String TAG = getTag();
-
- private static String getAll() {
- return getPrefix() + "_all"; //$NON-NLS-1$
- }
-
- private static String getAttribute() {
- return getPrefix() + "_attribute"; //$NON-NLS-1$
- }
-
- private static String getAttributeValue() {
- return getPrefix() + "_attribute_value"; //$NON-NLS-1$
- }
-
- private static String getNew() {
- return getPrefix() + "_new"; //$NON-NLS-1$
- }
-
- private static String getTag() {
- return getPrefix() + "_tag"; //$NON-NLS-1$
- }
-
- private static String getPrefix() {
- return "html"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index 7cbce425fb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.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.wst.html.ui.internal.text;
-
-import org.eclipse.wst.sse.ui.internal.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public HTMLDocumentRegionEdgeMatcher() {
- super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.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/internal/text/IJavaPartitions.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
deleted file mode 100644
index b9d8561a47..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/IJavaPartitions.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-/**
- * Definition of Java partitioning and its partitions.
- *
- * @see Eclipse 3.1
- */
-interface IJavaPartitions {
-
- /**
- * The identifier of the Java partitioning.
- */
- String JAVA_PARTITIONING = "___java_partitioning"; //$NON-NLS-1$
-
- /**
- * The identifier of the single-line (JLS2: EndOfLineComment) end comment
- * partition content type.
- */
- String JAVA_SINGLE_LINE_COMMENT = "__java_singleline_comment"; //$NON-NLS-1$
-
- /**
- * The identifier multi-line (JLS2: TraditionalComment) comment partition
- * content type.
- */
- String JAVA_MULTI_LINE_COMMENT = "__java_multiline_comment"; //$NON-NLS-1$
-
- /**
- * The identifier of the Javadoc (JLS2: DocumentationComment) partition
- * content type.
- */
- String JAVA_DOC = "__java_javadoc"; //$NON-NLS-1$
-
- /**
- * The identifier of the Java string partition content type.
- */
- String JAVA_STRING = "__java_string"; //$NON-NLS-1$
-
- /**
- * The identifier of the Java character partition content type.
- */
- String JAVA_CHARACTER = "__java_character"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
deleted file mode 100644
index e3cace3005..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaCodeReader.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.ui.internal.derived.SingleCharReader;
-
-/**
- * Reads from a document either forwards or backwards. May be configured to
- * skip comments and strings.
- */
-class JavaCodeReader extends SingleCharReader {
-
- /** The EOF character */
- public static final int EOF = -1;
-
- private boolean fSkipComments = false;
- private boolean fSkipStrings = false;
- private boolean fForward = false;
-
- private IDocument fDocument;
- private int fOffset;
-
- private int fEnd = -1;
- private int fCachedLineNumber = -1;
- private int fCachedLineOffset = -1;
-
-
- public JavaCodeReader() {
- }
-
- /**
- * Returns the offset of the last read character. Should only be called
- * after read has been called.
- */
- public int getOffset() {
- return fForward ? fOffset - 1 : fOffset;
- }
-
- public void configureForwardReader(IDocument document, int offset, int length, boolean skipComments, boolean skipStrings) throws IOException {
- fDocument = document;
- fOffset = offset;
- fSkipComments = skipComments;
- fSkipStrings = skipStrings;
-
- fForward = true;
- fEnd = Math.min(fDocument.getLength(), fOffset + length);
- }
-
- public void configureBackwardReader(IDocument document, int offset, boolean skipComments, boolean skipStrings) throws IOException {
- fDocument = document;
- fOffset = offset;
- fSkipComments = skipComments;
- fSkipStrings = skipStrings;
-
- fForward = false;
- try {
- fCachedLineNumber = fDocument.getLineOfOffset(fOffset);
- }
- catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- /*
- * @see Reader#close()
- */
- public void close() throws IOException {
- fDocument = null;
- }
-
- /*
- * @see SingleCharReader#read()
- */
- public int read() throws IOException {
- try {
- return fForward ? readForwards() : readBackwards();
- }
- catch (BadLocationException x) {
- throw new IOException(x.getMessage());
- }
- }
-
- private void gotoCommentEnd() throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
- if (current == '*') {
- if (fOffset < fEnd && fDocument.getChar(fOffset) == '/') {
- ++fOffset;
- return;
- }
- }
- }
- }
-
- private void gotoStringEnd(char delimiter) throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
- if (current == '\\') {
- // ignore escaped characters
- ++fOffset;
- }
- else if (current == delimiter) {
- return;
- }
- }
- }
-
- private void gotoLineEnd() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- fOffset = fDocument.getLineOffset(line + 1);
- }
-
- private int readForwards() throws BadLocationException {
- while (fOffset < fEnd) {
- char current = fDocument.getChar(fOffset++);
-
- switch (current) {
- case '/' :
-
- if (fSkipComments && fOffset < fEnd) {
- char next = fDocument.getChar(fOffset);
- if (next == '*') {
- // a comment starts, advance to the comment end
- ++fOffset;
- gotoCommentEnd();
- continue;
- }
- else if (next == '/') {
- // '//'-comment starts, advance to the line end
- gotoLineEnd();
- continue;
- }
- }
-
- return current;
-
- case '"' :
- case '\'' :
-
- if (fSkipStrings) {
- gotoStringEnd(current);
- continue;
- }
-
- return current;
- }
-
- return current;
- }
-
- return EOF;
- }
-
- private void handleSingleLineComment() throws BadLocationException {
- int line = fDocument.getLineOfOffset(fOffset);
- if (line < fCachedLineNumber) {
- fCachedLineNumber = line;
- fCachedLineOffset = fDocument.getLineOffset(line);
- int offset = fOffset;
- while (fCachedLineOffset < offset) {
- char current = fDocument.getChar(offset--);
- if (current == '/' && fCachedLineOffset <= offset && fDocument.getChar(offset) == '/') {
- fOffset = offset;
- return;
- }
- }
- }
- }
-
- private void gotoCommentStart() throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset--);
- if (current == '*' && 0 <= fOffset && fDocument.getChar(fOffset) == '/')
- return;
- }
- }
-
- private void gotoStringStart(char delimiter) throws BadLocationException {
- while (0 < fOffset) {
- char current = fDocument.getChar(fOffset);
- if (current == delimiter) {
- if (!(0 <= fOffset && fDocument.getChar(fOffset - 1) == '\\'))
- return;
- }
- --fOffset;
- }
- }
-
- private int readBackwards() throws BadLocationException {
-
- while (0 < fOffset) {
- --fOffset;
-
- handleSingleLineComment();
-
- char current = fDocument.getChar(fOffset);
- switch (current) {
- case '/' :
-
- if (fSkipComments && fOffset > 1) {
- char next = fDocument.getChar(fOffset - 1);
- if (next == '*') {
- // a comment ends, advance to the comment start
- fOffset -= 2;
- gotoCommentStart();
- continue;
- }
- }
-
- return current;
-
- case '"' :
- case '\'' :
-
- if (fSkipStrings) {
- --fOffset;
- gotoStringStart(current);
- continue;
- }
-
- return current;
- }
-
- return current;
- }
-
- return EOF;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
deleted file mode 100644
index 01602a291e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaHeuristicScanner.java
+++ /dev/null
@@ -1,986 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.text;
-
-// taken from package org.eclipse.jdt.internal.ui.text;
-
-import java.util.Arrays;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.TypedRegion;
-
-/**
- * Utility methods for heuristic based Java manipulations in an incomplete
- * Java source file.
- *
- * <p>
- * An instance holds some internal position in the document and is therefore
- * not threadsafe.
- * </p>
- *
- * @see Eclipse 3.0
- */
-final class JavaHeuristicScanner implements Symbols {
- /**
- * Returned by all methods when the requested position could not be found,
- * or if a {@link BadLocationException} was thrown while scanning.
- */
- public static final int NOT_FOUND = -1;
-
- /**
- * Special bound parameter that means either -1 (backward scanning) or
- * <code>fDocument.getLength()</code> (forward scanning).
- */
- public static final int UNBOUND = -2;
-
-
- /* character constants */
- private static final char LBRACE = '{';
- private static final char RBRACE = '}';
- private static final char LPAREN = '(';
- private static final char RPAREN = ')';
- private static final char SEMICOLON = ';';
- private static final char COLON = ':';
- private static final char COMMA = ',';
- private static final char LBRACKET = '[';
- private static final char RBRACKET = ']';
- private static final char QUESTIONMARK = '?';
- private static final char EQUAL = '=';
- private static final char LANGLE = '<';
- private static final char RANGLE = '>';
-
- /**
- * Specifies the stop condition, upon which the <code>scanXXX</code>
- * methods will decide whether to keep scanning or not. This interface may
- * implemented by clients.
- */
- private static abstract class StopCondition {
- /**
- * Instructs the scanner to return the current position.
- *
- * @param ch
- * the char at the current position
- * @param position
- * the current position
- * @param forward
- * the iteration direction
- * @return <code>true</code> if the stop condition is met.
- */
- public abstract boolean stop(char ch, int position, boolean forward);
-
- /**
- * Asks the condition to return the next position to query. The
- * default is to return the next/previous position.
- *
- * @return the next position to scan
- */
- public int nextPosition(int position, boolean forward) {
- return forward ? position + 1 : position - 1;
- }
- }
-
- /**
- * Stops upon a non-whitespace (as defined by
- * {@link Character#isWhitespace(char)}) character.
- */
- private static class NonWhitespace extends StopCondition {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return !Character.isWhitespace(ch);
- }
- }
-
- /**
- * Stops upon a non-whitespace character in the default partition.
- *
- * @see NonWhitespace
- */
- private final class NonWhitespaceDefaultPartition extends NonWhitespace {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return super.stop(ch, position, true) && isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
- * boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition = getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end = partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- }
- else {
- int offset = partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /**
- * Stops upon a non-java identifier (as defined by
- * {@link Character#isJavaIdentifierPart(char)}) character.
- */
- private static class NonJavaIdentifierPart extends StopCondition {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return !Character.isJavaIdentifierPart(ch);
- }
- }
-
- /**
- * Stops upon a non-java identifier character in the default partition.
- *
- * @see NonJavaIdentifierPart
- */
- private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return super.stop(ch, position, true) || !isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
- * boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition = getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end = partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- }
- else {
- int offset = partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /**
- * Stops upon a character in the default partition that matches the given
- * character list.
- */
- private final class CharacterMatch extends StopCondition {
- private final char[] fChars;
-
- /**
- * Creates a new instance.
- *
- * @param ch
- * the single character to match
- */
- public CharacterMatch(char ch) {
- this(new char[]{ch});
- }
-
- /**
- * Creates a new instance.
- *
- * @param chars
- * the chars to match.
- */
- public CharacterMatch(char[] chars) {
- Assert.isNotNull(chars);
- Assert.isTrue(chars.length > 0);
- fChars = chars;
- Arrays.sort(chars);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char,
- * int)
- */
- public boolean stop(char ch, int position, boolean forward) {
- return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int,
- * boolean)
- */
- public int nextPosition(int position, boolean forward) {
- ITypedRegion partition = getPartition(position);
- if (fPartition.equals(partition.getType()))
- return super.nextPosition(position, forward);
-
- if (forward) {
- int end = partition.getOffset() + partition.getLength();
- if (position < end)
- return end;
- }
- else {
- int offset = partition.getOffset();
- if (position > offset)
- return offset - 1;
- }
- return super.nextPosition(position, forward);
- }
- }
-
- /** The document being scanned. */
- private IDocument fDocument;
- /** The partitioning being used for scanning. */
- private String fPartitioning;
- /** The partition to scan in. */
- private String fPartition;
-
- /* internal scan state */
-
- /** the most recently read character. */
- private char fChar;
- /** the most recently read position. */
- private int fPos;
-
- /* preset stop conditions */
- private final StopCondition fNonWSDefaultPart = new NonWhitespaceDefaultPartition();
- private final static StopCondition fNonWS = new NonWhitespace();
- private final StopCondition fNonIdent = new NonJavaIdentifierPartDefaultPartition();
-
- /**
- * Creates a new instance.
- *
- * @param document
- * the document to scan
- * @param partitioning
- * the partitioning to use for scanning
- * @param partition
- * the partition to scan in
- */
- public JavaHeuristicScanner(IDocument document, String partitioning, String partition) {
- Assert.isNotNull(document);
- Assert.isNotNull(partitioning);
- Assert.isNotNull(partition);
- fDocument = document;
- fPartitioning = partitioning;
- fPartition = partition;
- }
-
- /**
- * Calls
- * <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.
- *
- * @param document
- * the document to scan.
- */
- public JavaHeuristicScanner(IDocument document) {
- this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE);
- }
-
- /**
- * Returns the most recent internal scan position.
- *
- * @return the most recent internal scan position.
- */
- public int getPosition() {
- return fPos;
- }
-
- /**
- * Returns the next token in forward direction, starting at
- * <code>start</code>, and not extending further than
- * <code>bound</code>. The return value is one of the constants defined
- * in {@link Symbols}. After a call, {@link #getPosition()} will return
- * the position just after the scanned token (i.e. the next position that
- * will be scanned).
- *
- * @param start
- * the first character position in the document to consider
- * @param bound
- * the first position not to consider any more
- * @return a constant from {@link Symbols} describing the next token
- */
- public int nextToken(int start, int bound) {
- int pos = scanForward(start, bound, fNonWSDefaultPart);
- if (pos == NOT_FOUND)
- return TokenEOF;
-
- fPos++;
-
- switch (fChar) {
- case LBRACE :
- return TokenLBRACE;
- case RBRACE :
- return TokenRBRACE;
- case LBRACKET :
- return TokenLBRACKET;
- case RBRACKET :
- return TokenRBRACKET;
- case LPAREN :
- return TokenLPAREN;
- case RPAREN :
- return TokenRPAREN;
- case SEMICOLON :
- return TokenSEMICOLON;
- case COMMA :
- return TokenCOMMA;
- case QUESTIONMARK :
- return TokenQUESTIONMARK;
- case EQUAL :
- return TokenEQUAL;
- case LANGLE :
- return TokenLESSTHAN;
- case RANGLE :
- return TokenGREATERTHAN;
- }
-
- // else
- if (Character.isJavaIdentifierPart(fChar)) {
- // assume an ident or keyword
- int from = pos, to;
- pos = scanForward(pos + 1, bound, fNonIdent);
- if (pos == NOT_FOUND)
- to = bound == UNBOUND ? fDocument.getLength() : bound;
- else
- to = pos;
-
- String identOrKeyword;
- try {
- identOrKeyword = fDocument.get(from, to - from);
- }
- catch (BadLocationException e) {
- return TokenEOF;
- }
-
- return getToken(identOrKeyword);
-
-
- }
- else {
- // operators, number literals etc
- return TokenOTHER;
- }
- }
-
- /**
- * Returns the next token in backward direction, starting at
- * <code>start</code>, and not extending further than
- * <code>bound</code>. The return value is one of the constants defined
- * in {@link Symbols}. After a call, {@link #getPosition()} will return
- * the position just before the scanned token starts (i.e. the next
- * position that will be scanned).
- *
- * @param start
- * the first character position in the document to consider
- * @param bound
- * the first position not to consider any more
- * @return a constant from {@link Symbols} describing the previous token
- */
- public int previousToken(int start, int bound) {
- int pos = scanBackward(start, bound, fNonWSDefaultPart);
- if (pos == NOT_FOUND)
- return TokenEOF;
-
- fPos--;
-
- switch (fChar) {
- case LBRACE :
- return TokenLBRACE;
- case RBRACE :
- return TokenRBRACE;
- case LBRACKET :
- return TokenLBRACKET;
- case RBRACKET :
- return TokenRBRACKET;
- case LPAREN :
- return TokenLPAREN;
- case RPAREN :
- return TokenRPAREN;
- case SEMICOLON :
- return TokenSEMICOLON;
- case COLON :
- return TokenCOLON;
- case COMMA :
- return TokenCOMMA;
- case QUESTIONMARK :
- return TokenQUESTIONMARK;
- case EQUAL :
- return TokenEQUAL;
- case LANGLE :
- return TokenLESSTHAN;
- case RANGLE :
- return TokenGREATERTHAN;
- }
-
- // else
- if (Character.isJavaIdentifierPart(fChar)) {
- // assume an ident or keyword
- int from, to = pos + 1;
- pos = scanBackward(pos - 1, bound, fNonIdent);
- if (pos == NOT_FOUND)
- from = bound == UNBOUND ? 0 : bound + 1;
- else
- from = pos + 1;
-
- String identOrKeyword;
- try {
- identOrKeyword = fDocument.get(from, to - from);
- }
- catch (BadLocationException e) {
- return TokenEOF;
- }
-
- return getToken(identOrKeyword);
-
-
- }
- else {
- // operators, number literals etc
- return TokenOTHER;
- }
-
- }
-
- /**
- * Returns one of the keyword constants or <code>TokenIDENT</code> for a
- * scanned identifier.
- *
- * @param s
- * a scanned identifier
- * @return one of the constants defined in {@link Symbols}
- */
- private int getToken(String s) {
- Assert.isNotNull(s);
-
- switch (s.length()) {
- case 2 :
- if ("if".equals(s)) //$NON-NLS-1$
- return TokenIF;
- if ("do".equals(s)) //$NON-NLS-1$
- return TokenDO;
- break;
- case 3 :
- if ("for".equals(s)) //$NON-NLS-1$
- return TokenFOR;
- if ("try".equals(s)) //$NON-NLS-1$
- return TokenTRY;
- if ("new".equals(s)) //$NON-NLS-1$
- return TokenNEW;
- break;
- case 4 :
- if ("case".equals(s)) //$NON-NLS-1$
- return TokenCASE;
- if ("else".equals(s)) //$NON-NLS-1$
- return TokenELSE;
- if ("enum".equals(s)) //$NON-NLS-1$
- return TokenENUM;
- if ("goto".equals(s)) //$NON-NLS-1$
- return TokenGOTO;
- break;
- case 5 :
- if ("break".equals(s)) //$NON-NLS-1$
- return TokenBREAK;
- if ("catch".equals(s)) //$NON-NLS-1$
- return TokenCATCH;
- if ("class".equals(s)) //$NON-NLS-1$
- return TokenCLASS;
- if ("while".equals(s)) //$NON-NLS-1$
- return TokenWHILE;
- break;
- case 6 :
- if ("return".equals(s)) //$NON-NLS-1$
- return TokenRETURN;
- if ("static".equals(s)) //$NON-NLS-1$
- return TokenSTATIC;
- if ("switch".equals(s)) //$NON-NLS-1$
- return TokenSWITCH;
- break;
- case 7 :
- if ("default".equals(s)) //$NON-NLS-1$
- return TokenDEFAULT;
- if ("finally".equals(s)) //$NON-NLS-1$
- return TokenFINALLY;
- break;
- case 9 :
- if ("interface".equals(s)) //$NON-NLS-1$
- return TokenINTERFACE;
- break;
- case 12 :
- if ("synchronized".equals(s)) //$NON-NLS-1$
- return TokenSYNCHRONIZED;
- break;
- }
- return TokenIDENT;
- }
-
- /**
- * Returns the position of the closing peer character (forward search).
- * Any scopes introduced by opening peers are skipped. All peers accounted
- * for must reside in the default partition.
- *
- * <p>
- * Note that <code>start</code> must not point to the opening peer, but
- * to the first character being searched.
- * </p>
- *
- * @param start
- * the start position
- * @param openingPeer
- * the opening peer character (e.g. '{')
- * @param closingPeer
- * the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
- Assert.isNotNull(fDocument);
- Assert.isTrue(start >= 0);
-
- try {
- int depth = 1;
- start -= 1;
- while (true) {
- start = scanForward(start + 1, UNBOUND, new CharacterMatch(new char[]{openingPeer, closingPeer}));
- if (start == NOT_FOUND)
- return NOT_FOUND;
-
- if (fDocument.getChar(start) == openingPeer)
- depth++;
- else
- depth--;
-
- if (depth == 0)
- return start;
- }
-
- }
- catch (BadLocationException e) {
- return NOT_FOUND;
- }
- }
-
- /**
- * Returns the position of the opening peer character (backward search).
- * Any scopes introduced by closing peers are skipped. All peers accounted
- * for must reside in the default partition.
- *
- * <p>
- * Note that <code>start</code> must not point to the closing peer, but
- * to the first character being searched.
- * </p>
- *
- * @param start
- * the start position
- * @param openingPeer
- * the opening peer character (e.g. '{')
- * @param closingPeer
- * the closing peer character (e.g. '}')
- * @return the matching peer character position, or <code>NOT_FOUND</code>
- */
- public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
- Assert.isTrue(start < fDocument.getLength());
-
- try {
- int depth = 1;
- start += 1;
- while (true) {
- start = scanBackward(start - 1, UNBOUND, new CharacterMatch(new char[]{openingPeer, closingPeer}));
- if (start == NOT_FOUND)
- return NOT_FOUND;
-
- if (fDocument.getChar(start) == closingPeer)
- depth++;
- else
- depth--;
-
- if (depth == 0)
- return start;
- }
-
- }
- catch (BadLocationException e) {
- return NOT_FOUND;
- }
- }
-
- /**
- * Computes the surrounding block around <code>offset</code>. The
- * search is started at the beginning of <code>offset</code>, i.e. an
- * opening brace at <code>offset</code> will not be part of the
- * surrounding block, but a closing brace will.
- *
- * @param offset
- * the offset for which the surrounding block is computed
- * @return a region describing the surrounding block, or <code>null</code>
- * if none can be found
- */
- public IRegion findSurroundingBlock(int offset) {
- if (offset < 1 || offset >= fDocument.getLength())
- return null;
-
- int begin = findOpeningPeer(offset - 1, LBRACE, RBRACE);
- int end = findClosingPeer(offset, LBRACE, RBRACE);
- if (begin == NOT_FOUND || end == NOT_FOUND)
- return null;
- return new Region(begin, end + 1 - begin);
- }
-
- /**
- * Finds the smallest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
- * evaluates to <code>false</code> and the position is in the default
- * partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @return the smallest position of a non-whitespace character in [<code>position</code>,
- * <code>bound</code>) that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceForward(int position, int bound) {
- return scanForward(position, bound, fNonWSDefaultPart);
- }
-
- /**
- * Finds the smallest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
- * evaluates to <code>false</code>.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @return the smallest position of a non-whitespace character in [<code>position</code>,
- * <code>bound</code>), or <code>NOT_FOUND</code> if none can
- * be found
- */
- public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
- return scanForward(position, bound, fNonWS);
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the
- * position is &lt;= <code>position</code> and &gt; <code>bound</code>
- * and <code>Character.isWhitespace(fDocument.getChar(pos))</code>
- * evaluates to <code>false</code> and the position is in the default
- * partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @return the highest position of a non-whitespace character in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int findNonWhitespaceBackward(int position, int bound) {
- return scanBackward(position, bound, fNonWSDefaultPart);
- }
-
- /**
- * Finds the lowest position <code>p</code> in <code>fDocument</code>
- * such that <code>start</code> &lt;= p &lt; <code>bound</code> and
- * <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to
- * <code>true</code>.
- *
- * @param start
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>start</code>, or <code>UNBOUND</code>
- * @param condition
- * the <code>StopCondition</code> to check
- * @return the lowest position in [<code>start</code>,
- * <code>bound</code>) for which <code>condition</code>
- * holds, or <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int start, int bound, StopCondition condition) {
- Assert.isTrue(start >= 0);
-
- if (bound == UNBOUND)
- bound = fDocument.getLength();
-
- Assert.isTrue(bound <= fDocument.getLength());
-
- try {
- fPos = start;
- while (fPos < bound) {
-
- fChar = fDocument.getChar(fPos);
- if (condition.stop(fChar, fPos, true))
- return fPos;
-
- fPos = condition.nextPosition(fPos, true);
- }
- }
- catch (BadLocationException e) {
- }
- return NOT_FOUND;
- }
-
-
- /**
- * Finds the lowest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> and the position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param ch
- * the <code>char</code> to search for
- * @return the lowest position of <code>ch</code> in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int position, int bound, char ch) {
- return scanForward(position, bound, new CharacterMatch(ch));
- }
-
- /**
- * Finds the lowest position in <code>fDocument</code> such that the
- * position is &gt;= <code>position</code> and &lt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> for at least one ch in <code>chars</code> and the
- * position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &gt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param chars
- * an array of <code>char</code> to search for
- * @return the lowest position of a non-whitespace character in [<code>position</code>,
- * <code>bound</code>) that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanForward(int position, int bound, char[] chars) {
- return scanForward(position, bound, new CharacterMatch(chars));
- }
-
- /**
- * Finds the highest position <code>p</code> in <code>fDocument</code>
- * such that <code>bound</code> &lt; <code>p</code> &lt;=
- * <code>start</code> and
- * <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to
- * <code>true</code>.
- *
- * @param start
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>start</code>, or <code>UNBOUND</code>
- * @param condition
- * the <code>StopCondition</code> to check
- * @return the highest position in (<code>bound</code>,
- * <code>start</code> for which <code>condition</code> holds,
- * or <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int start, int bound, StopCondition condition) {
- if (bound == UNBOUND)
- bound = -1;
-
- Assert.isTrue(bound >= -1);
- Assert.isTrue(start < fDocument.getLength());
-
- try {
- fPos = start;
- while (fPos > bound) {
-
- fChar = fDocument.getChar(fPos);
- if (condition.stop(fChar, fPos, false))
- return fPos;
-
- fPos = condition.nextPosition(fPos, false);
- }
- }
- catch (BadLocationException e) {
- }
- return NOT_FOUND;
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the
- * position is &lt;= <code>position</code> and &gt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> for at least one ch in <code>chars</code> and the
- * position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param ch
- * the <code>char</code> to search for
- * @return the highest position of one element in <code>chars</code> in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int position, int bound, char ch) {
- return scanBackward(position, bound, new CharacterMatch(ch));
- }
-
- /**
- * Finds the highest position in <code>fDocument</code> such that the
- * position is &lt;= <code>position</code> and &gt; <code>bound</code>
- * and <code>fDocument.getChar(position) == ch</code> evaluates to
- * <code>true</code> for at least one ch in <code>chars</code> and the
- * position is in the default partition.
- *
- * @param position
- * the first character position in <code>fDocument</code> to
- * be considered
- * @param bound
- * the first position in <code>fDocument</code> to not
- * consider any more, with <code>bound</code> &lt;
- * <code>position</code>, or <code>UNBOUND</code>
- * @param chars
- * an array of <code>char</code> to search for
- * @return the highest position of one element in <code>chars</code> in (<code>bound</code>,
- * <code>position</code>] that resides in a Java partition, or
- * <code>NOT_FOUND</code> if none can be found
- */
- public int scanBackward(int position, int bound, char[] chars) {
- return scanBackward(position, bound, new CharacterMatch(chars));
- }
-
- /**
- * Checks whether <code>position</code> resides in a default (Java)
- * partition of <code>fDocument</code>.
- *
- * @param position
- * the position to be checked
- * @return <code>true</code> if <code>position</code> is in the
- * default partition of <code>fDocument</code>,
- * <code>false</code> otherwise
- */
- public boolean isDefaultPartition(int position) {
- Assert.isTrue(position >= 0);
- Assert.isTrue(position <= fDocument.getLength());
-
- try {
- return fPartition.equals(TextUtilities.getContentType(fDocument, fPartitioning, position, false));
- }
- catch (BadLocationException e) {
- return false;
- }
- }
-
- /**
- * Returns the partition at <code>position</code>.
- *
- * @param position
- * the position to get the partition for
- * @return the partition at <code>position</code> or a dummy zero-length
- * partition if accessing the document fails
- */
- private ITypedRegion getPartition(int position) {
- Assert.isTrue(position >= 0);
- Assert.isTrue(position <= fDocument.getLength());
-
- try {
- return TextUtilities.getPartition(fDocument, fPartitioning, position, false);
- }
- catch (BadLocationException e) {
- return new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
- }
-
- }
-
- /**
- * Checks if the line seems to be an open condition not followed by a
- * block (i.e. an if, while, or for statement with just one following
- * statement, see example below).
- *
- * <pre>
- * if (condition)
- * doStuff();
- * </pre>
- *
- * <p>
- * Algorithm: if the last non-WS, non-Comment code on the line is an if
- * (condition), while (condition), for( expression), do, else, and there
- * is no statement after that
- * </p>
- *
- * @param position
- * the insert position of the new character
- * @param bound
- * the lowest position to consider
- * @return <code>true</code> if the code is a conditional statement or
- * loop without a block, <code>false</code> otherwise
- */
- public boolean isBracelessBlockStart(int position, int bound) {
- if (position < 1)
- return false;
-
- switch (previousToken(position, bound)) {
- case TokenDO :
- case TokenELSE :
- return true;
- case TokenRPAREN :
- position = findOpeningPeer(fPos, LPAREN, RPAREN);
- if (position > 0) {
- switch (previousToken(position - 1, bound)) {
- case TokenIF :
- case TokenFOR :
- case TokenWHILE :
- return true;
- }
- }
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
deleted file mode 100644
index 020769fb6b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/JavaPairMatcher.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.BadLocationException;
-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;
-
-class JavaPairMatcher implements ICharacterPairMatcher {
-
- protected char[] fPairs;
- protected IDocument fDocument;
- protected int fOffset;
-
- protected int fStartPos;
- protected int fEndPos;
- protected int fAnchor;
-
- protected JavaCodeReader fReader = new JavaCodeReader();
- /**
- * Stores the source version state.
- *
- * @see Eclipse 3.1
- */
- private boolean fHighlightAngularBrackets = false;
-
-
- public JavaPairMatcher(char[] pairs) {
- fPairs = pairs;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#match(org.eclipse.jface.text.IDocument,
- * int)
- */
- public IRegion match(IDocument document, int offset) {
- fOffset = offset;
-
- if(offset < 0 || offset >= document.getLength())
- return null;
-
- fDocument = document;
-
- if (fDocument != null && matchPairsAt() && fStartPos != fEndPos)
- return new Region(fStartPos, fEndPos - fStartPos + 1);
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#getAnchor()
- */
- public int getAnchor() {
- return fAnchor;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#dispose()
- */
- public void dispose() {
- clear();
- fDocument = null;
- fReader = null;
- }
-
- /*
- * @see org.eclipse.jface.text.source.ICharacterPairMatcher#clear()
- */
- public void clear() {
- if (fReader != null) {
- try {
- fReader.close();
- }
- catch (IOException x) {
- // ignore
- }
- }
- }
-
- protected boolean matchPairsAt() {
-
- int i;
- int pairIndex1 = fPairs.length;
- int pairIndex2 = fPairs.length;
-
- fStartPos = -1;
- fEndPos = -1;
-
- // get the chars preceding and following the start position
- try {
-
- char prevChar = fDocument.getChar(Math.max(fOffset - 1, 0));
- // modified behavior for
- // http://dev.eclipse.org/bugs/show_bug.cgi?id=16879
- // char nextChar= fDocument.getChar(fOffset);
-
- // search for opening peer character next to the activation point
- for (i = 0; i < fPairs.length; i = i + 2) {
- // if (nextChar == fPairs[i]) {
- // fStartPos= fOffset;
- // pairIndex1= i;
- // } else
- if (prevChar == fPairs[i]) {
- fStartPos = fOffset - 1;
- pairIndex1 = i;
- }
- }
-
- // search for closing peer character next to the activation point
- for (i = 1; i < fPairs.length; i = i + 2) {
- if (prevChar == fPairs[i]) {
- fEndPos = fOffset - 1;
- pairIndex2 = i;
- }
- // else if (nextChar == fPairs[i]) {
- // fEndPos= fOffset;
- // pairIndex2= i;
- // }
- }
-
- if (fEndPos > -1) {
- fAnchor = RIGHT;
- fStartPos = searchForOpeningPeer(fEndPos, fPairs[pairIndex2 - 1], fPairs[pairIndex2], fDocument);
- if (fStartPos > -1)
- return true;
- else
- fEndPos = -1;
- }
- else if (fStartPos > -1) {
- fAnchor = LEFT;
- fEndPos = searchForClosingPeer(fStartPos, fPairs[pairIndex1], fPairs[pairIndex1 + 1], fDocument);
- if (fEndPos > -1)
- return true;
- else
- fStartPos = -1;
- }
-
- }
- catch (BadLocationException x) {
- }
- catch (IOException x) {
- }
-
- return false;
- }
-
- protected int searchForClosingPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
- if (openingPeer == '<' && !(fHighlightAngularBrackets && isTypeParameterBracket(offset, document)))
- return -1;
-
- fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true);
-
- int stack = 1;
- int c = fReader.read();
- while (c != JavaCodeReader.EOF) {
- if (c == openingPeer && c != closingPeer)
- stack++;
- else if (c == closingPeer)
- stack--;
-
- if (stack == 0)
- return fReader.getOffset();
-
- c = fReader.read();
- }
-
- return -1;
- }
-
-
- protected int searchForOpeningPeer(int offset, int openingPeer, int closingPeer, IDocument document) throws IOException {
- if (openingPeer == '<' && !fHighlightAngularBrackets)
- return -1;
-
- fReader.configureBackwardReader(document, offset, true, true);
-
- int stack = 1;
- int c = fReader.read();
- while (c != JavaCodeReader.EOF) {
- if (c == closingPeer && c != openingPeer)
- stack++;
- else if (c == openingPeer)
- stack--;
-
- if (stack == 0) {
- if (closingPeer == '>' && !isTypeParameterBracket(fReader.getOffset(), document))
- return -1;
- return fReader.getOffset();
- }
-
- c = fReader.read();
- }
-
- return -1;
- }
-
- /**
- * Checks if the angular bracket at <code>offset</code> is a type
- * parameter bracket.
- *
- * @param offset
- * the offset of the opening bracket
- * @param document
- * the document
- * @return <code>true</code> if the bracket is part of a type parameter,
- * <code>false</code> otherwise
- * @see Eclipse 3.1
- */
- private boolean isTypeParameterBracket(int offset, IDocument document) {
- /*
- * type parameter come after braces (closing or opening), semicolons,
- * or after a Type name (heuristic: starts with capital character, or
- * after a modifier keyword in a method declaration (visibility,
- * static, synchronized, final)
- */
-
- try {
- IRegion line = document.getLineInformationOfOffset(offset);
-
- JavaHeuristicScanner scanner = new JavaHeuristicScanner(document);
- int prevToken = scanner.previousToken(offset - 1, line.getOffset());
- int prevTokenOffset = scanner.getPosition() + 1;
- String previous = prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
-
- if (prevToken == Symbols.TokenLBRACE || prevToken == Symbols.TokenRBRACE || prevToken == Symbols.TokenSEMICOLON || prevToken == Symbols.TokenSYNCHRONIZED || prevToken == Symbols.TokenSTATIC || (prevToken == Symbols.TokenIDENT && isTypeParameterIntroducer(previous)) || prevToken == Symbols.TokenEOF)
- return true;
- }
- catch (BadLocationException e) {
- return false;
- }
-
- return false;
- }
-
- /**
- * Returns <code>true</code> if <code>identifier</code> is an
- * identifier that could come right before a type parameter list. It uses
- * a heuristic: if the identifier starts with an upper case, it is assumed
- * a type name. Also, if <code>identifier</code> is a method modifier,
- * it is assumed that the angular bracket is part of the generic type
- * parameter of a method.
- *
- * @param identifier
- * the identifier to check
- * @return <code>true</code> if the identifier could introduce a type
- * parameter list
- * @see Eclipse 3.1
- */
- private boolean isTypeParameterIntroducer(String identifier) {
- return identifier.length() > 0 && (Character.isUpperCase(identifier.charAt(0)) || identifier.startsWith("final") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("public") //$NON-NLS-1$
- || identifier.startsWith("protected") //$NON-NLS-1$
- || identifier.startsWith("private")); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
deleted file mode 100644
index d88615ed60..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/Symbols.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.text;
-
-// taken from package org.eclipse.jdt.ui.text;
-
-/**
- * Symbols for the heuristic java scanner.
- *
- * @see Eclipse 3.0
- */
-interface Symbols {
- int TokenEOF = -1;
- int TokenLBRACE = 1;
- int TokenRBRACE = 2;
- int TokenLBRACKET = 3;
- int TokenRBRACKET = 4;
- int TokenLPAREN = 5;
- int TokenRPAREN = 6;
- int TokenSEMICOLON = 7;
- int TokenOTHER = 8;
- int TokenCOLON = 9;
- int TokenQUESTIONMARK = 10;
- int TokenCOMMA = 11;
- int TokenEQUAL = 12;
- int TokenLESSTHAN = 13;
- int TokenGREATERTHAN = 14;
- int TokenIF = 109;
- int TokenDO = 1010;
- int TokenFOR = 1011;
- int TokenTRY = 1012;
- int TokenCASE = 1013;
- int TokenELSE = 1014;
- int TokenBREAK = 1015;
- int TokenCATCH = 1016;
- int TokenWHILE = 1017;
- int TokenRETURN = 1018;
- int TokenSTATIC = 1019;
- int TokenSWITCH = 1020;
- int TokenFINALLY = 1021;
- int TokenSYNCHRONIZED = 1022;
- int TokenGOTO = 1023;
- int TokenDEFAULT = 1024;
- int TokenNEW = 1025;
- int TokenCLASS = 1026;
- int TokenINTERFACE = 1027;
- int TokenENUM = 1028;
- int TokenIDENT = 2000;
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java
deleted file mode 100644
index e541788044..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-class NewHTMLFileWizardPage extends WizardNewFileCreationPage {
-
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewHTMLFileWizardPage(String pageName, IStructuredSelection selection) {
- super(pageName, selection);
- }
-
- /**
- * This method is overriden to set the selected folder to web contents
- * folder if the current selection is outside the web contents folder.
- */
- protected void initialPopulateContainerNameField() {
- super.initialPopulateContainerNameField();
-
- IPath fullPath = getContainerFullPath();
- IProject project = getProjectFromPath(fullPath);
- IPath webContentPath = getWebContentPath(project);
-
- if (webContentPath != null && !webContentPath.isPrefixOf(fullPath)) {
- setContainerFullPath(webContentPath);
- }
- }
-
- /**
- * This method is overriden to set additional validation specific to
- * html files.
- */
- protected boolean validatePage() {
- setMessage(null);
- setErrorMessage(null);
-
- if (!super.validatePage()) {
- return false;
- }
-
- String fileName = getFileName();
- IPath fullPath = getContainerFullPath();
- if ((fullPath != null) && (fullPath.isEmpty() == false) && (fileName != null)) {
- // check that filename does not contain invalid extension
- if (!extensionValidForContentType(fileName)) {
- setErrorMessage(NLS.bind(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML, getValidExtensions().toString()));
- return false;
- }
- // no file extension specified so check adding default
- // extension doesn't equal a file that already exists
- if (fileName.lastIndexOf('.') == -1) {
- String newFileName = addDefaultExtension(fileName);
- IPath resourcePath = fullPath.append(newFileName);
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IStatus result = workspace.validatePath(resourcePath.toString(), IResource.FOLDER);
- if (!result.isOK()) {
- // path invalid
- setErrorMessage(result.getMessage());
- return false;
- }
-
- if ((workspace.getRoot().getFolder(resourcePath).exists() || workspace.getRoot().getFile(resourcePath).exists())) {
- setErrorMessage(HTMLUIMessages.ResourceGroup_nameExists);
- return false;
- }
- }
-
- // get the IProject for the selection path
- IProject project = getProjectFromPath(fullPath);
- // if inside web project, check if inside webContent folder
- if (project != null && isWebProject(project)) {
- // check that the path is inside the webContent folder
- IPath webContentPath = getWebContentPath(project);
- if (!webContentPath.isPrefixOf(fullPath)) {
- setMessage(HTMLUIMessages._WARNING_FOLDER_MUST_BE_INSIDE_WEB_CONTENT, WARNING);
- }
- }
- }
-
- return true;
- }
-
- /**
- * Get content type associated with this new file wizard
- *
- * @return IContentType
- */
- private IContentType getContentType() {
- if (fContentType == null)
- fContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForHTML.ContentTypeID_HTML);
- return fContentType;
- }
-
- /**
- * Get list of valid extensions for HTML Content type
- *
- * @return
- */
- private List getValidExtensions() {
- if (fValidExtensions == null) {
- IContentType type = getContentType();
- fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
- }
- return fValidExtensions;
- }
-
- /**
- * Verifies if fileName is valid name for content type. Takes base content
- * type into consideration.
- *
- * @param fileName
- * @return true if extension is valid for this content type
- */
- private boolean extensionValidForContentType(String fileName) {
- boolean valid = false;
-
- IContentType type = getContentType();
- // there is currently an extension
- if (fileName.lastIndexOf('.') != -1) {
- // check what content types are associated with current extension
- IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
- int i = 0;
- while (i < types.length && !valid) {
- valid = types[i].isKindOf(type);
- ++i;
- }
- }
- else
- valid = true; // no extension so valid
- return valid;
- }
-
- /**
- * Adds default extension to the filename
- *
- * @param filename
- * @return
- */
- String addDefaultExtension(String filename) {
- StringBuffer newFileName = new StringBuffer(filename);
-
- Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
- String ext = preference.getString(HTMLCorePreferenceNames.DEFAULT_EXTENSION);
-
- newFileName.append("."); //$NON-NLS-1$
- newFileName.append(ext);
-
- return newFileName.toString();
- }
-
- /**
- * Returns the project that contains the specified path
- *
- * @param path the path which project is needed
- * @return IProject object. If path is <code>null</code> the return value
- * is also <code>null</code>.
- */
- private IProject getProjectFromPath(IPath path) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IProject project = null;
-
- if (path != null) {
- if (workspace.validatePath(path.toString(), IResource.PROJECT).isOK()) {
- project = workspace.getRoot().getProject(path.toString());
- } else {
- project = workspace.getRoot().getFile(path).getProject();
- }
- }
-
- return project;
- }
-
- /**
- * Checks if the specified project is a web project.
- *
- * @param project project to be checked
- * @return true if the project is web project, otherwise false
- */
- private boolean isWebProject(IProject project) {
- IFacetedProject faceted = null;
- try {
- faceted = ProjectFacetsManager.create(project);
- } catch (CoreException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
-
- if (faceted != null &&
- (faceted.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.WST_WEB_MODULE)) ||
- faceted.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE)))) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Returns the web contents folder of the specified project
- *
- * @param project the project which web contents path is needed
- * @return IPath of the web contents folder
- */
- private IPath getWebContentPath(IProject project) {
- IPath path = null;
-
- if (project != null && isWebProject(project)) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- path = component.getRootFolder().getWorkspaceRelativePath();
- }
-
- return path;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
deleted file mode 100644
index d5b61db301..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java
+++ /dev/null
@@ -1,474 +0,0 @@
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.templates.DocumentTemplateContext;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateBuffer;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-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.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-
-/**
- * Templates page in new file wizard. Allows users to select a new file
- * template to be applied in new file.
- *
- */
-public class NewHTMLTemplatesWizardPage extends WizardPage {
-
- /**
- * Content provider for templates
- */
- private class TemplateContentProvider implements IStructuredContentProvider {
- /** The template store. */
- private TemplateStore fStore;
-
- /*
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- fStore = null;
- }
-
- /*
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object input) {
- return fStore.getTemplates(TemplateContextTypeIdsHTML.NEW);
- }
-
- /*
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fStore = (TemplateStore) newInput;
- }
- }
-
- /**
- * Label provider for templates.
- */
- private class TemplateLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- /*
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object,
- * int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /*
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
- * int)
- */
- public String getColumnText(Object element, int columnIndex) {
- Template template = (Template) element;
-
- switch (columnIndex) {
- case 0 :
- return template.getName();
- case 1 :
- return template.getDescription();
- default :
- return ""; //$NON-NLS-1$
- }
- }
- }
-
- /** Last selected template name */
- private String fLastSelectedTemplateName;
- /** The viewer displays the pattern of selected template. */
- private SourceViewer fPatternViewer;
- /** The table presenting the templates. */
- private TableViewer fTableViewer;
- /** Template store used by this wizard page */
- private TemplateStore fTemplateStore;
- /** Checkbox for using templates. */
- private Button fUseTemplateButton;
-
- public NewHTMLTemplatesWizardPage() {
- super("NewHTMLTemplatesWizardPage", HTMLUIMessages.NewHTMLTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(HTMLUIMessages.NewHTMLTemplatesWizardPage_1);
- }
-
- /**
- * Correctly resizes the table so no phantom columns appear
- *
- * @param parent
- * the parent control
- * @param buttons
- * the buttons
- * @param table
- * the table
- * @param column1
- * the first column
- * @param column2
- * the second column
- * @param column3
- * the third column
- */
- private void configureTableResizing(final Composite parent, final Table table, final TableColumn column1, final TableColumn column2) {
- parent.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area = parent.getClientArea();
- Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * table.getBorderWidth();
- if (preferredSize.y > area.height) {
- // Subtract the scrollbar width from the total column
- // width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
-
- Point oldSize = table.getSize();
- if (oldSize.x > width) {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- table.setSize(width, area.height);
- }
- else {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- table.setSize(width, area.height);
- column1.setWidth(width / 2);
- column2.setWidth(width / 2);
- }
- }
- });
- }
-
- public void createControl(Composite ancestor) {
- Composite parent = new Composite(ancestor, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- parent.setLayout(layout);
-
- // create checkbox for user to use HTML Template
- fUseTemplateButton = new Button(parent, SWT.CHECK);
- fUseTemplateButton.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_4);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- fUseTemplateButton.setLayoutData(data);
- fUseTemplateButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- enableTemplates();
- }
- });
-
- // create composite for Templates table
- Composite innerParent = new Composite(parent, SWT.NONE);
- GridLayout innerLayout = new GridLayout();
- innerLayout.numColumns = 2;
- innerLayout.marginHeight = 0;
- innerLayout.marginWidth = 0;
- innerParent.setLayout(innerLayout);
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
- innerParent.setLayoutData(gd);
-
- // Create linked text to just to templates preference page
- Link link = new Link(innerParent, SWT.NONE);
- link.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_6);
- data = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- link.setLayoutData(data);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- linkClicked();
- }
- });
-
- // create table that displays templates
- Table table = new Table(innerParent, SWT.BORDER | SWT.FULL_SELECTION);
-
- data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertWidthInCharsToPixels(2);
- data.heightHint = convertHeightInCharsToPixels(10);
- data.horizontalSpan = 2;
- table.setLayoutData(data);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- TableLayout tableLayout = new TableLayout();
- table.setLayout(tableLayout);
-
- TableColumn column1 = new TableColumn(table, SWT.NONE);
- column1.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_3);
-
- fTableViewer = new TableViewer(table);
- fTableViewer.setLabelProvider(new TemplateLabelProvider());
- fTableViewer.setContentProvider(new TemplateContentProvider());
-
- fTableViewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object object1, Object object2) {
- if ((object1 instanceof Template) && (object2 instanceof Template)) {
- Template left = (Template) object1;
- Template right = (Template) object2;
- int result = left.getName().compareToIgnoreCase(right.getName());
- if (result != 0)
- return result;
- return left.getDescription().compareToIgnoreCase(right.getDescription());
- }
- return super.compare(viewer, object1, object2);
- }
-
- public boolean isSorterProperty(Object element, String property) {
- return true;
- }
- });
-
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- updateViewerInput();
- }
- });
-
- // create viewer that displays currently selected template's contents
- fPatternViewer = doCreateViewer(parent);
-
- fTemplateStore = HTMLUIPlugin.getDefault().getTemplateStore();
- fTableViewer.setInput(fTemplateStore);
-
- configureTableResizing(innerParent, table, column1, column2);
- loadLastSavedPreferences();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.HTML_NEWWIZARD_TEMPLATE_HELPID);
- Dialog.applyDialogFont(parent);
- setControl(parent);
- }
-
- /**
- * Creates, configures and returns a source viewer to present the template
- * pattern on the preference page. Clients may override to provide a
- * custom source viewer featuring e.g. syntax coloring.
- *
- * @param parent
- * the parent control
- * @return a configured source viewer
- */
- private SourceViewer createViewer(Composite parent) {
- SourceViewer viewer = new SourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- SourceViewerConfiguration configuration = new SourceViewerConfiguration();
- viewer.configure(configuration);
- IDocument document = new Document();
- viewer.setDocument(document);
- return viewer;
- }
-
- private SourceViewer doCreateViewer(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(HTMLUIMessages.NewHTMLTemplatesWizardPage_5);
- GridData data = new GridData();
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- SourceViewer viewer = createViewer(parent);
- viewer.setEditable(false);
-
- Control control = viewer.getControl();
- data = new GridData(GridData.FILL_BOTH);
- data.horizontalSpan = 2;
- data.heightHint = convertHeightInCharsToPixels(5);
- control.setLayoutData(data);
-
- return viewer;
- }
-
- /**
- * Enable/disable controls in page based on fUseTemplateButton's current
- * state.
- */
- void enableTemplates() {
- boolean enabled = fUseTemplateButton.getSelection();
-
- if (!enabled) {
- // save last selected template
- Template template = getSelectedTemplate();
- if (template != null)
- fLastSelectedTemplateName = template.getName();
- else
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
-
- fTableViewer.setSelection(null);
- }
- else {
- setSelectedTemplate(fLastSelectedTemplateName);
- }
-
- fTableViewer.getControl().setEnabled(enabled);
- fPatternViewer.getControl().setEnabled(enabled);
- }
-
- /**
- * Return the template preference page id
- *
- * @return
- */
- private String getPreferencePageId() {
- return "org.eclipse.wst.html.ui.preferences.templates"; //$NON-NLS-1$
- }
-
- /**
- * Get the currently selected template.
- *
- * @return
- */
- private Template getSelectedTemplate() {
- Template template = null;
- IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
-
- if (selection.size() == 1) {
- template = (Template) selection.getFirstElement();
- }
- return template;
- }
-
- /**
- * Returns template string to insert.
- *
- * @return String to insert or null if none is to be inserted
- */
- String getTemplateString() {
- String templateString = null;
-
- Template template = getSelectedTemplate();
- if (template != null) {
- TemplateContextType contextType = HTMLUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsHTML.NEW);
- IDocument document = new Document();
- TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
- try {
- TemplateBuffer buffer = context.evaluate(template);
- templateString = buffer.getString();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Could not create template for new html", e); //$NON-NLS-1$
- }
- }
-
- return templateString;
- }
-
- void linkClicked() {
- String pageId = getPreferencePageId();
- PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), pageId, new String[]{pageId}, null);
- dialog.open();
- fTableViewer.refresh();
- }
-
- /**
- * Load the last template name used in New HTML File wizard.
- */
- private void loadLastSavedPreferences() {
- String templateName = HTMLUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME);
- if (templateName == null || templateName.length() == 0) {
- fLastSelectedTemplateName = ""; //$NON-NLS-1$
- fUseTemplateButton.setSelection(false);
- }
- else {
- fLastSelectedTemplateName = templateName;
- fUseTemplateButton.setSelection(true);
- }
- enableTemplates();
- }
-
- /**
- * Save template name used for next call to New HTML File wizard.
- */
- void saveLastSavedPreferences() {
- String templateName = ""; //$NON-NLS-1$
-
- Template template = getSelectedTemplate();
- if (template != null) {
- templateName = template.getName();
- }
-
- HTMLUIPlugin.getDefault().getPreferenceStore().setValue(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME, templateName);
- HTMLUIPlugin.getDefault().savePluginPreferences();
- }
-
- /**
- * Select a template in the table viewer given the template name. If
- * template name cannot be found or templateName is null, just select
- * first item in table. If no items in table select nothing.
- *
- * @param templateName
- */
- private void setSelectedTemplate(String templateName) {
- Object template = null;
-
- if (templateName != null && templateName.length() > 0) {
- // pick the last used template
- template = fTemplateStore.findTemplate(templateName, TemplateContextTypeIdsHTML.NEW);
- }
-
- // no record of last used template so just pick first element
- if (template == null) {
- // just pick first element
- template = fTableViewer.getElementAt(0);
- }
-
- if (template != null) {
- IStructuredSelection selection = new StructuredSelection(template);
- fTableViewer.setSelection(selection, true);
- }
- }
-
- /**
- * Updates the pattern viewer.
- */
- void updateViewerInput() {
- Template template = getSelectedTemplate();
- if (template != null) {
- fPatternViewer.getDocument().set(template.getPattern());
- }
- else {
- fPatternViewer.getDocument().set(""); //$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
deleted file mode 100644
index 7c5741eb14..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStreamWriter;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-public class NewHTMLWizard extends Wizard implements INewWizard {
-
- private NewHTMLFileWizardPage fNewFilePage;
- private NewHTMLTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- public void addPages() {
- fNewFilePage = new NewHTMLFileWizardPage("HTMLWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
- fNewFilePage.setTitle(HTMLUIMessages._UI_WIZARD_NEW_HEADING);
- fNewFilePage.setDescription(HTMLUIMessages._UI_WIZARD_NEW_DESCRIPTION);
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewHTMLTemplatesWizardPage();
- addPage(fNewFileTemplatesPage);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- fSelection = aSelection;
- setWindowTitle(HTMLUIMessages._UI_WIZARD_NEW_TITLE);
-
- ImageDescriptor descriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(HTMLEditorPluginImages.IMG_WIZBAN_NEWHTMLFILE);
- setDefaultPageImageDescriptor(descriptor);
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- });
- }
- }
-
- public boolean performFinish() {
- boolean performedOK = false;
- // save user options for next use
- fNewFileTemplatesPage.saveLastSavedPreferences();
-
- // no file extension specified so add default extension
- String fileName = fNewFilePage.getFileName();
- if (fileName.lastIndexOf('.') == -1) {
- String newFileName = fNewFilePage.addDefaultExtension(fileName);
- fNewFilePage.setFileName(newFileName);
- }
-
- // create a new empty file
- IFile file = fNewFilePage.createNewFile();
-
- // if there was problem with creating file, it will be null, so make
- // sure to check
- if (file != null) {
- // put template contents into file
- String templateString = fNewFileTemplatesPage.getTemplateString();
- if (templateString != null) {
- // determine the encoding for the new file
- Preferences preference = HTMLCorePlugin.getDefault().getPluginPreferences();
- String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
-
- try {
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- OutputStreamWriter outputStreamWriter = null;
- if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
- // just use default encoding
- outputStreamWriter = new OutputStreamWriter(outputStream);
- }
- else {
- outputStreamWriter = new OutputStreamWriter(outputStream, charSet);
- }
- outputStreamWriter.write(templateString);
- outputStreamWriter.flush();
- outputStreamWriter.close();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- file.setContents(inputStream, true, false, null);
- inputStream.close();
- }
- catch (Exception e) {
- Logger.log(Logger.WARNING_DEBUG, "Could not create contents for new HTML file", e); //$NON-NLS-1$
- }
- }
-
- // open the file in editor
- openEditor(file);
-
- // everything's fine
- performedOK = true;
- }
- return performedOK;
- }
-} \ 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 421420430d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/views/contentoutline/HTMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
-
-/**
- * Configuration for outline view page which shows HTML content.
- *
- * @see org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- * @since 1.0
- */
-public class HTMLContentOutlineConfiguration extends XMLContentOutlineConfiguration {
-
- /**
- * Create new instance of HTMLContentOutlineConfiguration
- */
- public HTMLContentOutlineConfiguration() {
- // Must have empty constructor to createExecutableExtension
- super();
- }
-
- protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
- return new HTMLNodeActionManager((IStructuredModel) treeViewer.getInput(), treeViewer);
- }
-
- protected IPreferenceStore getPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-} \ 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 7c3ab5d032..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.properties
+++ /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
-###############################################################################
-Templates.comment.name=comment
-Templates.comment.desc=comment
-Templates.ul.name=ul
-Templates.ul.desc=unordered list
-Templates.ul.content=<ul>\n <li> Item one </li>\n <li> Item two </li>\n</ul>\n
-Templates.dl.name=dl
-Templates.dl.desc=definition list
-Templates.dl.content=<dl>\n <dt> First definition</dt> <dd> First explanation</dd>\n <dt> Second definition</dt> <dd> Second explanation</dd>\n</dl>\n
-Templates.table.name=table
-Templates.table.desc=table
-Templates.table.content=<table>\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=ordered list
-Templates.ol.content=<ol>\n <li> Item one </li>\n <li> Item two </li>\n</ol>\n
-Templates.html.name=New HTML File (4.01 transitional)
-Templates.html.desc=html 4.01 transitional
-Templates.html.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.htmlframeset.name=New HTML File (4.01 frameset)
-Templates.htmlframeset.desc=html 4.01 frameset
-Templates.htmlframeset.content=<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}">\n<title>Insert title here</title>\n</head>\n<frameset>\n <frame>\n <frame>\n <noframes>\n <body>\n <p>This page uses frames. The current browser you are using does not support frames.</p>\n </body>\n </noframes>\n</frameset>\n</html>
-Templates.xhtml.name=New XHTML File (1.0 transitional)
-Templates.xhtml.desc=xhtml 1.0 transitional
-Templates.xhtml.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<body>\n${cursor}\n</body>\n</html>
-Templates.xhtmlframeset.name=New XHTML File (1.0 frameset)
-Templates.xhtmlframeset.desc=xhtml 1.0 frameset
-Templates.xhtmlframeset.content=<?xml version="1.0" encoding="${encoding}" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=${encoding}" />\n<title>Insert title here</title>\n</head>\n<frameset>\n <frame />\n <frame />\n <noframes>\n <body>\n <p>This page uses frames. The current browser you are using does not support frames.</p>\n </body>\n </noframes>\n</frameset>\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 b51832aae9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-
-<template name="%Templates.comment.name" description="%Templates.comment.desc" id="org.eclipse.wst.html.ui.templates.comment" context="html_tag" enabled="true">&lt;!-- ${cursor} --&gt;</template>
-
-<template name="%Templates.imgmap.name" description="%Templates.imgmap.desc" id="org.eclipse.wst.html.ui.templates.imgmap" context="html_tag" enabled="true">&lt;img ismap&gt;</template>
-
-<template name="%Templates.ul.name" description="%Templates.ul.desc" id="org.eclipse.wst.html.ui.templates.ul" context="html_tag" enabled="true">%Templates.ul.content</template>
-
-<template name="%Templates.dl.name" description="%Templates.dl.desc" id="org.eclipse.wst.html.ui.templates.dl" context="html_tag" enabled="true">%Templates.dl.content</template>
-
-<template name="%Templates.table.name" description="%Templates.table.desc" id="org.eclipse.wst.html.ui.templates.table" context="html_tag" enabled="true">%Templates.table.content</template>
-
-<template name="%Templates.ol.name" description="%Templates.ol.desc" id="org.eclipse.wst.html.ui.templates.ol" context="html_tag" enabled="true">%Templates.ol.content</template>
-
-<template name="%Templates.html.name" description="%Templates.html.desc" id="org.eclipse.wst.html.ui.templates.html" context="html_new" enabled="true">%Templates.html.content</template>
-
-<template name="%Templates.htmlframeset.name" description="%Templates.htmlframeset.desc" id="org.eclipse.wst.html.ui.templates.htmlframeset" context="html_new" enabled="true">%Templates.htmlframeset.content</template>
-
-<template name="%Templates.xhtml.name" description="%Templates.xhtml.desc" id="org.eclipse.wst.html.ui.templates.xhtml" context="html_new" enabled="true">%Templates.xhtml.content</template>
-
-<template name="%Templates.xhtmlframeset.name" description="%Templates.xhtmlframeset.desc" id="org.eclipse.wst.html.ui.templates.xhtmlframeset" context="html_new" enabled="true">%Templates.xhtmlframeset.content</template>
-
-<template name="%Templates.script.name" description="%Templates.script.desc" id="org.eclipse.wst.html.ui.templates.script" context="html_tag" enabled="true">%Templates.script.content</template>
-
-<template name="%Templates.style.name" description="%Templates.style.desc" id="org.eclipse.wst.html.ui.templates.style" context="html_tag" enabled="true">%Templates.style.content</template>
-
-</templates>
diff --git a/bundles/org.eclipse.wst.sse.ui/.classpath b/bundles/org.eclipse.wst.sse.ui/.classpath
deleted file mode 100644
index bc5a5650cd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="src-extensions/"/>
- <classpathentry kind="src" path="src-encoding"/>
- <classpathentry kind="src" path="src-tasktags"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.sse.ui/.cvsignore b/bundles/org.eclipse.wst.sse.ui/.cvsignore
deleted file mode 100644
index 2b6bc40b23..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-editor.jar
-build.xml
-temp.folder
-org.eclipse.wst.sse.ui_1.0.0.jar
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.sse.ui/.options b/bundles/org.eclipse.wst.sse.ui/.options
deleted file mode 100644
index 32f219471d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.options
+++ /dev/null
@@ -1,66 +0,0 @@
-org.eclipse.wst.sse.ui/debug=true
-org.eclipse.wst.sse.ui/debug/tracefilter=
-
-#org.eclipse.wst.sse.ui.edit.util.ActionContributer._showDebugStatus
-org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields=false
-
-
-#org.eclipse.wst.sse.ui.extension.TransferBuilder.debugTime
-org.eclipse.wst.sse.ui/transferbuilder/time=false
-
-org.eclipse.wst.sse.ui/extendedconfigurationbuilder=false
-#org.eclipse.wst.sse.ui.extension.ExtendedConfigurationBuilder.debugTime
-org.eclipse.wst.sse.ui/extendedconfigurationbuilder/time=false
-
-
-org.eclipse.wst.sse.ui/extendededitoractionbuilder=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugReadTime
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/readtime=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugContributeTime
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/contributetime=false
-
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugMenu
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugmenu=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugPopup
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugpopup=false
-
-#org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder.debugToolbar
-org.eclipse.wst.sse.ui/extendededitoractionbuilder/debugtoolbar=false
-
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugOperations
-org.eclipse.wst.sse.ui/filemodelprovider/operations=false
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugLifecyclelistener
-org.eclipse.wst.sse.ui/filemodelprovider/lifecyclelistener=false
-
-#org.eclipse.wst.sse.ui.FileModelProvider.debugModelStatelistener
-org.eclipse.wst.sse.ui/filemodelprovider/modelstatelistener=false
-
-
-#org.eclipse.wst.sse.ui.StorageModelProvider.debugOperations
-org.eclipse.wst.sse.ui/storagemodelprovider/operations=false
-
-#org.eclipse.wst.sse.ui.StorageModelProvider.debugElementStatelistener
-org.eclipse.wst.sse.ui/storagemodelprovider/elementstatelistener=false
-
-org.eclipse.wst.sse.ui/contentOutline=false
-org.eclipse.wst.sse.ui/propertySheet=false
-
-#org.eclipse.wst.sse.ui.views.contentoutline.PropertyChangeUpdateActionContributionItem.debug
-org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerjob=false
-
-#org.eclipse.wst.sse.ui.internal.GotoAnnotationAction._debug
-org.eclipse.wst.sse.ui/gotoNextAnnotation=false
-
-org.eclipse.wst.sse.ui/preferences-properties=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerSpelling=false
-
-org.eclipse.wst.sse.ui/debug/reconcilerValidators=false
diff --git a/bundles/org.eclipse.wst.sse.ui/.project b/bundles/org.eclipse.wst.sse.ui/.project
deleted file mode 100644
index 78bd94c674..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.project
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.sse.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.sse.ui/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 782e417e41..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,80 +0,0 @@
-#Sun Apr 16 17:23:39 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=ignore
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=error
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index ef2ac6532b..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:39 EDT 2006
-eclipse.preferences.version=1
-internal.default.compliance=default
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.ltk.core.refactoring.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 04 03:36:32 EDT 2006
-eclipse.preferences.version=1
-org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 222372317a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Sun Apr 16 14:05:29 EDT 2006
-compilers.p.build=0
-compilers.p.deprecated=1
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 8f831f60f1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,65 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true
-Bundle-Version: 1.0.205.qualifier
-Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.ui,
- org.eclipse.wst.sse.ui.internal;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.actions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentassist;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentoutline;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.contentproperties.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.correction;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.debug;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.derived;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.edit.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.editor;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.encoding.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.extension;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.format;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.hyperlink;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.openon;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.preferences;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.preferences.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.projection;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.properties;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.extensions;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.extensions.breakpoint;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.preferences;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.registry;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.provisional.style;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.reconcile;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.reconcile.validator;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.search;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.selection;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.spelling;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.taginfo;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.text;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.ui;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.util;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.internal.view.events;x-friends:="org.eclipse.wst.dtd.ui,org.eclipse.wst.xml.ui,org.eclipse.wst.xsd.ui",
- org.eclipse.wst.sse.ui.views.contentoutline,
- org.eclipse.wst.sse.ui.views.properties
-Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.debug.core;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.debug.ui;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.editors;visibility:=reexport;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.search;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.swt;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.jface;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.workbench;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.ui.views;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.core.filebuffers;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.core.runtime;bundle-version="[3.2.0,3.3.0)",
- org.eclipse.wst.validation;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.emf.common;bundle-version="[2.2.0,2.3.0)",
- com.ibm.icu;bundle-version="[3.4.4,3.5.0)"
-Eclipse-LazyStart: true
diff --git a/bundles/org.eclipse.wst.sse.ui/README.txt b/bundles/org.eclipse.wst.sse.ui/README.txt
deleted file mode 100644
index efe452223f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-The base editor of the sse framework. It provides the hooks for content assist,
-breakpoints, debugging, open-on, quickfix, spell checking and a content outline. \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/about.html b/bundles/org.eclipse.wst.sse.ui/about.html
deleted file mode 100644
index 4ec5989581..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 2, 2006</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/bundles/org.eclipse.wst.sse.ui/build.properties b/bundles/org.eclipse.wst.sse.ui/build.properties
deleted file mode 100644
index a5b77bebc1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/build.properties
+++ /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
-#
-###############################################################################
-bin.includes = plugin.xml,\
- .options,\
- .,\
- icons/,\
- plugin.properties,\
- META-INF/,\
- about.html
-bin.excludes = bin/**,\
- @dot/**,\
- temp.folder/**
-src.includes = toc.xml,\
- testToc.xml,\
- schema/,\
- html/
-source.. = src/,\
- src-extensions/,\
- src-encoding,\
- src-tasktags/
diff --git a/bundles/org.eclipse.wst.sse.ui/html/maintopic.html b/bundles/org.eclipse.wst.sse.ui/html/maintopic.html
deleted file mode 100644
index a476078ace..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/html/maintopic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Main Topic</title>
-</head>
-
-<body>
-<h1>Main Topic</h1>
-Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/html/subtopic.html b/bundles/org.eclipse.wst.sse.ui/html/subtopic.html
deleted file mode 100644
index 8a61c501d6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/html/subtopic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Sub Topic</title>
-</head>
-
-<body>
-<h1>Sub Topic</h1>
-Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/html/toc.html b/bundles/org.eclipse.wst.sse.ui/html/toc.html
deleted file mode 100644
index 326f0a9ff3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/html/toc.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Table of Contents</title>
-</head>
-
-<body>
-<h1>Table of Contents</h1>
-Please enter your text here.
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif
deleted file mode 100644
index c71de32fce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/ctool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif
deleted file mode 100644
index 7dc0de5130..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif
deleted file mode 100644
index 2e197c25e8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif
deleted file mode 100644
index 4b9e567edd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dlcl16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif
deleted file mode 100644
index a4cf55ffe9..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/dtool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif
deleted file mode 100644
index a2d80a9044..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/collapseall.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif
deleted file mode 100644
index 0ae6decd03..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/delete.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif
deleted file mode 100644
index 05cefef687..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/elcl16/synced.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif
deleted file mode 100644
index c71de32fce..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/etool16/spellcheck.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif
deleted file mode 100644
index 9e033dea5f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/occ_match.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif
deleted file mode 100644
index 4c07fea144..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/preferences.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif b/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif
deleted file mode 100644
index 3aec64dbdd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/full/obj16/prop_ps.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif b/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8586..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.properties b/bundles/org.eclipse.wst.sse.ui/plugin.properties
deleted file mode 100644
index dbbb50c62c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/plugin.properties
+++ /dev/null
@@ -1,81 +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
-#
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source Editor
-Standalone_Structured_Source_Editor.name=Standalone Structured Source Editor
-# Name on preferences page
-WEB_AND_XML_Files.name=Web and XML
-Structured_Text_Editor.name=Structured Text Editors
-Task_Tags_Preferences.name=Task Tags
-
-#
-sourceEditorFontDefiniton.label=Structured Text Editor Text Font
-sourceEditorFontDefintion.description=The Structured text editor text font is used by Structured text editors.
-
-Adapter_Factory_Description_Extension.name=Adapter Factory Description Extension
-Extended_Editor_Actions_Extension.name=Extended Editor Actions Extension
-Drop_Target_Transfers_Extension.name=Drop Target Transfers Extension
-Extended_Editor_Configuration_Extension.name=Extended Editor Configuration Extension
-##########################################################################
-# These strings are used in Workbench Keys Preferences
-##########################################################################
-scope.structuredTextEditor.name=Editing in Structured Text Editors
-scope.structuredTextEditor.description=Editing in Structured Text Editors
-command.toggle.comment.name=Toggle Comment
-command.toggle.comment.description=Toggle Comment
-command.add.block.comment.name=Add Block Comment
-command.add.block.comment.description=Add Block Comment
-command.remove.block.comment.name=Remove Block Comment
-command.remove.block.comment.description=Remove Block Comment
-command.cleanup.document.name=Cleanup Document
-command.cleanup.document.description=Cleanup document
-command.format.document.name=Format Document
-command.format.document.description=Format document
-command.format.active.elements.name=Format Active Elements
-command.format.active.elements.description=Format active elements
-command.open.file.from.source.name=Open Selection
-command.open.file.from.source.description=Open an editor on the selected link
-command.search.find.occurrences.name=Occurrences in File
-command.search.find.occurrences.description=Find occurrences of the selection in the file
-ActionDefinition.selectEnclosing.name=Select Enclosing Element
-ActionDefinition.selectEnclosing.description=Expand selection to include enclosing element
-ActionDefinition.selectNext.name=Select Next Element
-ActionDefinition.selectNext.description=Expand selection to include next sibling
-ActionDefinition.selectPrevious.name=Select Previous Element
-ActionDefinition.selectPrevious.description=Expand selection to include previous sibling
-ActionDefinition.selectLast.name=Restore Last Selection
-ActionDefinition.selectLast.description=Restore last selection
-ActionDefinition.showJavadoc.name=Show Tooltip Description
-ActionDefinition.showJavadoc.description=Displays the hover help for the selected element
-ActionDefinition.quickFix.name=Quick Fix
-ActionDefinition.quickFix.description=Quick Fix
-
-#
-AddBookmark.label=Add Boo&kmark...
-SelectRuler.label=Select Ruler
-#
-##########################################################################
-# These strings are used in file and container resource popup menu
-##########################################################################
-Source=&Source
-FormatDocument=&Format document
-##
-Breakpoint_Extension_Point.name=Breakpoint Extension Point
-Source_Validation_Extension_Point.name=Reconcile Validator Extension Point
-###############################################################################
-# The following property keys maybe unused. Commented out on 4/12/2005. Uncomment if needed.
-#Bean_Info_Provider_Extension.name=Bean Info Provider Extension
-#SpellCheck_Extension_Point.name=SpellCheck Extension Point
-#Open_On_Extension_Point.name=Open On Extension Point
-#Spell_Check_label=Spell Check
-#Spell_Check_tooltip=Spell Check
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.xml b/bundles/org.eclipse.wst.sse.ui/plugin.xml
deleted file mode 100644
index 0d1925d42a..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/plugin.xml
+++ /dev/null
@@ -1,474 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point
- id="adapterFactoryDescription"
- name="%Adapter_Factory_Description_Extension.name" />
- <extension-point
- id="extendedEditorActions"
- name="%Extended_Editor_Actions_Extension.name" />
- <extension-point
- id="dropTargetTransfers"
- name="%Drop_Target_Transfers_Extension.name" />
- <extension-point
- id="editorConfiguration"
- name="%Extended_Editor_Configuration_Extension.name"
- schema="schema/editorconfiguration.exsd" />
-
-
- <!-- Make sure default preference values are set at runtime -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.sse.ui.internal.PreferenceInitializer" />
- </extension>
-
-
- <!-- reusable extensions -->
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration"
- target="org.eclipse.wst.sse.ui.StructuredTextEditor" />
- <provisionalDefinition
- type="preferencepages"
- value="org.eclipse.wst.sse.ui.preferences.editor"
- target="org.eclipse.wst.sse.ui.StructuredTextEditor" />
- </extension>
- <!-- associate the NavigateActionSet with various parts of the XML perspective-->
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation
- targetID="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <part
- id="org.eclipse.wst.sse.ui.StructuredTextEditor">
- </part>
- </actionSetPartAssociation>
- <actionSetPartAssociation
- targetID="org.eclipse.ui.NavigateActionSet">
- <!--
- <part id="org.eclipse.ui.views.ResourceNavigator"/>
- <part id="org.eclipse.ui.views.ContentOutline"/>
- -->
- <!--
- should probably only "force" association of action sets for workbench parts that we own
- or only if the view is focusse in the XMLPerspective
- -->
- <part
- id="org.eclipse.wst.sse.ui.StructuredTextEditor">
- </part>
- </actionSetPartAssociation>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <!-- ROOT PREFERENCE PAGE FOR WEB AND XML FILES -->
- <!-- Comment out for now since this preference page is not used
- <page
- name="%WEB_AND_XML_Files.name"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.FilePreferencePage"
- id="org.eclipse.wst.sse.ui.internal.provisional.preferences">
- </page>
- -->
- <page
- name="%WEB_AND_XML_Files.name"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.EmptyFilePreferencePage"
- id="org.eclipse.wst.sse.ui.internal.provisional.preferences">
- </page>
- <!-- "common" task tags preference page -->
- <page
- name="%Task_Tags_Preferences.name"
- category="org.eclipse.wst.sse.ui.internal.provisional.preferences"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.TaskTagPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.tasktags">
- </page>
-
- <!-- Source Editor Preference page under Workbench->Editors -->
- <page
- name="%Structured_Text_Editor.name"
- category="org.eclipse.ui.preferencePages.Editors"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.StructuredTextEditorPreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.editor">
- </page>
- </extension>
- <!-- ================================================================================================ -->
- <!-- common task tags property page -->
- <!-- ================================================================================================ -->
- <extension point="org.eclipse.ui.propertyPages">
- <page
- id="org.eclipse.wst.sse.ui.project.properties.tasktags"
- name="%Task_Tags_Preferences.name"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true"
- class="org.eclipse.wst.sse.ui.internal.preferences.ui.TaskTagPreferencePage" />
- </extension>
-
- <!--
- <extension-point id="dragSourceTransfers" name="Drag Source Transfers"/>
- -->
- <extension point="org.eclipse.ui.commands">
- <!-- Edit commands -->
- <command
- name="%ActionDefinition.selectEnclosing.name"
- description="%ActionDefinition.selectEnclosing.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.enclosing">
- </command>
- <command
- name="%ActionDefinition.selectNext.name"
- description="%ActionDefinition.selectNext.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.next">
- </command>
- <command
- name="%ActionDefinition.selectPrevious.name"
- description="%ActionDefinition.selectPrevious.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.previous">
- </command>
- <command
- name="%ActionDefinition.selectLast.name"
- description="%ActionDefinition.selectLast.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.structure.select.last">
- </command>
- <command
- name="%ActionDefinition.showJavadoc.name"
- description="%ActionDefinition.showJavadoc.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.show.javadoc">
- </command>
- <command
- name="%ActionDefinition.quickFix.name"
- description="%ActionDefinition.quickFix.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.edit.text.java.correction.assist.proposals">
- </command>
- <!-- Source commands -->
- <command
- name="%command.toggle.comment.name"
- description="%command.toggle.comment.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.toggle.comment">
- </command>
- <command
- name="%command.add.block.comment.name"
- description="%command.add.block.comment.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.add.block.comment">
- </command>
- <command
- name="%command.remove.block.comment.name"
- description="%command.remove.block.comment.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.remove.block.comment">
- </command>
- <command
- name="%command.cleanup.document.name"
- description="%command.cleanup.document.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.cleanup.document">
- </command>
- <command
- name="%command.format.document.name"
- description="%command.format.document.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.format.document">
- </command>
- <command
- name="%command.format.active.elements.name"
- description="%command.format.active.elements.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.format.active.elements">
- </command>
- <!-- Navigate commands -->
- <command
- name="%command.open.file.from.source.name"
- description="%command.open.file.from.source.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.open.file.from.source">
- </command>
- <!-- Find Occurrences -->
- <command
- name="%command.search.find.occurrences.name"
- description="%command.search.find.occurrences.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.wst.sse.ui.search.find.occurrences">
- </command>
- </extension>
- <!-- Keybinding scope for source editor -->
- <extension point="org.eclipse.ui.contexts">
- <context
- name="%scope.structuredTextEditor.name"
- parentId="org.eclipse.ui.textEditorScope"
- description="%scope.structuredTextEditor.description"
- id="org.eclipse.wst.sse.ui.structuredTextEditorScope">
- </context>
- </extension>
- <!-- Keybindings for source editor -->
- <extension point="org.eclipse.ui.bindings">
- <!-- win32: M1=CTRL, M2=SHIFT, M3=ALT -->
- <!-- Edit commands -->
- <key
- sequence="M2+M3+ARROW_UP"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.enclosing"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M2+M3+ARROW_RIGHT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.next"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M2+M3+ARROW_LEFT"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.previous"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M2+M3+ARROW_DOWN"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.structure.select.last"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="F2"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.show.javadoc"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+1"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.edit.text.java.correction.assist.proposals"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <!-- Source commands -->
- <key
- sequence="M1+M2+C"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.toggle.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+M2+/"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.add.block.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+M2+\"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.remove.block.comment"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+M2+F"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.format.document"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <key
- sequence="M1+I"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.format.active.elements"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <!-- Navigate commands -->
- <key
- sequence="F3"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.open.file.from.source"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- <!-- Find Occurrences -->
- <key
- sequence="M1+M2+A"
- contextId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- commandId="org.eclipse.wst.sse.ui.search.find.occurrences"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </key>
- </extension>
- <!-- Font and colors contributions -->
- <extension point="org.eclipse.ui.themes">
- <themeElementCategory
- label="%Structured_Text_Editor.name"
- id="org.eclipse.wst.sse.ui">
- </themeElementCategory>
- <fontDefinition
- label="%sourceEditorFontDefiniton.label"
- categoryId="org.eclipse.wst.sse.ui"
- defaultsTo="org.eclipse.jface.textfont"
- id="org.eclipse.wst.sse.ui.textfont">
- <description>
- %sourceEditorFontDefintion.description
- </description>
- </fontDefinition>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.dropTargetTransfers">
- <dropTargetContribution
- targetID="org.eclipse.wst.sse.ui.StructuredTextEditor"
- id="org.eclipse.wst.sse.ui.extension.ExtendedTransfers">
- <transfer
- priority="mid"
- singleton="true"
- class="org.eclipse.swt.dnd.FileTransfer"
- method="getInstance"
- id="org.eclipse.swt.dnd.FileTransfer">
- </transfer>
- <dropAction
- class="org.eclipse.wst.sse.ui.internal.FileDropAction"
- transferID="org.eclipse.swt.dnd.FileTransfer"
- id="org.eclipse.wst.sse.ui.internal.FileDropAction">
- </dropAction>
- <transfer
- priority="low"
- singleton="true"
- class="org.eclipse.swt.dnd.TextTransfer"
- method="getInstance"
- id="org.eclipse.swt.dnd.TextTransfer">
- </transfer>
- <dropAction
- class="org.eclipse.wst.sse.ui.internal.TextDropAction"
- transferID="org.eclipse.swt.dnd.TextTransfer"
- id="org.eclipse.wst.sse.ui.internal.TextDropAction">
- </dropAction>
- </dropTargetContribution>
- </extension>
-
- <extension point="org.eclipse.ui.editors.annotationTypes">
- <type
- super="org.eclipse.ui.workbench.texteditor.error"
- markerType="org.eclipse.wst.sse.problem"
- name="org.eclipse.wst.sse.ui.temp.error"
- markerSeverity="2">
- </type>
- <type
- super="org.eclipse.ui.workbench.texteditor.warning"
- markerType="org.eclipse.wst.sse.problem"
- name="org.eclipse.wst.sse.ui.temp.warning"
- markerSeverity="1">
- </type>
-
- <type
- super="org.eclipse.ui.workbench.texteditor.info"
- markerType="org.eclipse.wst.sse.problem"
- name="org.eclipse.wst.sse.ui.temp.info"
- markerSeverity="0">
- </type>
- </extension>
- <extension
- point="org.eclipse.ui.editors.markerAnnotationSpecification">
-
- <!--================================================================================================-->
- <!-- same as eclipse text ui (including preference keys), except for vertical ruler & preference page -->
- <!--================================================================================================-->
- <specification
- annotationType="org.eclipse.wst.sse.ui.temp.error"
- annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
- verticalRulerPreferenceValue="true"
- verticalRulerPreferenceKey="sseErrorIndicationInVerticalRuler"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationType="org.eclipse.wst.sse.ui.temp.warning"
- annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
- verticalRulerPreferenceValue="false"
- verticalRulerPreferenceKey="sseWarningIndicationInVerticalRuler"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationImageProvider="org.eclipse.wst.sse.ui.internal.ui.StructuredTextAnnotationImageProvider"
- annotationType="org.eclipse.wst.sse.ui.temp.info">
- </specification>
- </extension>
- <!-- dynamic content type supporting editor, no supported file extensions by default -->
- <extension point="org.eclipse.ui.editors">
- <editor
- name="%Standalone_Structured_Source_Editor.name"
- icon="$nl$/icons/sourceEditor.gif"
- contributorClass="org.eclipse.wst.sse.ui.internal.actions.ActionContributor"
- class="org.eclipse.wst.sse.ui.StructuredTextEditor"
- symbolicFontName="org.eclipse.wst.sse.ui.textfont"
- id="org.eclipse.wst.sse.ui.StructuredTextEditor">
- </editor>
- </extension>
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IContainer"
- id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions">
- <menu
- label="%Source"
- path="additions"
- id="source">
- <groupMarker name="sourceGroup"></groupMarker>
- </menu>
- <action
- label="%FormatDocument"
- class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate"
- menubarPath="source/sourceGroup"
- enablesFor="+"
- id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions.Format">
- </action>
- </objectContribution>
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- id="org.eclipse.wst.sse.ui.actions.FileSourceActions">
- <menu
- label="%Source"
- path="additions"
- id="source">
- <groupMarker name="sourceGroup"></groupMarker>
- </menu>
- <action
- label="%FormatDocument"
- class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate"
- menubarPath="source/sourceGroup"
- enablesFor="+"
- id="org.eclipse.wst.sse.ui.actions.FileSourceActions.Format">
- </action>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.ui.editorActions">
- <editorContribution
- targetID="org.eclipse.wst.sse.ui.StructuredTextEditor"
- id="org.eclipse.wst.sse.ui.StructuredTextEditor.ruler.actions">
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- <action
- label="%SelectRuler.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction">
- </action>
- </editorContribution>
- </extension>
-
- <!--================================================================================================-->
- <!-- contribute a SearchResultViewPage for Occurrences in file -->
- <!--================================================================================================-->
- <extension
- id="Occurrences search page"
- point="org.eclipse.search.searchResultViewPages">
- <viewPage
- id="org.eclipse.wst.sse.ui.search.OccurrencesSearchResultPage"
- searchResultClass="org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchResult"
- class="org.eclipse.wst.sse.ui.internal.search.OccurrencesSearchViewPage">
- </viewPage>
- </extension>
-
- <!-- extension point for breakpoint extension -->
- <extension-point
- id="breakpoint"
- name="%Breakpoint_Extension_Point.name" />
- <!-- extension point for source validation -->
- <!-- interfaces for this extension point can be found in org.eclipse.wst.validation -->
- <extension-point
- id="sourcevalidation"
- name="%Source_Validation_Extension_Point.name"
- schema="schema/org.eclipse.wst.sse.editor.sourcevalidation.exsd" />
-</plugin>
diff --git a/bundles/org.eclipse.wst.sse.ui/reexport-info.txt b/bundles/org.eclipse.wst.sse.ui/reexport-info.txt
deleted file mode 100644
index 9c8c7c70da..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/reexport-info.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-we reexport eclipse.ui.editors
-since one of our APIs, StructuredSourceViewerConfiguration
-requires it.
-
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd b/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
deleted file mode 100644
index 66e2130ae5..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/editorconfiguration.exsd
+++ /dev/null
@@ -1,256 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="editorConfiguration" name="Editor Configuration"/>
- </appInfo>
- <documentation>
- The SSE StructuredTextEditor is intended to be as flexible as possible. Much of its design centers around the notion of defining and redefining its behavior and appearance based on the content type of its input. This extension point allows clients to provide an editor configuration to the StructuredTextEditor without having to subclass the editor.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="sourceViewerConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="contentOutlineConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="propertySheetConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="provisionalConfiguration" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="provisionalDefinition" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="sourceViewerConfiguration">
- <annotation>
- <documentation>
- Defines the source viewer configuration, affecting syntax highlighting, content assist, hover help, and more in the current editor.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must subclass org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentOutlineConfiguration">
- <annotation>
- <documentation>
- Defines how the current editor&apos;s input maps to elements with in a Tree control, as well as selection filtering, toolbar and menu contributions, etc in the Outline view.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must subclass org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="propertySheetConfiguration">
- <annotation>
- <documentation>
- Defines how the current editor&apos;s input maps to properties in a Table control, as well as toolbar contributions, etc in the Properties view.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Must subclass org.eclipse.wst.sse.ui.views.properties.PropertySheetConfiguration
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provisionalConfiguration">
- <annotation>
- <documentation>
- Declares a class fulfilling the requirements of a type to be used for the given target(s).
-&lt;br /&gt;Note: this is not API and is only used for provisional configuration types.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The type of configuration to find.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- Implementation class for this type.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provisionalDefinition">
- <annotation>
- <documentation>
- Defines a value for a type to be used for the given target(s).
-&lt;br /&gt;Note: this is not API and is only used for provisional configuration types.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The type of definition to find.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="value" type="string">
- <annotation>
- <documentation>
- The value of this definition.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="target" type="string" use="required">
- <annotation>
- <documentation>
- A string defining when to use this extension, either an editor or content type id. Multiple targets may be given as a comma delimited value.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.sse.ui.editorConfiguration&quot;&gt;
- &lt;!-- associating a source viewer configuration to an input&apos;s content type--&gt;
- &lt;sourceViewerConfiguration
- class=&quot;org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML&quot;
- target=&quot;org.eclipse.wst.html.core.htmlsource&quot;/&gt;
- &lt;!-- associating an outline configuration to an input&apos;s content type --&gt;
- &lt;contentOutlineConfiguration
- class=&quot;org.eclipse.wst.sse.xml.ui.views.contentoutline.XMLContentOutlineConfiguration&quot;
- target=&quot;org.eclipse.core.runtime.xml&quot;/&gt;
- &lt;!-- associating a property sheet configuration to multiple content types --&gt;
- &lt;propertySheetConfiguration
- class=&quot;org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration&quot;
- target=&quot;org.eclipse.wst.sse.contenttype.xml, org.eclipse.wst.html.core.htmlsource, org.eclipse.jst.jsp.core.jspsource&quot;/&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- see &lt;code&gt;org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration&lt;/code&gt;, &lt;code&gt;org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration&lt;/code&gt;, &lt;code&gt;org.eclipse.wst.sse.ui.views.properties.StructuredPropertySheetConfiguration&lt;/code&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.
-All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd b/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd
deleted file mode 100644
index 5250d317c3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.sse.ui">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.sse.ui" id="sourcevalidation" name="Source Validation"/>
- </appInfo>
- <documentation>
- This extension point is provided to allow clients to contribute a validator (&lt;code&gt;org.eclipse.wst.validation.internal.provisional.core.IValidator&lt;/code&gt;)
-for as-you-type (source) validation.&lt;br&gt;
-
-If your validator can handle &quot;partial document&quot; validation, it should also implement ISourceValidator. The validate call on ISourceValidator gets passed an IRegion representation of the part of the document that&apos;s dirty.&lt;br&gt;
-
-This should be much more efficient than validating the entire file each time someone types.&lt;br&gt;
-
-The validator is enabled for specific content type/partition combinations.&lt;br&gt;
-
-Required plugins are:&lt;br&gt;
- org.eclipse.wst.sse.ui&lt;br&gt;
- org.eclipse.wst.validation
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="validator"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="validator">
- <complexType>
- <sequence>
- <element ref="contentTypeIdentifier" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="scope" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="partitionType">
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contentTypeIdentifier">
- <complexType>
- <sequence>
- <element ref="partitionType" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- Example demonstrating how HTMLValidator contributes to as-you-type validation in the source editor.
-
-&lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.wst.sse.ui.extensions.sourcevalidation&quot;&gt;
- &lt;validator
- scope=&quot;total&quot;
- class=&quot;org.eclipse.wst.validation.html.HTMLValidator&quot;
- id=&quot;org.eclipse.wst.validation.htmlsourcevalidator&quot;&gt;
- &lt;contentTypeIdentifier
- id=&quot;org.eclipse.wst.html.core.htmlsource&quot;&gt;
- &lt;partitionType
- id=&quot;org.eclipse.wst.html.HTML_DEFAULT&quot;/&gt;
- &lt;/contentTypeIdentifier&gt;
- &lt;contentTypeIdentifier
- id=&quot;org.eclipse.jst.jsp.core.jspsource&quot;&gt;
- &lt;partitionType
- id=&quot;org.eclipse.wst.html.HTML_DEFAULT&quot;/&gt;
- &lt;/contentTypeIdentifier&gt;
- &lt;/validator&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;p&gt;
-Using ISourceValidator
-&lt;/p&gt;
-&lt;p&gt;
-If your validator can handle &quot;partial document&quot; validation, it should implement ISourceValidator.
-&lt;/p&gt;
-&lt;p&gt;
-The validate call on ISourceValidator gets passed an IRegion of the document which represents just the part that&apos;s dirty. This should be much more efficient than validating the entire file each time someone types.
-&lt;/p&gt;
-&lt;p&gt;
-ISourceValidator has its &quot;connect(IDocument doc)&quot; method called when it&apos;s hooked up to the document (when the editor is opened), and &quot;disconnect(IDocument doc)&quot; called when the editor is closed, where any &quot;unhooking&quot; should take place.
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- Currently there is no supplied implementation for IValidator.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2005 IBM Corporation and others.&lt;br&gt;
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at &lt;a
-href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java
deleted file mode 100644
index 32cf3dd551..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-encoding/org/eclipse/wst/sse/ui/internal/encoding/ui/EncodingPreferencePage.java
+++ /dev/null
@@ -1,109 +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.sse.ui.internal.encoding.ui;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-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.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.util.CodedResourcePlugin;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-/**
- * @deprecated - this should not be handled by the platform and not WTP
- */
-
-public class EncodingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- Button fUse3ByteBOMWithUTF8CheckBox = null;
-
- private Button createCheckBox(Composite parent, String label) {
- Button button = new Button(parent, SWT.CHECK | SWT.LEFT | SWT.WRAP);
- button.setText(label);
-
- boolean selection = CodedResourcePlugin.getDefault().getPluginPreferences().getBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
- button.setSelection(selection);
-
- return button;
- }
-
- private Composite createComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
-
- //GridLayout
- GridLayout layout = new GridLayout(1, true);
- composite.setLayout(layout);
-
- //GridData
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
-
- return composite;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite composite = createComposite(parent);
-
- String description = SSEUIMessages.EncodingPreferencePage_0; //$NON-NLS-1$
-
- // ISSUE: the following to lines look redundant,
- // not sure what was trying to be accomplished.
- // May be dead code.
- createLabel(composite, description);
- createLabel(composite, ""); //$NON-NLS-1$
-
- String checkBoxLabel = SSEUIMessages.EncodingPreferencePage_1; //$NON-NLS-1$
- fUse3ByteBOMWithUTF8CheckBox = createCheckBox(composite, checkBoxLabel);
-
- return composite;
- }
-
- private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
-
- return label;
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-
- public void performDefaults() {
- boolean defaultSelection = CodedResourcePlugin.getDefault().getPluginPreferences().getDefaultBoolean(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8);
- fUse3ByteBOMWithUTF8CheckBox.setSelection(defaultSelection);
- }
-
- public boolean performOk() {
- CodedResourcePlugin.getDefault().getPluginPreferences().setValue(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, fUse3ByteBOMWithUTF8CheckBox.getSelection());
- CodedResourcePlugin.getDefault().savePluginPreferences();
-
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
deleted file mode 100644
index fdb15cbe3d..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ConfigurationPointCalculator.java
+++ /dev/null
@@ -1,151 +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.sse.ui.internal.provisional.extensions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.part.MultiPageEditorSite;
-
-public class ConfigurationPointCalculator {
- public static final String DESIGN = ".design"; //$NON-NLS-1$
- public static final String SOURCE = ".source"; //$NON-NLS-1$
-
- public static String[] getConfigurationPoints(IEditorPart part, String contentType, String subContext, Class rootClass) {
- ConfigurationPointCalculator calculator = new ConfigurationPointCalculator();
- calculator.setContentType(contentType);
- calculator.setPart(part);
- calculator.setRootClass(rootClass);
- calculator.setSubContext(subContext);
- return calculator.getConfigurationPoints();
- }
-
- protected String fContentType = null;
- protected IEditorPart fPart = null;
-
- protected Class fRootClass = null;
- protected String fSubContext = null;
-
- /**
- *
- */
- public ConfigurationPointCalculator() {
- super();
- }
-
- public String[] getConfigurationPoints() {
- List points = new ArrayList(2);
-
- IEditorSite site = fPart.getEditorSite();
- String id = site.getId();
- if (id != null && id.length() > 0 && !id.equals(fRootClass.getName()))
- points.add(id);
-
- if (site instanceof MultiPageEditorSite) {
- String multipageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId();
- if (!points.contains(multipageID))
- points.add(multipageID);
- String sourcePageID = ((MultiPageEditorSite) site).getMultiPageEditor().getSite().getId() + ".source"; //$NON-NLS-1$
- if (!points.contains(sourcePageID))
- points.add(sourcePageID);
- }
- if (site instanceof MultiPageEditorSite) {
- String multipageClassName = ((MultiPageEditorSite) site).getMultiPageEditor().getClass().getName();
- if (!points.contains(multipageClassName))
- points.add(multipageClassName);
- }
- Class editorClass = fPart.getClass();
- while (editorClass != null && fRootClass != null && !editorClass.equals(fRootClass)) {
- if (!points.contains(editorClass.getName()))
- points.add(editorClass.getName());
- editorClass = editorClass.getSuperclass();
- }
-
- IContentType contentType = Platform.getContentTypeManager().getContentType(fContentType);
- while (contentType != null && !contentType.getId().equals(IContentTypeManager.CT_TEXT)) {
- if (!points.contains(contentType.getId()))
- points.add(contentType.getId());
- contentType = contentType.getBaseType();
- }
-
- if (!points.contains(fRootClass.getName()))
- points.add(fRootClass.getName());
- return (String[]) points.toArray(new String[0]);
- }
-
- /**
- * @return Returns the contentType.
- */
- public String getContentType() {
- return fContentType;
- }
-
- /**
- * @return Returns the part.
- */
- public IEditorPart getPart() {
- return fPart;
- }
-
- /**
- * @return Returns the rootClass.
- */
- public Class getRootClass() {
- return fRootClass;
- }
-
- /**
- * @return Returns the subContext.
- */
- public String getSubContext() {
- return fSubContext;
- }
-
- /**
- * @param contentType
- * The contentType to set.
- */
- public void setContentType(String contentType) {
- fContentType = contentType;
- }
-
- /**
- * @param part
- * The part to set.
- */
- public void setPart(IEditorPart part) {
- fPart = part;
- }
-
- /**
- * @param rootClass
- * The rootClass to set.
- */
- public void setRootClass(Class rootClass) {
- fRootClass = rootClass;
- }
-
- /**
- * @param subContext
- * The subContext to set.
- */
- public void setSubContext(String subContext) {
- fSubContext = subContext;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java
deleted file mode 100644
index 0dedc21501..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java
+++ /dev/null
@@ -1,27 +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.sse.ui.internal.provisional.extensions;
-
-
-
-/**
- * This is a marker interface to control ValidateEdit call Usually framework
- * calls IExtendedSimpleEditor#validateEdit() before calling
- * IExtendedEditorAction's run() method. However, if the action implements
- * this interface, framework won't call validateEdit() method.
- *
- * The action should call validateEdit() at their own appropriate timing.
- */
-public interface ISelfValidateEditAction {
-
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.java
deleted file mode 100644
index d30edf232f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISourceEditingTextTools.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.sse.ui.internal.provisional.extensions;
-
-
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Interface to provide convenient functions for editors that may not be
- * ITextEditors, but need to expose properties usually found in text editors
- */
-public interface ISourceEditingTextTools {
-
- /**
- * @return the document offset at which the Caret is located
- */
- public int getCaretOffset();
-
- /**
- * @return the IDocument being edited. If this editor supports multiple
- * documents, the document currently possessing the caret will be
- * returned.
- */
- public IDocument getDocument();
-
- /**
- * @return The IEditorPart instance for this editor that is known to the
- * workbench.
- */
- public IEditorPart getEditorPart();
-
- /**
- * @return The current selection within the editor. Implementors may
- * support other types of selection.
- */
- public ITextSelection getSelection();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java
deleted file mode 100644
index a78e4482c1..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointConstants.java
+++ /dev/null
@@ -1,21 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-/**
- * @author pavery
- */
-public interface IBreakpointConstants {
- String ATTR_HIDDEN = "hidden"; //$NON-NLS-1$
- String RESOURCE_PATH = "org.eclipse.wst.sse.ui.extensions.breakpoint.path"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.java
deleted file mode 100644
index 89855d167c..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IBreakpointProvider.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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-/**
- * Interface to provide breakpoint creation
- */
-public interface IBreakpointProvider {
-
- /**
- * Adds breakpoint to specified position
- *
- * @param document
- * IDocument object
- * @param input
- * current editor input, not necessarily an IFileEditorInput or
- * linked to a resource in any way
- * @param lineNumber
- * current line number
- * @param offset
- * current caret offset
- * @throws CoreException
- * @return IStatus the status after being asked to add a breakpoint. The
- * Severity of ERROR should only be used if the location
- * information is both valid for a breakpoint and one could not be
- * added.
- */
- IStatus addBreakpoint(IDocument document, IEditorInput input, int lineNumber, int offset) throws CoreException;
-
- /**
- * Returns corresponding resource from editor input
- *
- * @param input
- * @return IResource
- */
- IResource getResource(IEditorInput input);
-
- /**
- * Set ISourceEditingTextTools object
- *
- * @param tool
- * ISourceEditingTextTools object
- */
- void setSourceEditingTextTools(ISourceEditingTextTools tool);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java
deleted file mode 100644
index dc414724e3..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/IExtendedStorageEditorInput.java
+++ /dev/null
@@ -1,37 +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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.texteditor.IElementStateListener;
-
-public interface IExtendedStorageEditorInput extends IStorageEditorInput {
- /**
- * Adds the given element state listener to this input. Has no effect if
- * an identical listener is already registered. Typically used by the
- * IDocumentProvider to register itself for change notification.
- *
- * @param listener
- * the listener
- */
- void addElementStateListener(IElementStateListener listener);
-
- /**
- * Removes the given element state listener from this input. Has no affect
- * if an identical listener is not registered.
- *
- * @param listener
- * the listener
- */
- void removeElementStateListener(IElementStateListener listener);
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.java
deleted file mode 100644
index 7874d98802..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NodeLocation.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.sse.ui.internal.provisional.extensions.breakpoint;
-
-
-public interface NodeLocation {
- /**
- * Returns the document end offset of the end tag, -1 of there is no end
- * tag
- *
- * @return
- */
- int getEndTagEndOffset();
-
- /**
- * Returns the document start offset of the end tag, -1 of there is no end
- * tag
- *
- * @return
- */
- int getEndTagStartOffset();
-
- /**
- * Returns the document end offset of the start tag, -1 of there is no
- * start tag
- *
- * @return
- */
- int getStartTagEndOffset();
-
- /**
- * Returns the document start offset of the start tag, -1 of there is no
- * start tag
- *
- * @return
- */
- int getStartTagStartOffset();
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java b/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.java
deleted file mode 100644
index 65758a62f8..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/breakpoint/NullSourceEditingTextTools.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.sse.ui.internal.provisional.extensions.breakpoint;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
-
-public class NullSourceEditingTextTools implements ISourceEditingTextTools {
- public static final String ID = "sourceeditingtexttools"; //$NON-NLS-1$
- private ITextEditor fTextEditor;
-
- /**
- * @return
- */
- public synchronized static ISourceEditingTextTools getInstance() {
- return new NullSourceEditingTextTools();
- }
-
- private NullSourceEditingTextTools() {
- super();
- }
-
- public int getCaretOffset() {
- ISelection sel = fTextEditor.getSelectionProvider().getSelection();
- if (sel instanceof ITextSelection) {
- return ((ITextSelection) sel).getOffset();
- }
- return -1;
- }
-
- public IDocument getDocument() {
- return fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
- }
-
- public IEditorPart getEditorPart() {
- return fTextEditor;
- }
-
- public ITextSelection getSelection() {
- if (fTextEditor != null)
- return (ITextSelection) fTextEditor.getSelectionProvider().getSelection();
- return TextSelection.emptySelection();
- }
-
- public void setTextEditor(ITextEditor editor) {
- fTextEditor = editor;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
deleted file mode 100644
index 03fcdfc7d6..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/ExclusionsTab.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.sse.ui.internal.preferences.ui;
-
-import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-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.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.core.internal.SSECorePlugin;
-import org.eclipse.wst.sse.core.internal.tasks.FileTaskScannerRegistryReader;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.util.Sorter;
-
-class ExclusionsTab implements IPreferenceTab {
- private class ArrayTreeContentProvider implements ITreeContentProvider {
- public ArrayTreeContentProvider() {
- super();
- }
-
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Object[])
- return fContentTypeSorter.sort((Object[]) parentElement);
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- private class ContentTypeLabelProvider extends LabelProvider {
- public String getText(Object element) {
- if (element != null) {
- Object o = element;
- if (o instanceof String) {
- o = fContentTypeManager.getContentType(o.toString());
- }
- if (o instanceof IContentType) {
- return ((IContentType) o).getName();
- }
- }
- return super.getText(element);
- }
- }
-
- /**
- * A QuickSorter that sorts and returns a IContentType-typed array
- */
- private class ContentTypeSorter extends Sorter {
- private Collator collator = Collator.getInstance(Locale.ENGLISH);
-
- public boolean compare(Object elementOne, Object elementTwo) {
- return (collator.compare(((IContentType) elementOne).getName(), ((IContentType) elementTwo).getName())) < 0;
- }
-
- public Object[] sort(Object[] unSortedCollection) {
- Object[] types = super.sort(unSortedCollection);
- IContentType[] sortedTypes = new IContentType[types.length];
- if (types.length > 0) {
- System.arraycopy(types, 0, sortedTypes, 0, sortedTypes.length);
- }
- return sortedTypes;
- }
- }
-
- private class ContentTypeTreeProvider implements ITreeContentProvider {
- public ContentTypeTreeProvider() {
- super();
- }
-
- public void dispose() {
- }
-
- boolean equals(Object left, Object right) {
- return left == null ? right == null : ((right != null) && left.equals(right));
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof Object[]) {
- return (Object[]) parentElement;
- }
- if (parentElement instanceof IContentType) {
- List elements = new ArrayList(0);
- IContentType[] allTypes = fContentTypeManager.getAllContentTypes();
- for (int i = 0; i < allTypes.length; i++) {
- if (!fSupportedContentTypes.contains(allTypes[i]) && equals(allTypes[i].getBaseType(), parentElement)) {
- elements.add(allTypes[i]);
- }
- }
- return fContentTypeSorter.sort(elements.toArray());
- }
- return new Object[0];
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- Object parent = null;
- if (element instanceof IContentType) {
- parent = ((IContentType) element).getBaseType();
- }
- return parent;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- /**
- * A QuickSorter that sorts and returns a String-typed array
- */
- private class StringSorter extends Sorter {
- Collator collator = Collator.getInstance(Locale.ENGLISH);
-
- public boolean compare(Object elementOne, Object elementTwo) {
- return (collator.compare(elementOne.toString(), elementTwo.toString()) < 0);
- }
-
- public Object[] sort(Object[] unSortedCollection) {
- Object[] sortedCollection = super.sort(unSortedCollection);
- String[] strings = new String[sortedCollection.length];
- // copy the array so can return a new sorted collection
- if (strings.length > 0) {
- System.arraycopy(sortedCollection, 0, strings, 0, strings.length);
- }
- return strings;
- }
- }
-
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private CheckboxTreeViewer fContentTypeList;
-
- private IContentTypeManager fContentTypeManager = null;
-
- ContentTypeSorter fContentTypeSorter = new ContentTypeSorter();
-
- private IContentType[] fIgnoreContentTypes = null;
-
- private IContentType[] fOriginalIgnoreContentTypes = null;
-
- private TaskTagPreferencePage fOwner = null;
-
- private IScopeContext[] fPreferencesLookupOrder = null;
-
- private IPreferencesService fPreferencesService = null;
-
- private List fSupportedContentTypes = null;
-
- public ExclusionsTab(TaskTagPreferencePage parent, IPreferencesService preferencesService, IScopeContext[] lookupOrder) {
- super();
- fOwner = parent;
- fPreferencesLookupOrder = lookupOrder;
- fPreferencesService = preferencesService;
- fContentTypeManager = Platform.getContentTypeManager();
-
- String[] supportedContentTypeIDs = FileTaskScannerRegistryReader.getInstance().getSupportedContentTypeIds();
- fSupportedContentTypes = new ArrayList(supportedContentTypeIDs.length);
- for (int i = 0; i < supportedContentTypeIDs.length; i++) {
- IContentType type = fContentTypeManager.getContentType(supportedContentTypeIDs[i]);
- if (type != null) {
- fSupportedContentTypes.add(type);
- }
- }
- String[] ignoreContentTypes = StringUtils.unpack(fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, SSECorePlugin.getDefault().getPluginPreferences().getDefaultString(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED), fPreferencesLookupOrder));
- List contentTypes = new ArrayList();
- for (int i = 0; i < ignoreContentTypes.length; i++) {
- IContentType type = fContentTypeManager.getContentType(ignoreContentTypes[i]);
- if (type != null) {
- contentTypes.add(type);
- }
- }
- fOriginalIgnoreContentTypes = fIgnoreContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
- }
-
- public Control createContents(Composite tabFolder) {
- Composite composite = new Composite(tabFolder, SWT.NONE);
- composite.setLayout(new GridLayout(2, true));
- Text description = new Text(composite, SWT.READ_ONLY);
- description.setText(SSEUIMessages.TaskTagExclusionTab_02);
- description.setBackground(composite.getBackground());
-
- fContentTypeList = new CheckboxTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
- fContentTypeList.setLabelProvider(new ContentTypeLabelProvider());
- fContentTypeList.setContentProvider(new ArrayTreeContentProvider());
-
- fContentTypeList.setInput(fSupportedContentTypes.toArray());
- fContentTypeList.setCheckedElements(fSupportedContentTypes.toArray());
- fContentTypeList.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
- for (int i = 0; i < fIgnoreContentTypes.length; i++) {
- fContentTypeList.setChecked(fIgnoreContentTypes[i], false);
- }
-
- Button selectAll = new Button(composite, SWT.PUSH);
- selectAll.setText(SSEUIMessages.TaskTagPreferenceTab_17);
- selectAll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
- selectAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fContentTypeList.setCheckedElements(fSupportedContentTypes.toArray());
- }
- });
-
- Button selectNone = new Button(composite, SWT.PUSH);
- selectNone.setText(SSEUIMessages.TaskTagPreferenceTab_18);
- selectNone.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
- selectNone.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fContentTypeList.setCheckedElements(new Object[0]);
- }
- });
-
- new Label(composite, SWT.NONE).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-
- Text affectedTypesLabel = new Text(composite, SWT.READ_ONLY);
- affectedTypesLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
- affectedTypesLabel.setBackground(composite.getBackground());
- affectedTypesLabel.setText(SSEUIMessages.TaskTagExclusionTab_03);
-
- final TreeViewer contentTypeTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
- contentTypeTreeViewer.setLabelProvider(new ContentTypeLabelProvider());
- contentTypeTreeViewer.setContentProvider(new ContentTypeTreeProvider());
- contentTypeTreeViewer.setInput(new Object[0]);
- contentTypeTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-
- fContentTypeList.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof IStructuredSelection) {
- Object[] o = ((IStructuredSelection) event.getSelection()).toArray();
- contentTypeTreeViewer.setInput(o);
- contentTypeTreeViewer.expandAll();
- if (o.length > 0) {
- contentTypeTreeViewer.reveal(o[0]);
- }
- }
- }
- });
-
- return composite;
- }
-
- public String getTitle() {
- return SSEUIMessages.TaskTagExclusionTab_01;
- }
-
- public void performApply() {
- save();
- }
-
- public void performDefaults() {
- if (_debugPreferences) {
- System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
- }
- IEclipsePreferences[] defaultPreferences = new IEclipsePreferences[fPreferencesLookupOrder.length - 1];
- for (int i = 1; i < defaultPreferences.length; i++) {
- defaultPreferences[i - 1] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- }
- String[] defaultIgnoreTypes = StringUtils.unpack(fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, null, defaultPreferences)); //$NON-NLS-1$
-
- List contentTypes = new ArrayList();
- for (int i = 0; i < defaultIgnoreTypes.length; i++) {
- IContentType type = fContentTypeManager.getContentType(defaultIgnoreTypes[i]);
- if (type != null) {
- contentTypes.add(type);
- }
- }
- fIgnoreContentTypes = (IContentType[]) contentTypes.toArray(new IContentType[contentTypes.size()]);
- fContentTypeList.setCheckedElements(fContentTypeManager.getAllContentTypes());
- for (int i = 0; i < fIgnoreContentTypes.length; i++) {
- fContentTypeList.setChecked(fIgnoreContentTypes[i], false);
- }
- }
-
- public void performOk() {
- List ignoredIds = save();
- String[] ignoreIDs = (String[]) new StringSorter().sort(ignoredIds.toArray());
- fIgnoreContentTypes = new IContentType[ignoreIDs.length];
- for (int i = 0; i < ignoreIDs.length; i++) {
- fIgnoreContentTypes[i] = fContentTypeManager.getContentType(ignoreIDs[i]);
- }
-
- if (!Arrays.equals(fOriginalIgnoreContentTypes, fIgnoreContentTypes)) {
- fOwner.requestRedetection();
- }
- fOriginalIgnoreContentTypes = fIgnoreContentTypes;
- }
-
- private List save() {
- List ignoredIds = new ArrayList();
- List checked = Arrays.asList(fContentTypeList.getCheckedElements());
- for (int i = 0; i < fSupportedContentTypes.size(); i++) {
- if (!checked.contains(fSupportedContentTypes.get(i))) {
- ignoredIds.add(((IContentType) fSupportedContentTypes.get(i)).getId());
- }
- }
- IEclipsePreferences[] defaultPreferences = new IEclipsePreferences[fPreferencesLookupOrder.length - 1];
- for (int i = 1; i < defaultPreferences.length; i++) {
- defaultPreferences[i - 1] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- }
-
- String defaultIgnoredContentTypeIds = StringUtils.pack((String[]) new StringSorter().sort(StringUtils.unpack(fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, "", defaultPreferences)))); //$NON-NLS-1$
- String ignoredContentTypeIds = StringUtils.pack((String[]) new StringSorter().sort(ignoredIds.toArray()));
- if (ignoredContentTypeIds.equals(defaultIgnoredContentTypeIds)) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED);
- }
- else {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED + " \"" + ignoredContentTypeIds + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_CONTENTTYPES_IGNORED, ignoredContentTypeIds);
- }
- return ignoredIds;
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
deleted file mode 100644
index a04565ebdd..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/MainTab.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies 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.sse.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import com.ibm.icu.util.StringTokenizer;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.sse.core.internal.provisional.tasks.TaskTag;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-
-class MainTab implements IPreferenceTab {
- public class TaskTagDialog extends Dialog {
- public TaskTag taskTag = null;
-
- Combo priorityCombo = null;
- Text tagText = null;
-
- public TaskTagDialog(Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(SSEUIMessages.TaskTagPreferenceTab_5); //$NON-NLS-1$
- }
-
- protected Control createButtonBar(Composite parent) {
- Control c = super.createButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(taskTag == null || taskTag.getTag().length() > 0);
- return c;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.widthHint = parent.getDisplay().getClientArea().width / 5;
- composite.setLayoutData(gridData);
- Label label = new Label(composite, SWT.NONE);
- label.setText(SSEUIMessages.TaskTagPreferenceTab_6); //$NON-NLS-1$
- label.setLayoutData(new GridData());
- tagText = new Text(composite, SWT.NONE);
- tagText.setText(taskTag != null ? taskTag.getTag() : ""); //$NON-NLS-1$
- tagText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- tagText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String testTag = tagText.getText();
- String[] tags = new String[fTaskTags.length];
- for (int i = 0; i < tags.length; i++) {
- tags[i] = fTaskTags[i].getTag();
- }
- getButton(IDialogConstants.OK_ID).setEnabled(tagText.getText().length() > 0 && !Arrays.asList(tags).contains(testTag));
- taskTag = new TaskTag(tagText.getText(), priorityCombo.getSelectionIndex());
- }
- });
-
- label = new Label(composite, SWT.NONE);
- label.setText(SSEUIMessages.TaskTagPreferenceTab_7); //$NON-NLS-1$
- label.setLayoutData(new GridData());
- priorityCombo = new Combo(composite, SWT.READ_ONLY | SWT.SINGLE);
- priorityCombo.setItems(new String[]{SSEUIMessages.TaskTagPreferenceTab_0, SSEUIMessages.TaskTagPreferenceTab_1, SSEUIMessages.TaskTagPreferenceTab_2});
- priorityCombo.select(taskTag != null ? taskTag.getPriority() : TaskTag.PRIORITY_NORMAL);
- priorityCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- priorityCombo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- taskTag = new TaskTag(taskTag.getTag(), priorityCombo.getSelectionIndex());
- }
- });
- return composite;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- taskTag = new TaskTag(tagText.getText(), priorityCombo.getSelectionIndex());
- super.okPressed();
- }
- }
-
- public class TaskTagTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public TaskTagTableLabelProvider() {
- super();
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if (columnIndex < 1)
- return ((TaskTag) element).getTag();
- for (int i = 0; i < fTaskTags.length; i++) {
- if (fTaskTags[i].equals(element)) {
- if (fTaskTags[i].getPriority() == IMarker.PRIORITY_LOW) {
- return SSEUIMessages.TaskTagPreferenceTab_0; //$NON-NLS-1$
- }
- else if (fTaskTags[i].getPriority() == IMarker.PRIORITY_HIGH) {
- return SSEUIMessages.TaskTagPreferenceTab_2; //$NON-NLS-1$
- }
- else {
- return SSEUIMessages.TaskTagPreferenceTab_1; //$NON-NLS-1$
- }
- }
- }
- return SSEUIMessages.TaskTagPreferenceTab_3; //$NON-NLS-1$
- }
- }
-
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.core/tasks/preferences")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private Control fControl;
-
- private TaskTag[] fOriginalTaskTags;
- private TaskTagPreferencePage fOwner = null;
- private IScopeContext[] fPreferencesLookupOrder = null;
-
- private IPreferencesService fPreferencesService = null;
-
- private TaskTag[] fTaskTags;
-
- private TableViewer valueTable = null;
-
-
- public MainTab(TaskTagPreferencePage parent, IPreferencesService preferencesService, IScopeContext[] lookupOrder) {
- super();
- fOwner = parent;
- fPreferencesLookupOrder = lookupOrder;
- fPreferencesService = preferencesService;
- }
-
-
- private void addTag() {
- TaskTagDialog dlg = new TaskTagDialog(fControl.getShell());
- int result = dlg.open();
- if (result == Window.OK) {
- TaskTag newTag = dlg.taskTag;
- List newTags = new ArrayList(Arrays.asList(fTaskTags));
- newTags.add(newTag);
- fTaskTags = (TaskTag[]) newTags.toArray(new TaskTag[newTags.size()]);
- valueTable.setInput(fTaskTags);
- valueTable.getTable().setSelection(fTaskTags.length - 1);
- }
- }
-
- public Control createContents(Composite tabFolder) {
- loadPreferenceValues();
- fOriginalTaskTags = fTaskTags;
-
- Composite composite = new Composite(tabFolder, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- fControl = composite;
-
- Text description = new Text(composite, SWT.READ_ONLY | SWT.SINGLE);
- description.setText(SSEUIMessages.TaskTagPreferenceTab_33); //$NON-NLS-1$
- description.setBackground(composite.getBackground());
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104403
- Point sizeHint = description.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- gd.widthHint = sizeHint.x;
- description.setLayoutData(gd);
-
- valueTable = new TableViewer(composite, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- valueTable.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- TableColumn textColumn = new TableColumn(valueTable.getTable(), SWT.NONE, 0);
- textColumn.setText(SSEUIMessages.TaskTagPreferenceTab_12); //$NON-NLS-1$
- TableColumn priorityColumn = new TableColumn(valueTable.getTable(), SWT.NONE, 1);
- priorityColumn.setText(SSEUIMessages.TaskTagPreferenceTab_13); //$NON-NLS-1$
- valueTable.setContentProvider(new ArrayContentProvider());
- valueTable.setLabelProvider(new TaskTagTableLabelProvider());
- valueTable.getTable().setLinesVisible(true);
- valueTable.getTable().setHeaderVisible(true);
- TableLayout layout = new TableLayout();
- layout.addColumnData(new ColumnWeightData(1, 140, true));
- layout.addColumnData(new ColumnWeightData(1, 140, true));
- valueTable.getTable().setLayout(layout);
-
- Composite buttons = new Composite(composite, SWT.NONE);
- buttons.setLayout(new GridLayout());
- buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
- final Button addButton = new Button(buttons, SWT.PUSH);
- addButton.setText(SSEUIMessages.TaskTagPreferenceTab_14); //$NON-NLS-1$
- addButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- final Button editButton = new Button(buttons, SWT.PUSH);
- editButton.setText(SSEUIMessages.TaskTagPreferenceTab_15); //$NON-NLS-1$
- editButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- final Button removeButton = new Button(buttons, SWT.PUSH);
- removeButton.setText(SSEUIMessages.TaskTagPreferenceTab_16); //$NON-NLS-1$
- removeButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- editButton.setEnabled(false);
- removeButton.setEnabled(false);
-
- Label warning = new Label(composite, SWT.NONE);
- warning.setLayoutData(new GridData());
- warning.setText(SSEUIMessages.TaskTagPreferenceTab_19); //$NON-NLS-1$
-
- final ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- boolean enabledForSelection = !valueTable.getSelection().isEmpty();
- editButton.setEnabled(enabledForSelection);
- removeButton.setEnabled(enabledForSelection);
- }
- };
- valueTable.addPostSelectionChangedListener(selectionChangedListener);
- addButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- addTag();
- valueTable.getTable().setSelection(fTaskTags.length - 1);
- selectionChangedListener.selectionChanged(null);
- }
- });
- editButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int i = valueTable.getTable().getSelectionIndex();
- editTag(i);
- if (i >= 0) {
- valueTable.getTable().setSelection(i);
- selectionChangedListener.selectionChanged(null);
- }
- }
- });
- removeButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int i = valueTable.getTable().getSelectionIndex();
- removeTag(valueTable.getTable().getSelectionIndex());
- if (i >= 0 && i < fTaskTags.length) {
- valueTable.getTable().setSelection(i);
- }
- }
- });
- valueTable.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- int i = valueTable.getTable().getSelectionIndex();
- editTag(i);
- if (i >= 0) {
- valueTable.getTable().setSelection(i);
- selectionChangedListener.selectionChanged(null);
- }
- }
- });
-
- valueTable.setInput(fTaskTags);
-
- return composite;
- }
-
- /**
- * @param selection
- */
- private void editTag(int i) {
- if (i < 0) {
- return;
- }
-
- int selection = valueTable.getTable().getSelectionIndex();
- TaskTagDialog dlg = new TaskTagDialog(fControl.getShell());
- dlg.taskTag = fTaskTags[selection];
- int result = dlg.open();
- if (result == Window.OK) {
- fTaskTags[selection] = dlg.taskTag;
- valueTable.refresh();
- }
- }
-
- public String getTitle() {
- return SSEUIMessages.TaskTagPreferenceTab_20;
- }
-
- private void loadPreferenceValues() {
- String tags = fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_TAGS, "", fPreferencesLookupOrder); //$NON-NLS-1$
- String priorities = fPreferencesService.getString(TaskTagPreferenceKeys.TASK_TAG_NODE, TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, "", fPreferencesLookupOrder); //$NON-NLS-1$
- loadTagsAndPrioritiesFrom(tags, priorities);
- }
-
- /**
- * @param tags
- * @param priorities
- */
- private void loadTagsAndPrioritiesFrom(String tagString, String priorityString) {
- String[] tags = StringUtils.unpack(tagString);
-
- StringTokenizer toker = null;
- List list = new ArrayList();
-
- toker = new StringTokenizer(priorityString, ","); //$NON-NLS-1$
- while (toker.hasMoreTokens()) {
- Integer number = null;
- try {
- number = Integer.valueOf(toker.nextToken());
- }
- catch (NumberFormatException e) {
- number = new Integer(IMarker.PRIORITY_NORMAL);
- }
- list.add(number);
- }
- Integer[] priorities = (Integer[]) list.toArray(new Integer[0]);
-
- fTaskTags = new TaskTag[Math.min(tags.length, priorities.length)];
- for (int i = 0; i < fTaskTags.length; i++) {
- fTaskTags[i] = new TaskTag(tags[i], priorities[i].intValue());
- }
- }
-
- public void performApply() {
- save();
-
- if (!Arrays.equals(fOriginalTaskTags, fTaskTags)) {
- fOwner.requestRedetection();
- }
- fOriginalTaskTags = fTaskTags;
- }
-
- public void performDefaults() {
- if (_debugPreferences) {
- System.out.println("Loading defaults in " + getClass().getName()); //$NON-NLS-1$
- }
- IEclipsePreferences[] preferences = new IEclipsePreferences[fPreferencesLookupOrder.length];
- for (int i = 0; i < preferences.length; i++) {
- preferences[i] = fPreferencesLookupOrder[i].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- }
- String tags = fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null, preferences);
- String priorities = fPreferencesService.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null, preferences);
- loadTagsAndPrioritiesFrom(tags, priorities);
- int selection = valueTable.getTable().getSelectionIndex();
- valueTable.setInput(fTaskTags);
- valueTable.getTable().setSelection(selection);
- }
-
- public void performOk() {
- performApply();
- }
-
- /**
- * @param selection
- */
- private void removeTag(int i) {
- if (i < 0) {
- return;
- }
- List taskTags = new ArrayList(Arrays.asList(fTaskTags));
- taskTags.remove(i);
- fTaskTags = (TaskTag[]) taskTags.toArray(new TaskTag[taskTags.size()]);
- valueTable.setInput(fTaskTags);
- }
-
- private void save() {
- IEclipsePreferences defaultPreferences = new DefaultScope().getNode(TaskTagPreferenceKeys.TASK_TAG_NODE);
- String defaultTags = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_TAGS, null);
- String defaultPriorities = defaultPreferences.get(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, null);
-
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < fTaskTags.length; i++) {
- if (i > 0) {
- buf.append(","); //$NON-NLS-1$
- }
- buf.append(fTaskTags[i].getTag());
- }
- String currentTags = buf.toString();
- if (currentTags.equals(defaultTags) && !fPreferencesLookupOrder[0].getName().equals(DefaultScope.SCOPE)) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_TAGS);
- }
- else {
- fOwner.requestRedetection();
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_TAGS + " \"" + currentTags + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_TAGS, currentTags);
- }
-
- StringBuffer buf2 = new StringBuffer();
- for (int i = 0; i < fTaskTags.length; i++) {
- if (i > 0) {
- buf2.append(","); //$NON-NLS-1$
- }
- buf2.append(String.valueOf(fTaskTags[i].getPriority()));
- }
- String priorities = buf2.toString();
-
- if (priorities.equals(defaultPriorities) && !fPreferencesLookupOrder[0].getName().equals(DefaultScope.SCOPE)) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " from scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).remove(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES);
- }
- else {
- fOwner.requestRedetection();
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PRIORITIES + " \"" + priorities + "\" in scope " + fPreferencesLookupOrder[0].getName() + ":" + fPreferencesLookupOrder[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- fPreferencesLookupOrder[0].getNode(TaskTagPreferenceKeys.TASK_TAG_NODE).put(TaskTagPreferenceKeys.TASK_TAG_PRIORITIES, priorities);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java
deleted file mode 100644
index d390958239..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/PropertyPreferencePage.java
+++ /dev/null
@@ -1,269 +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.sse.ui.internal.preferences.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-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.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.dialogs.ListDialog;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceSorter;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-
-abstract class PropertyPreferencePage extends PropertyPage implements IWorkbenchPreferencePage {
- private static final boolean _debugPreferences = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/preferences-properties")); //$NON-NLS-1$ //$NON-NLS-2$
- /*
- * Disable link data, prevents the display of a "workspace" or "project"
- * settings link to prevent recursive dialog launching
- */
- private static final Object DISABLE_LINK = "DISABLE_LINK"; //$NON-NLS-1$
-
- private Map fData = null;
-
- private Button fEnableProjectSettings;
-
- private Link fProjectSettingsLink;
-
- public PropertyPreferencePage() {
- super();
- }
-
- public final void applyData(Object data) {
- super.applyData(data);
- if (data instanceof Map) {
- fData = (Map) data;
- updateLinkEnablement();
- }
- }
-
- protected abstract Control createCommonContents(Composite composite);
-
- public final Control createContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
-
- Composite checkLinkComposite = new Composite(composite, SWT.NONE);
- checkLinkComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- checkLinkComposite.setLayout(new GridLayout(2, false));
-
- if (getProject() != null) {
- fEnableProjectSettings = new Button(checkLinkComposite, SWT.CHECK);
- fEnableProjectSettings.setText(SSEUIMessages.EnableProjectSettings); //$NON-NLS-1$//$NON-NLS-2$
- fEnableProjectSettings.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- boolean enabledForProject = createPreferenceScopes()[0].getNode(getPreferenceNodeQualifier()).getBoolean(getProjectSettingsKey(), false);
- fEnableProjectSettings.setSelection(enabledForProject);
- }
- else {
- Label spacer = new Label(checkLinkComposite, SWT.CHECK);
- spacer.setLayoutData(new GridData());
- }
-
- fProjectSettingsLink = new Link(checkLinkComposite, SWT.NONE);
- fProjectSettingsLink.setLayoutData(new GridData(SWT.END, SWT.BEGINNING, true, false));
-
- /*
- * "element" should be a project, if null, link to per-project
- * properties
- */
- if (getProject() != null) {
- fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureWorkspaceSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
- }
- else {
- fProjectSettingsLink.setText("<a>" + SSEUIMessages.ConfigureProjectSettings + "</a>"); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- updateLinkEnablement();
-
- fProjectSettingsLink.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (getProject() == null) {
- openProjectSettings();
- }
- else {
- openWorkspaceSettings();
- }
- }
-
- });
-
- if (getProject() != null) {
- Label line = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- line.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- }
-
- final Control common = createCommonContents(composite);
- common.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (fEnableProjectSettings != null) {
- SelectionAdapter selectionAdapter = new SelectionAdapter() {
- ControlEnableState enablements = null;
-
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- if (fEnableProjectSettings.getSelection()) {
- if (enablements != null) {
- enablements.restore();
- enablements = null;
- }
- }
- else {
- enablements = ControlEnableState.disable(common);
- }
- }
- };
- selectionAdapter.widgetSelected(null);
- fEnableProjectSettings.addSelectionListener(selectionAdapter);
- }
-
- applyDialogFont(composite);
- return composite;
- }
-
- public void createControl(Composite parent) {
- if (getProject() != null) {
- noDefaultAndApplyButton();
- }
- super.createControl(parent);
- }
-
- protected IScopeContext[] createPreferenceScopes() {
- IProject project = getProject();
- if (project != null) {
- return new IScopeContext[]{new ProjectScope(project), new InstanceScope(), new DefaultScope()};
- }
- return new IScopeContext[]{new InstanceScope(), new DefaultScope()};
- }
-
- protected abstract String getPreferenceNodeQualifier();
-
- protected abstract String getPreferencePageID();
-
- protected IProject getProject() {
- if (getElement() != null && getElement() instanceof IProject) {
- return (IProject) getElement();
- }
- return null;
- }
-
- protected abstract String getProjectSettingsKey();
-
- protected abstract String getPropertyPageID();
-
- protected boolean isElementSettingsEnabled() {
- return fEnableProjectSettings != null && fEnableProjectSettings.getSelection();
- }
-
- void openProjectSettings() {
- ListDialog dialog = new ListDialog(getShell()) {
-
- protected Control createDialogArea(Composite container) {
- Control area = super.createDialogArea(container);
- getTableViewer().setSorter(new ResourceSorter(ResourceSorter.NAME));
- return area;
- }
- };
- dialog.setMessage(SSEUIMessages.PropertyPreferencePage_02);
- dialog.setContentProvider(new IStructuredContentProvider() {
- public void dispose() {
- }
-
- public Object[] getElements(Object inputElement) {
- return ((IWorkspace) inputElement).getRoot().getProjects();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- });
- dialog.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(), SSEUIPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
- dialog.setInput(ResourcesPlugin.getWorkspace());
- dialog.setTitle(SSEUIMessages.PropertyPreferencePage_01);
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- if (result.length > 0) {
- IProject project = (IProject) dialog.getResult()[0];
- Map data = new HashMap();
- data.put(DISABLE_LINK, Boolean.TRUE);
- PreferencesUtil.createPropertyDialogOn(getShell(), project, getPropertyPageID(), new String[]{getPropertyPageID()}, data).open();
- }
- }
- }
-
- void openWorkspaceSettings() {
- Map data = new HashMap();
- data.put(DISABLE_LINK, Boolean.TRUE);
- PreferencesUtil.createPreferenceDialogOn(getShell(), getPreferencePageID(), new String[]{getPreferencePageID()}, data).open();
- }
-
- public boolean performOk() {
- boolean ok = super.performOk();
- IScopeContext[] preferenceScopes = createPreferenceScopes();
- if (getProject() != null) {
- if (isElementSettingsEnabled()) {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " setting " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " (" + true + ") in scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- preferenceScopes[0].getNode(getPreferenceNodeQualifier()).putBoolean(getProjectSettingsKey(), fEnableProjectSettings.getSelection());
- }
- else {
- if (_debugPreferences) {
- System.out.println(getClass().getName() + " removing " + TaskTagPreferenceKeys.TASK_TAG_PER_PROJECT + " from scope " + preferenceScopes[0].getName() + ":" + preferenceScopes[0].getLocation()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- preferenceScopes[0].getNode(getPreferenceNodeQualifier()).remove(getProjectSettingsKey());
- }
- }
- return ok;
- }
-
- private void updateLinkEnablement() {
- if (fData != null && fProjectSettingsLink != null) {
- fProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(fData.get(DISABLE_LINK)));
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java b/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java
deleted file mode 100644
index 3f05cc2254..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src-tasktags/org/eclipse/wst/sse/ui/internal/preferences/ui/TaskTagPreferencePage.java
+++ /dev/null
@@ -1,353 +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.sse.ui.internal.preferences.ui;
-
-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.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IPreferencesService;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.dialogs.ControlEnableState;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-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.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.tasks.TaskScanningScheduler;
-import org.eclipse.wst.sse.core.internal.tasks.TaskTagPreferenceKeys;
-import org.eclipse.wst.sse.ui.internal.Logger;
-import org.eclipse.wst.sse.ui.internal.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-import org.eclipse.wst.sse.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout;
-import org.osgi.service.prefs.BackingStoreException;