Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'docs/org.eclipse.jst.ws.doc.user/images/soapudws.gif')
-rw-r--r--docs/org.eclipse.jst.ws.doc.user/images/soapudws.gifbin17234 -> 0 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/docs/org.eclipse.jst.ws.doc.user/images/soapudws.gif b/docs/org.eclipse.jst.ws.doc.user/images/soapudws.gif
deleted file mode 100644
index efb42f500..000000000
--- a/docs/org.eclipse.jst.ws.doc.user/images/soapudws.gif
+++ /dev/null
Binary files differ

Back to the top

idth: 99.8%;'/> -rw-r--r--bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF66
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/about.html34
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/build.properties22
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/dtool16/newjsp_wiz.gifbin360 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/etool16/newjsp_wiz.gifbin598 -> 0 bytes-rw-r--r--bundles/org.eclipse.jst.jsp.ui/icons/full/obj16/class_obj.gifbin586 -> 0 bytes-rw-r--r--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.pngbin3973 -> 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.properties105
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/plugin.xml1024
-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.java385
-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.java174
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java99
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties154
-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.java130
-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.java202
-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.java83
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java1330
-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.java149
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java92
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java305
-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.java219
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java389
-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.java228
-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.java260
-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.java49
-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.java116
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java38
-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.java65
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java256
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java124
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java454
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java112
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java85
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java173
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java217
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java78
-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.java74
-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/refactoring/MoveElementHandler.java76
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java78
-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.java78
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java83
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java300
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java422
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java170
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java80
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java80
-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/JSPSyntaxColoringPage.java854
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java165
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java91
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java277
-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.java423
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java73
-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.java324
-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.java283
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java45
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java145
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java46
-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.java52
-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.java246
-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/HTMLValidationReporter.java106
-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/validation/JSPContentSourceValidator.java415
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPMarkupValidator.java163
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPSourceValidator.java77
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java61
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/MarkupValidatorAdapterFactory.java22
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java257
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java505
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java164
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagFileWizardPage.java256
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java505
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagWizard.java146
-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.properties60
-rw-r--r--bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml46
-rw-r--r--bundles/org.eclipse.wst.css.core/.classpath13
-rw-r--r--bundles/org.eclipse.wst.css.core/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.css.core/.options2
-rw-r--r--bundles/org.eclipse.wst.css.core/.project28
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs81
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF45
-rw-r--r--bundles/org.eclipse.wst.css.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.css.core/build.properties24
-rw-r--r--bundles/org.eclipse.wst.css.core/component.xml16
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd143
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml838
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml2270
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml158
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml630
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties34
-rw-r--r--bundles/org.eclipse.wst.css.core/cssprofile/description.txt15
-rw-r--r--bundles/org.eclipse.wst.css.core/plugin.properties19
-rw-r--r--bundles/org.eclipse.wst.css.core/plugin.xml91
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java43
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java156
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java98
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java190
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java101
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java266
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java164
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java198
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java89
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java1369
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java219
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java417
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java85
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java122
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.java194
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java239
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java109
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java1440
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java19
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java367
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java200
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java173
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/HeadParserToken.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java99
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java63
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java133
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java79
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java1083
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java163
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java67
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java227
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java230
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java155
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java268
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java624
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java126
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java1296
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java416
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java561
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java293
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java470
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java27
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java98
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java39
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java362
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java203
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java56
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java80
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java422
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java42
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java207
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java335
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java281
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java229
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java272
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java69
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java272
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java98
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java612
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java70
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java124
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java155
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java104
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java118
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java126
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java91
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java32
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java40
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java60
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java155
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java174
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java123
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java1003
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java168
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java165
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java48
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java61
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java184
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java58
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java319
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java119
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java126
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java97
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java71
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java184
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java339
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java211
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java383
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java194
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java273
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java399
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java325
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java166
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java260
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java86
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java16
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java20
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java17
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java18
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java37
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java69
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java261
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java92
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java120
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java90
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java137
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java75
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java63
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java75
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java96
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.java44
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java75
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java41
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java148
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java52
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java33
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java33
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java81
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java86
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java108
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java95
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java263
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java73
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java30
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java171
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java293
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java58
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java72
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java113
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java50
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java38
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java54
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java56
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java51
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java255
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java27
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java1972
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/ICSSTokenizer.java37
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java80
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java101
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java72
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java143
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java24
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java25
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java33
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java41
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java41
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java30
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java40
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java94
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java34
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java46
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java68
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java46
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java60
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java32
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java77
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java73
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java24
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java22
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java47
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java26
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java49
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java23
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java62
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java229
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java25
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java36
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java360
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java39
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java169
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java37
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java181
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java114
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java188
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java77
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java35
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java61
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java335
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java71
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java61
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java76
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java97
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java101
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java210
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java387
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java142
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java150
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java179
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java158
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java130
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java140
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderWidthShorthandAdapter.java130
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/CSSPropertyContext.java2997
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipBottomSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipLeftSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipRightSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipSubStyleAdapter.java132
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ClipTopSubStyleAdapter.java53
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/FontShorthandAdapter.java240
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ICSS2Properties.java127
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/IShorthandAdapter.java31
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ISubPropertyAdapter.java29
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ListStyleShorthandAdapter.java110
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/MarginShorthandAdapter.java129
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/PaddingShorthandAdapter.java129
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/ValueData.java45
-rw-r--r--bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java24
-rw-r--r--bundles/org.eclipse.wst.css.ui/.classpath34
-rw-r--r--bundles/org.eclipse.wst.css.ui/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.css.ui/.options1
-rw-r--r--bundles/org.eclipse.wst.css.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.css.ui/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF50
-rw-r--r--bundles/org.eclipse.wst.css.ui/about.html34
-rw-r--r--bundles/org.eclipse.wst.css.ui/build.properties23
-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/dtool16/newcss_wiz.gifbin231 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/etool16/newcss_wiz.gifbin356 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/aural_props.gifbin229 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/boxmodel_props.gifbin348 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/charset_rule.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/class_selector.gifbin338 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/colback_props.gifbin610 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/content_props.gifbin366 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyname.gifbin612 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_function.gifbin164 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_identifier.gifbin314 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/css_propertyvalue_unit.gifbin218 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/font_props.gifbin120 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/fontface_rule.gifbin347 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/id_selector.gifbin374 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_rule.gifbin363 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/link_selector.gifbin339 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/media_rule.gifbin592 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/other_props.gifbin600 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/page_rule.gifbin586 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/pagedmedia_props.gifbin597 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/pseudo.gifbin588 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/sort.gifbin162 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/sourceEditor.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/style_rule.gifbin371 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/stylesheet.gifbin579 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/table_props.gifbin599 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag-template.gifbin205 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/tag_selector.gifbin346 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/text_props.gifbin601 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/ui_props.gifbin608 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/unknown_rule.gifbin365 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/obj16/visual_props.gifbin609 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/icons/full/wizban/newcssfile_wiz.pngbin4260 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.css.ui/plugin.properties66
-rw-r--r--bundles/org.eclipse.wst.css.ui/plugin.xml480
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java163
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/ActionContributorCSS.java121
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIMessages.java126
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPlugin.java99
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/CSSUIPluginResources.properties115
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/Logger.java156
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/autoedit/StructuredAutoEditStrategyCSS.java595
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSCACandidate.java104
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistContext.java416
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSContentAssistProcessor.java335
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalArranger.java176
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGenerator.java233
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForAtmarkRule.java294
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationName.java168
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForDeclarationValue.java371
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForHTMLTag.java157
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSProposalGeneratorForPseudoSelector.java139
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/CSSTemplateCompletionProcessor.java72
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentassist/HTML40Namespace.java890
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/CSSNodeAdapter.java593
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentoutline/JFaceNodeAdapterFactoryCSS.java37
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ContentSettingsRegistry.java40
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSContentSettingsPropertyPage.java106
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/contentproperties/ui/CSSWebContentSettingsPropertyPage.java156
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupActionCSSDelegate.java134
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/edit/ui/CleanupDialogCSS.java292
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/CSSEditorPluginImages.java54
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/editor/IHelpContextIds.java49
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/CleanupDocumentHandler.java120
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectEnclosingHandler.java50
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectNextHandler.java65
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/handlers/StructuredSelectPreviousHandler.java60
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageHelper.java183
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/image/CSSImageType.java235
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceInitializer.java71
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/CSSUIPreferenceNames.java37
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSColorPage.java221
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSFilesPreferencePage.java67
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSourcePreferencePage.java273
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSSyntaxColoringPage.java881
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/preferences/ui/CSSTemplatePreferencePage.java165
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionAnnotationModelChanges.java55
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterCSS.java303
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionModelNodeAdapterFactoryCSS.java169
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/ProjectionViewerInformation.java196
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/projection/StructuredTextFoldingProviderCSS.java260
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSPropertySource.java355
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/properties/CSSTextPropertyDescriptor.java112
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/registry/AdapterFactoryProviderCSS.java49
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectEnclosingCSSActionDelegate.java64
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectNextCSSActionDelegate.java81
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/selection/StructuredSelectPreviousCSSActionDelegate.java76
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/IStyleConstantsCSS.java31
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForCSS.java198
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/style/LineStyleProviderForEmbeddedCSS.java130
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/EncodingTemplateVariableResolverCSS.java38
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeCSS.java34
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/templates/TemplateContextTypeIdsCSS.java20
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/text/CSSDocumentRegionEdgeMatcher.java83
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupport.java67
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/FacetModuleCoreSupportDelegate.java84
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSFileWizardPage.java225
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSTemplatesWizardPage.java505
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/internal/wizard/NewCSSWizard.java145
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/CSSContentOutlineConfiguration.java121
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeContentProviderCSS.java176
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/JFaceNodeLabelProviderCSS.java115
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/contentoutline/SortAction.java55
-rw-r--r--bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSPropertySheetConfiguration.java193
-rw-r--r--bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.properties12
-rw-r--r--bundles/org.eclipse.wst.css.ui/templates/cssdefault-templates.xml16
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.classpath11
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.project26
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.dtd.core/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF44
-rw-r--r--bundles/org.eclipse.wst.dtd.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.dtd.core/build.properties27
-rw-r--r--bundles/org.eclipse.wst.dtd.core/component.xml15
-rw-r--r--bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMDocumentFactoryDTD.java44
-rw-r--r--bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/CMNodeImpl.java36
-rw-r--r--bundles/org.eclipse.wst.dtd.core/contentmodel/org/eclipse/wst/dtd/core/internal/contentmodel/DTDImpl.java776
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAnyContent.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDAttribute.java240
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicType.java66
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDBasicTypeKind.java332
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDConstants.java21
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDContent.java63
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDDefaultKind.java194
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElement.java126
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementContent.java112
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDElementReferenceContent.java59
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEmptyContent.java26
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntity.java220
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityContent.java65
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEntityReferenceContent.java64
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumGroupKind.java139
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDEnumerationType.java101
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDErrorMessage.java49
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExtender.java19
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDExternalEntity.java151
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFactory.java186
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDFile.java157
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupContent.java88
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDGroupKind.java139
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDInternalEntity.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDLexicalInfo.java99
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDNotation.java140
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDObject.java21
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDOccurrenceType.java193
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPCDataContent.java25
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDPackage.java2392
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDParameterEntityReference.java61
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDRepeatableContent.java65
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDResource.java45
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDSourceOffset.java45
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/DTDType.java31
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/XMLSchemaDefinedType.java471
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAnyContentImpl.java181
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDAttributeImpl.java980
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDBasicTypeImpl.java427
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDContentImpl.java189
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementContentImpl.java377
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementImpl.java654
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDElementReferenceContentImpl.java242
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEmptyContentImpl.java172
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityContentImpl.java193
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityImpl.java1198
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEntityReferenceContentImpl.java323
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDEnumerationTypeImpl.java362
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDExternalEntityImpl.java400
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFactoryImpl.java448
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDFileImpl.java821
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDGroupContentImpl.java292
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDIdHelper.java88
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDInternalEntityImpl.java239
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDNotationImpl.java904
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPCDataContentImpl.java171
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDPackageImpl.java1215
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDParameterEntityReferenceImpl.java610
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/impl/DTDRepeatableContentImpl.java265
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDAdapterFactory.java440
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDMetrics.java125
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDModelBuilder.java1844
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDObjectFinder.java173
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPathnameUtil.java352
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDPrinter.java525
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceFactoryImpl.java79
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDResourceImpl.java166
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDSwitch.java489
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUniqueNameHelper.java174
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDUtil.java1217
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/DTDVisitor.java315
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/org/eclipse/wst/dtd/core/internal/emf/util/ExternalDTDModel.java85
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/rose/DTD.cat3812
-rw-r--r--bundles/org.eclipse.wst.dtd.core/emfmodel/rose/dtdmodel.mdl7526
-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/DTDFile.gifbin351 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/any.gifbin136 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute.gifbin167 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/attribute_list.gifbin366 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/comment.gifbin196 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element.gifbin353 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/element_ref.gifbin585 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/emptycontent.gifbin156 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity.gifbin124 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/entity_reference.gifbin316 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_el.gifbin366 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_ent.gifbin339 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_not.gifbin341 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/fldr_unrec.gifbin382 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_attlist_obj.gifbin369 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/folder_comments_obj.gifbin358 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/genhtmform_wiz.gifbin3357 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/notation.gifbin177 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/one.gifbin141 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onechoice.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormore.gifbin145 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormorechoice.gifbin139 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/oneormoresequence.gifbin147 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/onesequence.gifbin91 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optional.gifbin149 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalchoice.gifbin140 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/optionalsequence.gifbin149 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/txtext.gifbin349 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/unrecognized_content.gifbin356 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormore.gifbin140 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormorechoice.gifbin135 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/icons/full/obj16/zeroormoresequence.gifbin146 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.dtd.core/plugin.properties21
-rw-r--r--bundles/org.eclipse.wst.dtd.core/plugin.xml141
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/AttNode.java95
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/Attlist.java146
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/BaseNode.java66
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMBasicNode.java42
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMGroupNode.java62
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNode.java30
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMNodeType.java30
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMReferenceNode.java38
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/CMRepeatableNode.java34
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTD.java89
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDParser.java768
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDSaxArtifactVisitor.java64
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DTDScanner.java1128
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/DeclNode.java103
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ElementDecl.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityDecl.java242
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/EntityPool.java72
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ErrorMessage.java114
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/ExternalID.java154
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/NotationDecl.java77
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/StringParser.java485
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/TString.java350
-rw-r--r--bundles/org.eclipse.wst.dtd.core/saxparser/org/eclipse/wst/dtd/core/internal/saxparser/XMLCharacterProperties.java448
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationMessages.java37
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidationResources.properties27
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/DTDValidator.java449
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/ElementRefLocation.java86
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/DTDValidator.java50
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src-validation/org/eclipse/wst/dtd/core/internal/validation/eclipse/Validator.java38
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Attribute.java376
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeEnumList.java72
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/AttributeList.java118
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMBasicNode.java165
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMGroupNode.java430
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMNode.java135
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/CMRepeatableNode.java81
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Comment.java75
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCoreMessages.java95
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePlugin.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDCorePluginResources.properties127
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDFile.java682
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDNode.java330
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/DTDResource.java56
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Element.java205
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Entity.java333
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ExternalNode.java250
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Logger.java143
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NamedTopLevelNode.java135
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/NodeList.java109
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Notation.java29
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/ParameterEntityReference.java112
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/TopLevelNode.java84
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/Unrecognized.java39
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/content/ContentDescriberForDTD.java206
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/document/DTDModelImpl.java273
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/AbstractResourceEncodingDetector.java261
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/ByteReader.java109
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentCharsetDetector.java61
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java74
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/NullMemento.java36
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/IDTDFileListener.java24
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/event/NodesEvent.java32
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/DTDModelLoader.java47
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/modelhandler/ModelHandlerForDTD.java46
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionFactory.java28
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionParser.java271
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/parser/DTDRegionTypes.java76
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceInitializer.java35
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/preferences/DTDCorePreferenceNames.java32
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/contenttype/ContentTypeIdForDTD.java47
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/document/DTDModel.java27
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/provisional/text/IDTDPartitionTypes.java24
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tasks/DTDFileTaskScanner.java28
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentReParser.java41
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/DTDStructuredDocumentRegionFactory.java33
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/RegionIterator.java84
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java42
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/DTDTokenizer.java1090
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Token.java61
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/Yytoken.java89
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtd.flex327
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/tokenizer/dtdskeleton317
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDBatchNodeDelete.java57
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDExternalReferenceRemover.java134
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDModelUpdater.java135
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDNotationReferenceRemover.java93
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDReferenceUpdater.java196
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDUniqueNameHelper.java95
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/DTDVisitor.java108
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/util/LabelValuePair.java30
-rw-r--r--bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java24
-rw-r--r--bundles/org.eclipse.wst.html.core/.classpath12
-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.prefs79
-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.MF38
-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.properties16
-rw-r--r--bundles/org.eclipse.wst.html.core/plugin.xml213
-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.java62
-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.java89
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/ElementNodeCleanupHandler.java695
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/cleanup/HTMLCleanupHandlerFactory.java104
-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.java30
-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.java93
-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.java79
-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/JCM20DocImpl.java26
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JCMDocImpl.java77
-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/JSP20ElementCollection.java491
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/JSP20Namespace.java97
-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.java900
-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/Tag20ElementCollection.java693
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/TagCMDocImpl.java23
-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.java1990
-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.java186
-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.java136
-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.java366
-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.java94
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format/HTMLElementFormatter.java394
-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.java749
-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.java235
-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.java453
-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.java451
-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.java116
-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.java247
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/modelquery/XHTMLAssociationProvider.java209
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceInitializer.java124
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/preferences/HTMLCorePreferenceNames.java277
-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.java31
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java259
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/AbstractErrorInfo.java42
-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/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.java254
-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.java226
-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.java383
-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.java351
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java32
-rw-r--r--bundles/org.eclipse.wst.html.ui/.classpath12
-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.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.html.ui/.settings/org.eclipse.jdt.ui.prefs4
-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.prefs16
-rw-r--r--bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF51
-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.pngbin3833 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.properties74
-rw-r--r--bundles/org.eclipse.wst.html.ui/plugin.xml615
-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.java150
-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.java560
-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.java276
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java199
-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.properties172
-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.java199
-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.java508
-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.java383
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/correction/CorrectionAssistantProviderHTML.java54
-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/edit/ui/CleanupDocumentHandler.java137
-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/handlers/HTMLFindOccurrencesHandler.java133
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java117
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java92
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/AbstractValidationSettingsPage.java398
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/EmptyFilePreferencePage.java100
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java127
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java127
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java331
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSyntaxColoringPage.java871
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java157
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTypingPreferencePage.java105
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLValidationPreferencePage.java331
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/PropertyPreferencePage.java300
-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.java350
-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.java65
-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.java26
-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/FacetModuleCoreSupport.java65
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/FacetModuleCoreSupportDelegate.java84
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLFileWizardPage.java224
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLTemplatesWizardPage.java505
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java145
-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.properties51
-rw-r--r--bundles/org.eclipse.wst.html.ui/templates/htmldefault-templates.xml46
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.classpath7
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.options12
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.project28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.core.prefs96
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.jdt.ui.prefs51
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/META-INF/MANIFEST.MF41
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/about.html28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/build.properties20
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/component.xml25
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/plugin.properties19
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/plugin.xml165
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/schema/javascriptPreProcessor.exsd104
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/IncrementalBuilder.java47
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JSPCorePluginResources.properties24
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCoreMessages.java47
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/JsCorePlugin.java76
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/Logger.java155
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebDocumentChangeListener.java29
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/IWebResourceChangedListener.java25
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/Messages.java41
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/WebResourceChangeHandler.java209
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/modelhandler/messages.properties11
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureInstaller.java57
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsNatureUninstaller.java62
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/JsWebNature.java284
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/Messages.java42
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/WebProjectJsGlobalScopeContainerInitializer.java237
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/project/messages.properties19
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/ContentTypeIdForEmbededJs.java35
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/contenttype/IContentDescriptionForJSP.java29
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/provisional/text/IJSPPartitionTypes.java30
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/tasks/JsFileTaskScanner.java28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsBatchValidator.java438
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/JsValidator.java358
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/internal/validation/Util.java57
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/CompilationUnitHelper.java69
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/DocumentChangeListenerToTextEdit.java77
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/HTML40Namespace.java679
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslation.java167
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/IJsTranslator.java100
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsDataTypes.java47
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsNameManglerUtil.java135
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsProblemRequestor.java92
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslation.java591
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapter.java165
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslationAdapterFactory.java91
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/JsTranslator.java709
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Messages.java46
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/NodeHelper.java246
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/Util.java54
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/WebRootFinder.java63
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/messages.properties15
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/IndexWorkspaceJob.java172
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JSDTSearchDocumentDelegate.java84
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsIndexManager.java775
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsPathIndexer.java119
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchDocument.java261
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchParticipant.java117
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchScope.java124
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/JsSearchSupport.java594
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/javascript/search/NullSearchDocument.java49
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.core/src/org/eclipse/wst/jsdt/web/core/text/IJsPartitions.java26
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.classpath7
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.project28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.core.prefs96
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.jdt.ui.prefs51
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/META-INF/MANIFEST.MF52
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/about.html28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/build.properties17
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/icons/eye_icon.gifbin1037 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/plugin.properties72
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/plugin.xml704
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/Messages.java46
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/SetupProjectsWizzard.java108
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/StructuredTextViewerConfigurationJSDT.java62
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/WebProjectJsGlobalScopeUIInitializer.java38
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubAction.java100
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/AddJavaDocStubOperation.java110
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesAction.java60
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/FindReferencesInWorkingSetAction.java61
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/JsElementActionProxy.java77
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/Messages.java45
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenCallHierarchyAction.java50
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/OpenTypeHierarchy.java43
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowHistoryAction.java94
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInNavigatorAction.java94
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/ShowInScriptExplorerAction.java120
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SimpleJSDTActionProxy.java199
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/SourceActionsAction.java61
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/StandardEditorActionsAction.java234
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/actions/messages.properties28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionConstantsJs.java25
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/IActionDefinitionIdsJs.java28
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JSPUIPluginResources.properties87
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIMessages.java110
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/JsUIPlugin.java98
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/Logger.java156
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForJs.java84
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/autoedit/AutoEditStrategyForTabs.java187
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTCompletionProposal.java81
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java113
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistantProcessor.java253
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContetAssistInvocationContext.java84
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java108
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java226
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTTemplateAssistProcessor.java65
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/Messages.java42
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/messages.properties14
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/derived/SingleCharReader.java70
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/ActionContributorJSP.java81
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/editor/IHelpContextIds.java45
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/format/FormattingStrategyJSDT.java201
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileEditorInput.java174
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java73
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java80
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlinkDetector.java268
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/URLFileHyperlink.java169
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java89
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/XMLHyperlinkDetector.java502
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java347
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPJavaSelectionProvider.java65
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameChange.java74
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameParticipant.java104
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMethodRenameRequestor.java54
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPMoveElementActionDelegate.java121
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameChange.java74
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameParticipant.java84
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPPackageRenameRequestor.java47
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPRenameElementActionDelegate.java112
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveChange.java72
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveParticipant.java94
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeMoveRequestor.java70
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameChange.java74
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameParticipant.java95
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/refactoring/JSPTypeRenameRequestor.java73
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/BasicJsSearchRequestor.java148
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesActionDelegate.java47
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsFindOccurrencesProcessor.java86
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsOccurrencesSearchResult.java35
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchQuery.java122
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSearchRequestor.java81
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/JsSingleFileSearchRequestor.java38
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsMatchPresentation.java52
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/java/search/ui/JsQueryParticipant.java90
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/registry/AdapterFactoryProviderForJSDT.java74
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/IStyleConstantsJs.java22
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/IStyleConstantsJSDT.java26
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JSDTCodeScanner.java90
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/JavaWordDetector.java35
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/style/java/LineStyleProviderForJSDT.java339
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/HTMLPrinter.java203
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JSDTHoverProcessor.java168
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/taginfo/JsWordFinder.java71
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsCodeReader.java225
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsDocumentRegionEdgeMatcher.java34
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/text/JsPairMatcher.java185
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/messages.properties11
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/rino.jpgbin525 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/IJavaWebNode.java34
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterFactoryForJSDT.java55
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JFaceNodeAdapterForJs.java397
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/JsJfaceNode.java281
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/Messages.java46
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/contentoutline/messages.properties11
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JFaceNodeAdapterForJs.java183
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsContentOutlineConfig.java64
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsLabelProvider.java42
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsMenuListener.java162
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/JsWebElementProvider.java25
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/views/provisional/contentoutline/XMLLabelProvider.java115
-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.GIFbin2407 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/web1.JPGbin1028 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.sse.core/.classpath14
-rw-r--r--bundles/org.eclipse.wst.sse.core/.cvsignore9
-rw-r--r--bundles/org.eclipse.wst.sse.core/.options18
-rw-r--r--bundles/org.eclipse.wst.sse.core/.project28
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.core.prefs80
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.sse.core/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex279
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.java1441
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizerGenJava.cmd23
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/jflexout.txt6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.jFlex300
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizer.java1206
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/HTMLHeadTokenizerGenJava.cmd23
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/jflexout.txt8
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton268
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/HTMLHeadTokenizer/skeleton.readme6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.jFlex98
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10Names.java595
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/XML10NamesGenJavaJFlex14.cmd25
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XML10Names/jflexout.txt6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.jFlex260
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizer.java905
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/XMLHeadTokenizerGenJava.cmd28
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexerr.txt0
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/jflexout.txt8
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/XMLHeadTokenizer/oldXMLHeadTokenizer.skeleton263
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/CSSTokenizer.jflex520
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/CSSTokenizer/devel/flex.cmd6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/README9
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.java4002
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/JSPTokenizer.jflex2885
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.java1918
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/XMLTokenizer.jflex1330
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flex.sh7
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexj.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/flexx.cmd3
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse377
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/SedModel/HTMLTokenizer/devel/skeleton.sse.readme6
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/build.xml75
-rw-r--r--bundles/org.eclipse.wst.sse.core/DevTimeSupport/devTimeSupportInfo.txt16
-rw-r--r--bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF50
-rw-r--r--bundles/org.eclipse.wst.sse.core/README.txt2
-rw-r--r--bundles/org.eclipse.wst.sse.core/about.html34
-rw-r--r--bundles/org.eclipse.wst.sse.core/build.properties34
-rw-r--r--bundles/org.eclipse.wst.sse.core/component.xml20
-rw-r--r--bundles/org.eclipse.wst.sse.core/config/charset.properties96
-rw-r--r--bundles/org.eclipse.wst.sse.core/config/defaultIANA.properties26
-rw-r--r--bundles/org.eclipse.wst.sse.core/config/override.properties24
-rw-r--r--bundles/org.eclipse.wst.sse.core/doc/book.css106
-rw-r--r--bundles/org.eclipse.wst.sse.core/doc/schema.css66
-rw-r--r--bundles/org.eclipse.wst.sse.core/handyStuff.jpage1
-rw-r--r--bundles/org.eclipse.wst.sse.core/plugin.properties25
-rw-r--r--bundles/org.eclipse.wst.sse.core/plugin.xml58
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/adaptOnCreateFactory.exsd93
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/commentElementHandler.exsd112
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/contentTypeFactoryContribution.exsd93
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/cssprofile.exsd130
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/documentTypes.exsd172
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/embeddedTypeHandler.exsd109
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/formatProcessors.exsd108
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/modelHandler.exsd130
-rw-r--r--bundles/org.eclipse.wst.sse.core/schema/taskscanner.exsd123
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractContentSettingsHandler.java83
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/AbstractSubject.java54
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettings.java689
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsChangeSubject.java62
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsCreator.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsFileHandler.java147
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSelfHandler.java93
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ContentSettingsSynchronizer.java174
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettings.java83
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsHandler.java25
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/IContentSettingsListener.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/INotify.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/ISubject.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-contentproperties/org/eclipse/wst/sse/internal/contentproperties/SimpleNodeOperator.java354
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedIO.java259
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedReaderCreator.java542
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CodedStreamCreator.java509
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonCharsetNames.java258
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/CommonEncodingPreferenceNames.java81
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentBasedPreferenceGateway.java165
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ContentTypeEncodingPreferences.java179
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingMemento.java247
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/EncodingRule.java59
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/ICodedResourcePlugin.java19
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IContentDescriptionExtended.java42
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IResourceCharsetDetector.java21
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/IStreamCharsetDetector.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/NonContentBasedEncodingRules.java139
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Assert.java120
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedReader.java58
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/BufferedLimitedStream.java79
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ByteReader.java109
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/CodedResourcePlugin.java55
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/Logger.java158
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/NullInputStream.java69
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/ResourceBundleHelper.java61
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/encoding/util/UnicodeBOMEncodingDetector.java213
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/CharConversionErrorWithDetail.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedInputExceptionWithDetail.java103
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/MalformedOutputExceptionWithDetail.java36
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-encoding/org/eclipse/wst/sse/core/internal/exceptions/UnsupportedCharsetExceptionWithDetail.java47
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/IFileTaskScanner.java84
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/provisional/tasks/TaskTag.java52
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/FileTaskScannerRegistryReader.java183
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/StructuredFileTaskScanner.java329
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningJob.java242
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskScanningScheduler.java135
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/TaskTagPreferenceKeys.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src-tasktags/org/eclipse/wst/sse/core/internal/tasks/WorkspaceTaskScanner.java460
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/StructuredModelManager.java72
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java825
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/IExecutionDelegate2.java21
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ILockable.java30
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/JSPAwareAdapterFactory.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/Logger.java216
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ModelManagerPluginRegistryReader.java198
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NoCancelProgressMonitor.java35
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NotImplementedException.java37
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/NullMemento.java37
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapter.java38
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/PropagatingAdapterFactory.java29
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECoreMessages.java39
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePlugin.java93
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/SSECorePluginResources.properties21
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/AbstractStructuredCleanupProcessor.java464
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupHandler.java23
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupPreferences.java56
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/IStructuredCleanupProcessor.java114
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredCleanupPreferences.java135
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandler.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/cleanup/StructuredContentCleanupHandlerImpl.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/AbstractDocumentLoader.java438
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/DocumentReader.java131
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentCharsetDetector.java22
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/IDocumentLoader.java70
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/StructuredDocumentFactory.java66
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/document/TextUtilities.java73
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/filebuffers/BasicStructuredDocumentFactory.java91
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/AbstractStructuredFormatProcessor.java523
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatContraints.java39
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatPreferences.java33
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatProcessor.java70
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/IStructuredFormatter.java36
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatContraints.java53
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/format/StructuredFormatPreferences.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/AbstractModelHandler.java72
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/EmbeddedTypeHandler.java77
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IDocumentTypeHandler.java42
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/modelhandler/IModelHandler.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockMarker.java103
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTagParser.java32
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/BlockTokenizer.java58
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/IBlockedStructuredDocumentRegion.java41
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/JSPCapableParser.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/RegionParser.java52
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandler.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionHandlerExtension.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParser.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/StructuredDocumentRegionParserExtension.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/ltk/parser/TagMarker.java80
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractModelLoader.java545
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/AbstractStructuredModel.java1565
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/FactoryRegistry.java179
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/LifecycleNotificationManager.java119
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelLifecycleEvent.java117
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/model/ModelManagerImpl.java2076
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistry.java35
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryImpl.java132
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/EmbeddedTypeRegistryReader.java71
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistry.java311
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerRegistryReader.java106
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/ModelHandlerUtility.java50
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/modelhandler/PluginContributedFactoryReader.java126
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ContextRegion.java197
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/parser/ForeignRegion.java81
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/CommonModelPreferenceNames.java76
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/preferences/PreferenceInitializer.java32
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/propertytester/StructuredFilePropertyTester.java82
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractAdapterFactory.java158
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/AbstractNotifier.java240
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/DocumentChanged.java61
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLifecycleListener.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelLoader.java87
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelManager.java297
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IModelStateListener.java64
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapter.java43
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeAdapterFactory.java76
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/INodeNotifier.java103
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IStructuredModel.java391
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/IndexedRegion.java74
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/StructuredModelManager.java75
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IEncodedDocument.java58
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/document/IStructuredDocumentProposed.java223
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/AboutToBeChangedEvent.java44
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IModelAboutToBeChangedListener.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/IStructuredDocumentListener.java30
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentContentEvent.java40
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NewDocumentEvent.java68
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/NoChangeEvent.java73
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionChangedEvent.java80
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/RegionsReplacedEvent.java85
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentEvent.java146
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/events/StructuredDocumentRegionsReplacedEvent.java73
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceAlreadyExists.java40
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/exceptions/ResourceInUse.java40
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java338
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelStateListenerProposed.java36
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/INodeAdapterFactoryManager.java33
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelEvent.java17
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IStructuredModelProposed.java152
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java218
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java163
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java52
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java12
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java86
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java72
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java158
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java178
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java40
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java131
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java2973
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocumentRegion.java599
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CharSequenceReader.java127
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/CoreNodeList.java130
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/DeleteEqualPositionUpdater.java66
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/GenericPositionManager.java409
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IExecutionDelegatable.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/IRegionComparible.java20
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/JobSafeStructuredDocument.java472
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/MinimalDocument.java445
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/ReadOnlyPosition.java37
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentReParser.java1651
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionEnumeration.java87
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentRegionIterator.java115
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentSequentialRewriteTextStore.java132
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/StructuredDocumentTextStore.java191
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/SubSetTextStore.java127
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/TextRegionListImpl.java223
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredRegion.java27
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/IStructuredTypedRegion.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredRegion.java91
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/SimpleStructuredTypedRegion.java88
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java626
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/CommandCursorPosition.java66
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IDocumentSelectionMediator.java35
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/IStructuredTextUndoManager.java155
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommand.java34
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCommandImpl.java137
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextCompoundCommandImpl.java260
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/StructuredTextUndoManager.java658
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/undo/UndoDocumentEvent.java45
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Assert.java164
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Debug.java206
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/DocumentInputStream.java108
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/JarUtilities.java390
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/PathHelper.java148
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ProjectResolver.java259
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ResourceUtil.java79
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/ScriptLanguageKeys.java39
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Sorter.java77
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/TextUtilities.java63
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/URIResolver.java81
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/util/Utilities.java140
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ErrorInfo.java26
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationAdapter.java31
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationMessage.java70
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidationReporter.java28
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/validate/ValidatorGroupListener.java78
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java24
-rw-r--r--bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/utils/StringUtils.java743
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/.cvsignore2
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/.project22
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/.settings/org.eclipse.pde.prefs12
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/META-INF/MANIFEST.MF9
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/about.html134
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720.htm82
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/about_files/copyright-software-19980720_files/base.css69
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/about_files/wsdl-schema-files-license.txt29
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/build.properties29
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/HTMLlat1.ent194
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/HTMLspecial.ent77
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/HTMLsymbol.ent241
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/frameset.dtd37
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/loose.dtd1093
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/strict.dtd870
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/wml11.dtd355
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/wml13.dtd4
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-basic10-f.dtd3086
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-lat1.ent196
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-mobile10-flat.dtd3216
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-special.ent79
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml-symbol.ent242
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-frameset.dtd1225
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-strict.dtd988
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml1-transitional.dtd1196
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/dtds/xhtml11-flat.dtd4513
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/plugin.properties20
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/plugin.xml210
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/xsd/http.xsd81
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/xsd/soap.xsd159
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/xsd/soapenc.xsd585
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/xsd/wsdl-mime.xsd70
-rw-r--r--bundles/org.eclipse.wst.standard.schemas/xsd/wsdl.xsd322
-rw-r--r--bundles/org.eclipse.wst.xml.core/.classpath43
-rw-r--r--bundles/org.eclipse.wst.xml.core/.cvsignore8
-rw-r--r--bundles/org.eclipse.wst.xml.core/.options4
-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.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.core/.settings/org.eclipse.jdt.core.prefs79
-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.prefs16
-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.jFlex254
-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.MF74
-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.properties27
-rw-r--r--bundles/org.eclipse.wst.xml.core/plugin.xml208
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/annotationFiles.exsd113
-rw-r--r--bundles/org.eclipse.wst.xml.core/schema/catalogContributions.exsd283
-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.java220
-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.java79
-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.java100
-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.java125
-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.java1250
-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.java141
-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.java61
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelquery/extension/ModelQueryExtensionManager.java30
-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.java292
-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.java140
-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.java135
-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.java624
-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.java110
-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.java253
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java439
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java642
-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.java96
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java387
-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.properties10
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java79
-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.java237
-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.java357
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLNestedValidatorContext.java55
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationConfiguration.java107
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationInfo.java196
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidationMessages.java36
-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.java800
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/core/AbstractNestedValidator.java514
-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.java102
-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.java155
-rw-r--r--bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/XMLMessageInfoHelper.java112
-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.properties32
-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.java237
-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.java1451
-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.java142
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/AttrImpl.java767
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/CDATASectionImpl.java146
-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.java203
-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.java81
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/DocumentImpl.java1179
-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.java228
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java1474
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityImpl.java247
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/EntityReferenceImpl.java95
-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/ModelParserAdapterExtension.java18
-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.java1063
-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.java144
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/document/ProcessingInstructionImpl.java233
-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.java178
-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.java1182
-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.java2396
-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/formatter/DefaultXMLPartitionFormatter.java1689
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormatterFormatProcessor.java146
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingConstraints.java94
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/XMLFormattingPreferences.java157
-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.java253
-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.java102
-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.java315
-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.java595
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XMLSourceParser.java625
-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.java1912
-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/EmptyTagCloseRegion.java90
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/regions/EndTagOpenRegion.java101
-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.java209
-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.java98
-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.java103
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceInitializer.java63
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/preferences/XMLCorePreferenceNames.java215
-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.java63
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/contentmodel/CMDocType.java41
-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.java101
-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.java425
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java115
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NoMoveFormatter.java28
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java753
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/StructuredFormatPreferencesXML.java81
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/format/TextNodeFormatter.java385
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/provisional/text/IXMLPartitions.java42
-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.java66
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/Propagator.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/validate/ValidationComponent.java54
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java42
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.classpath66
-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.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.xml.ui/.settings/org.eclipse.jdt.ui.prefs51
-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.prefs25
-rw-r--r--bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF61
-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.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/tag_generic_deemphasized_obj.gifbin81 -> 0 bytes-rw-r--r--bundles/org.eclipse.wst.xml.ui/icons/full/obj16/tag_generic_emphasized_obj.gifbin99 -> 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/full/wizban/generatexml_wiz.pngbin4789 -> 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.pngbin4129 -> 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.properties139
-rw-r--r--bundles/org.eclipse.wst.xml.ui/plugin.xml1571
-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.java229
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/CatalogFileTypeRegistryReader.java90
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/EditCatalogEntryDialog.java1053
-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.java201
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/URIUtils.java54
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java304
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntryDetailsView.java115
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogFileType.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java137
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogPreferencePage.java242
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties115
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogTreeViewer.java260
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLQuickScan.java107
-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.pngbin4129 -> 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.java135
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewer.java25
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/IDesignViewerActionBarContributor.java21
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/SourceEditorActionBarContributor.java230
-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.java494
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeExtension.java557
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/ViewerExpandCollapseAction.java66
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorActionDefinitionIds.java33
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorMessages.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginHOLD_OLD.java53
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLEditorPluginImageHelper.java157
-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.java93
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart.java938
-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.java320
-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.java118
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTableTreeViewer.java334
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/XMLTreeExtension.java170
-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/GroupNamePropertyTester.java52
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorDialog.java254
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorUtility.java118
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/ReferencedFileErrorsHandler.java108
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-validation/org/eclipse/wst/xml/ui/internal/validation/core/errorinfo/TaskListTableViewer.java159
-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.java206
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizard.java232
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExampleProjectCreationWizardPage.java111
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ExportXMLCatalogWizard.java90
-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/ImportXMLCatalogPage.java71
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/ImportXMLCatalogWizard.java97
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NamespaceInfoContentBuilder.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewModelWizard.java325
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLGenerator.java422
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLHandler.java71
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLTemplatesWizardPage.java508
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/NewXMLWizard.java964
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLImportActionDelegate.java78
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLSchemaValidationChecker.java71
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizard.java40
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/XMLWizardsMessages.java99
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src-wizards/org/eclipse/wst/xml/ui/internal/wizards/wizardResource.properties101
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java228
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserver.java238
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/DOMObserverAdapter.java78
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/Logger.java163
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLFormattingStrategy.java105
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIMessages.java324
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPlugin.java117
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties331
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractCommentActionXMLDelegate.java117
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AbstractNodeActionManager.java692
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ActionContributorXML.java224
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/AddBlockCommentActionXMLDelegate.java85
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/BaseNodeActionManager.java519
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupActionXMLDelegate.java139
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/CleanupDialogXML.java204
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditAttributeAction.java81
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditDoctypeAction.java192
-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.java98
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/EditSchemaInfoAction.java168
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/GoToMatchingTagAction.java299
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/MenuBuilder.java146
-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.java87
-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/SiblingNavigationAction.java110
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/actions/ToggleCommentActionXMLDelegate.java174
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/AutoEditStrategyForTabs.java200
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java203
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentAssistProcessor.java2496
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AbstractContentModelGenerator.java90
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformation.java115
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationPresenter.java122
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/AttributeContextInformationProvider.java231
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContentAssistRequest.java260
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ContextInfoModelUtil.java66
-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.java274
-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.java49
-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.java166
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentAssistUtilities.java516
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/XMLContentModelGenerator.java154
-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.java172
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeAdapter.java261
-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.java120
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/JFaceNodeLabelProvider.java81
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/RefreshStructureJob.java258
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentoutline/XMLNodeActionManager.java53
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionAssistantProviderXML.java51
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/CorrectionProcessorXML.java47
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/InsertRequiredAttrsQuickAssistProposal.java180
-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.java192
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/QuickFixProcessorXML.java151
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RemoveUnknownElementQuickFixProposal.java162
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/RenameInFileQuickAssistProposal.java188
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/SurroundWithNewElementQuickAssistProposal.java111
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/correction/XMLQuickAssistProcessor.java212
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditAttributeDialog.java172
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditDoctypeDialog.java235
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditElementDialog.java141
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditEntityHelper.java73
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditNamespaceInfoDialog.java274
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/EditProcessingInstructionDialog.java116
-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.java104
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/NamespaceInfoTable.java398
-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.java184
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdDialog.java111
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dialogs/SelectXMLCatalogIdPanel.java147
-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.java201
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/dnd/DragNodeCommand.java312
-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.java327
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/CMImageUtil.java132
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/IHelpContextIds.java48
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImageHelper.java160
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/editor/XMLEditorPluginImages.java57
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/AbstractSiblingNavigationHandler.java92
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/AddBlockCommentHandler.java77
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CleanupdocumentHandler.java119
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CollapseAllHandler.java52
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/CommentHandler.java103
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandAllHandler.java54
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ExpandCollapseAllHandler.java58
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/NextSiblingNavigationHandler.java19
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/PreviousSiblingNavigationHandler.java19
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ReloadDependenciesHandler.java80
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/RemoveBlockCommentHandler.java84
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectEnclosingXMLHandler.java59
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectNextXMLHandler.java97
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/StructuredSelectPreviousXMLHandler.java75
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleCommentHandler.java193
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java138
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/XMLFindOccurencesHandler.java137
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileEditorInput.java171
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java70
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java88
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java554
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesControl.java281
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonAddNamespacesDialog.java205
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/nsedit/CommonEditNamespacesDialog.java327
-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.java346
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EmptyFilePreferencePage.java100
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/EncodingSettings.java359
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/WorkbenchDefaultEncodingSettings.java141
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLColorPage.java288
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLFilesPreferencePage.java259
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSourcePreferencePage.java387
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLSyntaxColoringPage.java870
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTemplatePreferencePage.java169
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLTypingPreferencePage.java106
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceInitializer.java137
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/preferences/XMLUIPreferenceNames.java122
-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.java298
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/ProjectionViewerInformation.java197
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/projection/StructuredTextFoldingProviderXML.java350
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/EnumeratedStringPropertyDescriptor.java71
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/StringComboBoxCellEditor.java119
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/properties/XMLPropertySource.java840
-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.java182
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/registry/AdapterFactoryProviderForXML.java90
-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.java72
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectNextXMLActionDelegate.java109
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/selection/StructuredSelectPreviousXMLActionDelegate.java88
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/IStyleConstantsXML.java43
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/style/LineStyleProviderForXML.java209
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/MarkupTagInfoProvider.java178
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLInformationProvider.java67
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/taginfo/XMLTagInfoHoverProcessor.java362
-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.java27
-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.java95
-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.java608
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/DelegatingSourceValidatorForXML.java56
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupQuickAssistProcessor.java147
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/MarkupValidator.java787
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/contentoutline/XMLContentOutlineConfiguration.java577
-rw-r--r--bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/views/properties/XMLPropertySheetConfiguration.java259
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.properties26
-rw-r--r--bundles/org.eclipse.wst.xml.ui/templates/xmldefault-templates.xml24
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.classpath41
-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.core.resources.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.core.runtime.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.ui.prefs4
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.pde.prefs16
-rw-r--r--bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF22
-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.xml98
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/CMDocumentFactoryXSD.java47
-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.java3125
-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.java203
-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.java71
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/XSDValidator.java250
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src-validation/org/eclipse/wst/xsd/core/internal/validation/eclipse/Validator.java113
-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.java120
-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/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.java39
-rw-r--r--bundles/org.eclipse.wst.xsd.core/src/org/eclipse/wst/xsd/core/internal/preferences/XSDCorePreferenceNames.java32
2445 files changed, 0 insertions, 389719 deletions
diff --git a/bundles/org.eclipse.jst.jsp.ui/.classpath b/bundles/org.eclipse.jst.jsp.ui/.classpath
deleted file mode 100644
index 176e21df45..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.classpath
+++ /dev/null
@@ -1,34 +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/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4" />
- <classpathentry kind="con"
- path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/sse/core/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/xml/core/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/css/core/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/html/core/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/sse/ui/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/xml/ui/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/css/ui/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/html/ui/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/javascript/ui/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/validation/**" />
- <accessrule kind="accessible"
- pattern="org/eclipse/wst/common/componentcore/internal/util/IModuleConstants" />
- </accessrules>
- </classpathentry>
- <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 afa5c91352..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:32 EDT 2006
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.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.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 fa697df5c7..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Wed Mar 28 03:11:45 EDT 2007
-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.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 301c7adde6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.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.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 fc522bba76..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/.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.jst.jsp.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 47d2b9a387..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,66 +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.315.qualifier
-Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jst.jsp.css.ui.internal.properties;x-internal:=true,
- org.eclipse.jst.jsp.css.ui.internal.registry;x-internal:=true,
- org.eclipse.jst.jsp.css.ui.internal.views.properties;x-internal:=true,
- 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.handlers;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.validation;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.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.3.100,3.4.0]",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.5,1.2.0)",
- org.eclipse.wst.html.ui;bundle-version="[1.0.303,1.1.0)",
- org.eclipse.wst.css.ui;bundle-version="[1.0.302,1.1.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.440,1.1.0)",
- org.eclipse.jst.jsp.core;bundle-version="[1.2.122,1.3.0)",
- org.eclipse.wst.html.core;bundle-version="[1.1.204,1.2.0)",
- org.eclipse.wst.css.core;bundle-version="[1.1.210,1.2.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.308,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.304,1.2.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.2,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.4,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.debug;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.search;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ltk.core.refactoring;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.3.0,4.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.6,1.3.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
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 2199df3f05..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>June, 2008</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 f70f87f462..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/build.properties
+++ /dev/null
@@ -1,22 +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
-###############################################################################
-source.. = src/
-bin.includes = .,\
- templates/,\
- plugin.xml,\
- META-INF/,\
- icons/,\
- plugin.properties,\
- about.html
-bin.excludes = @dot/**,\
- temp.folder/**
-src.includes = build.properties
-additional.bundles = org.eclipse.jdt.core.manipulation
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.png b/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.png
deleted file mode 100644
index 1a0ff0cb19..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/icons/full/wizban/newjspfile_wiz.png
+++ /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 0e63e445c1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ /dev/null
@@ -1,105 +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
-# Matthias Fuessel, mat.fuessel@gmx.net - [177387] use base hyperlinking extension points
-###############################################################################
-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=Editor
-JSP_Templates.name=Templates
-JSP_Styles.name=Styles
-JSP_Syntax_Coloring=Syntax Coloring
-JSP_Source_target_name=JSP Source
-JSP_Validation=Validation
-JSP_Property_validation=JSP Syntax
-JSP_Typing=Typing
-
-# 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
-scope.jsp.core.jspsource.name=JSP Source
-scope.jsp.core.jspsource.description=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
-Tag_New_context_type_Extension_Element.name=New Tag
-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
-_UI_WIZARD_TAG_NAME = Tag
-_UI_WIZARD_TAG_CREATE_NEW_FILE = Create a new Tag file
-##
-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
-##
-preferenceKeywords.files=editor jsp creating saving files suffix specified encoding iana validating validate fragments
-preferenceKeywords.templates=editor jsp templates snippet macros
-preferenceKeywords.styles=editor jsp style customize syntax highlighting type text content foreground background bold color
-preferenceKeywords.fragments=editor jsp fragment language content type validate
-preferenceKeywords.severities=jsp errors warnings ignore options severity severities suppress project specific projectspecific
-
-##
-JSPJava_hyperlink=Java Content In JSP
-Taglib_hyperlink=Taglib Directive
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 6d8ce5095a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ /dev/null
@@ -1,1024 +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, tagx, 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" />
- <documentationTextHover
- class="org.eclipse.jst.jsp.ui.internal.taginfo.JSPTagInfoHoverProcessor"
- target="org.eclipse.jst.jsp.DEFAULT_JSP, org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </documentationTextHover>
- <documentationTextHover
- class="org.eclipse.jst.jsp.ui.internal.taginfo.JSPJavaJavadocHoverProcessor"
- target="org.eclipse.jst.jsp.SCRIPT.JAVA">
- </documentationTextHover>
- <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.jst.jsp.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,,org.eclipse.jst.jsp.ui.preferences.validation"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalDefinition
- type="showintarget"
- value="org.eclipse.jdt.ui.PackageExplorer"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalDefinition
- type="spellingregions"
- value="XML_COMMENT_TEXT, JSP_COMMENT_TEXT, XML_CONTENT, HTML_CONTENT"
- target="org.eclipse.jst.jsp.core.jspsource" />
- <provisionalDefinition
- type="activecontexts"
- value="org.eclipse.jst.jsp.core.jspsource, org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope, org.eclipse.wst.html.core.htmlsource, org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.comments, org.eclipse.wst.xml.selection"
- target="org.eclipse.jst.jsp.core.jspsource" />
- </extension>
-
- <!--======================================================================================-->
- <!-- source validation for JSP -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator"
- id="org.eclipse.jst.jsp.jspsourcevalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
- </partitionType>
- <partitionType id="org.eclipse.jst.jsp.SCRIPT.JAVA">
- </partitionType>
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
- <!--======================================================================================-->
- <!-- source (as you type) validation for JSP EL -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.jst.jsp.core.internal.validation.JSPELValidator"
- id="org.eclipse.jst.jsp.jspelsourcevalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.SCRIPT.JSP_EL"/>
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
- <!--======================================================================================-->
- <!-- source (as you type) validation for JSP directive -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator"
- id="org.eclipse.jst.jsp.tldsourcevalidator">
- <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>
- <!--======================================================================================-->
- <!-- source (as you type) validation for JSP action tags -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="partial"
- 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>
- <!--======================================================================================-->
- <!-- custom XML source (as you type) validation -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.jst.jsp.ui.internal.validation.JSPMarkupValidator"
- id="org.eclipse.jst.jsp.ui.internal.validation.markupvalidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE"/>
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
- <!--======================================================================================-->
- <!-- HTML (as you type) validation -->
- <!--======================================================================================-->
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.jst.jsp.ui.internal.validation.JSPContentSourceValidator"
- 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.jst.jsp.JSP_COMMENT"/>
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.html.HTML_COMMENT"/>
- <partitionType id="org.eclipse.wst.xml.XML_DEFAULT"/>
- <partitionType id="org.eclipse.wst.sse.ST_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <!--======================================================================================-->
- <!-- JSP UI Adapter factories -->
- <!--======================================================================================-->
- <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.html.ui.preferences.web"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPFilesPreferencePage"
- id="org.eclipse.jst.jsp.ui.preferences.jsp">
- <keywordReference id="org.eclipse.jst.jsp.ui.files"/>
- </page>
- <page
- name="%JSP_Source.name"
- category="org.eclipse.jst.jsp.ui.preferences.jsp"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSourcePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.source">
- </page>
- <page
- name="%JSP_Templates.name"
- category="org.eclipse.wst.sse.ui.preferences.jsp.source"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPTemplatePreferencePage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.templates">
- <keywordReference id="org.eclipse.jst.jsp.ui.templates"/>
- </page>
- <page
- name="%JSP_Syntax_Coloring"
- category="org.eclipse.wst.sse.ui.preferences.jsp.source"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPSyntaxColoringPage"
- id="org.eclipse.wst.sse.ui.preferences.jsp.styles">
- <keywordReference id="org.eclipse.jst.jsp.ui.styles"/>
- </page>
- <page
- name="%JSP_Validation"
- category="org.eclipse.jst.jsp.ui.preferences.jsp"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPValidationPreferencePage"
- id="org.eclipse.jst.jsp.ui.preferences.validation">
- <keywordReference id="org.eclipse.jst.jsp.ui.severities"/>
- </page>
- <page
- name="%JSP_Typing"
- category="org.eclipse.wst.sse.ui.preferences.jsp.source"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPTypingPreferencePage"
- id="org.eclipse.jst.jsp.ui.preferences.typing">
- </page>
- </extension>
-
- <!-- Keywords for preference and properties pages -->
- <extension point="org.eclipse.ui.keywords">
- <keyword
- label="%preferenceKeywords.files"
- id="org.eclipse.jst.jsp.ui.files"/>
- <keyword
- label="%preferenceKeywords.templates"
- id="org.eclipse.jst.jsp.ui.templates"/>
- <keyword
- label="%preferenceKeywords.styles"
- id="org.eclipse.jst.jsp.ui.styles"/>
- <keyword
- label="%preferenceKeywords.fragments"
- id="org.eclipse.jst.jsp.ui.fragments"/>
- <keyword
- label="%preferenceKeywords.severities"
- id="org.eclipse.jst.jsp.ui.severities"/>
- </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
- 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>
- <actionSetPartAssociation
- targetID="org.eclipse.debug.ui.launchActionSet">
- <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.wst.sse.ui.structuredTextEditorScope"
- description="%scope.structured.text.editor.jsp.description"
- id="org.eclipse.jst.jsp.ui.structured.text.editor.jsp.scope">
- </context>
- <context
- name="%scope.jsp.core.jspsource.name"
- parentId="org.eclipse.wst.sse.ui.structuredTextEditorScope"
- description="%scope.jsp.core.jspsource.description"
- id="org.eclipse.jst.jsp.core.jspsource">
- </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="%Tag_New_context_type_Extension_Element.name"
- class="org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeJSP"
- id="tag_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>
-
- <wizard
- id="org.eclipse.jst.jsp.ui.internal.wizard.NewTagWizard"
- name="%_UI_WIZARD_TAG_NAME"
- class="org.eclipse.jst.jsp.ui.internal.wizard.NewTagWizard"
- category="org.eclipse.wst.web.ui"
- icon="$nl$/icons/full/etool16/newjsp_wiz.gif">
- <description>%_UI_WIZARD_TAG_CREATE_NEW_FILE</description>
- <selection class="org.eclipse.core.resources.IResource" />
- </wizard>
- </extension>
-
- <!-- Add new JSP wizard to Project Explorer -->
- <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>
- <viewerContribution
- targetID="org.eclipse.jst.jsp.core.jspfragmentsource.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>
- <viewerContribution
- targetID="org.eclipse.jst.jsp.core.tagsource.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>
- <viewerContribution
- targetID="org.eclipse.jst.jsp.core.tldsource.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>
-
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.RenameElementHandler"
- commandId="org.eclipse.jst.jsp.ui.refactor.rename">
- <activeWhen>
- <reference
- definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- </reference>
- </activeWhen>
- <enabledWhen>
- <reference
- definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- </reference>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.jst.jsp.ui.internal.java.refactoring.MoveElementHandler"
- commandId="org.eclipse.jst.jsp.ui.refactor.move">
- <activeWhen>
- <reference
- definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- </reference>
- </activeWhen>
- <enabledWhen>
- <reference
- definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- </reference>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.jst.jsp.ui.internal.handlers.JSPFindOccurrencesHandler"
- commandId="org.eclipse.wst.sse.ui.search.find.occurrences">
- <activeWhen>
- <reference
- definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- </reference>
- </activeWhen>
- <enabledWhen>
- <reference
- definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- </reference>
- </enabledWhen>
- </handler>
- </extension>
-
-
- <!-- JSP Fragment Property Page -->
- <extension point="org.eclipse.ui.propertyPages">
- <!-- for j2ee web project -->
- <page
- 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>
- <keywordReference id="org.eclipse.jst.jsp.ui.fragments"/>
- </page>
- <page
- 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>
- <keywordReference id="org.eclipse.jst.jsp.ui.fragments"/>
- </page>
- <page
- name="%JSP_Property_validation"
- class="org.eclipse.jst.jsp.ui.internal.preferences.ui.JSPValidationPreferencePage"
- id="org.eclipse.jst.jsp.ui.propertyPage.project.validation"
- category="ValidationPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature"/>
- </adapt>
- </enabledWhen>
- <keywordReference id="org.eclipse.jst.jsp.ui.severities"/>
- </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>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
- <target
- id="org.eclipse.jst.jsp.core.jspsource"
- name="%JSP_Source_target_name">
- </target>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
- id="org.eclipse.jst.jsp.ui.internal.hyperlink.JSPJavaHyperlinkDetector"
- name="%JSPJava_hyperlink"
- targetId="org.eclipse.jst.jsp.core.jspsource">
- </hyperlinkDetector>
- <hyperlinkDetector
- class="org.eclipse.jst.jsp.ui.internal.hyperlink.TaglibHyperlinkDetector"
- id="org.eclipse.jst.jsp.ui.internal.hyperlink.TaglibHyperlinkDetector"
- name="%Taglib_hyperlink"
- targetId="org.eclipse.jst.jsp.core.jspsource">
- </hyperlinkDetector>
- </extension>
-
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.jsp.ui.jspSourceContributions.definition">
- <with variable="activeContexts">
- <iterate operator="or">
- <equals value="org.eclipse.jst.jsp.core.jspsource"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.ui.menus">
- <menuContribution locationURI="menu:refactorMenuId">
- <separator name="jspRefactorBegin" visible="false"></separator>
- <command commandId="org.eclipse.jst.jsp.ui.refactor.rename" id="RenameElement" label="%command.jsp.refactor.rename.name" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition"></reference>
- </visibleWhen>
- </command>
- <command commandId="org.eclipse.jst.jsp.ui.refactor.move" id="MoveElement" label="%command.jsp.refactor.move.name" style="push">
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.eclipse.wst.jsp.ui.jspSourceContributions.definition"></reference>
- </visibleWhen>
- </command>
- <separator name="jspRefactorBegin" visible="false"></separator>
- </menuContribution>
- </extension>
-
- <!-- Enable the FormatHandler for JSP Content Type -->
- <extension point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.wst.sse.ui.internal.handlers.FormatHandler"
- commandId="org.eclipse.wst.sse.ui.format">
- <activeWhen>
- <reference definitionId="org.eclipse.wst.jsp.ui.jspContentType.definition"></reference>
- </activeWhen>
- <enabledWhen>
- <reference definitionId="org.eclipse.wst.jsp.ui.jspContentType.definition"></reference>
- </enabledWhen>
- </handler>
- </extension>
-
- <!-- Set up a definition for JSP Content Types -->
- <extension point="org.eclipse.core.expressions.definitions">
- <definition id="org.eclipse.wst.jsp.ui.jspContentType.definition">
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.core.resources.IFile">
- <!-- Force property tester to load, should not cause entire plug-in to start -->
- <test property="org.eclipse.wst.sse.core.resources.contentTypeId"
- value="org.eclipse.jst.jsp.core.jspsource" forcePluginActivation="true"/>
- </adapt>
- </iterate>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.runtime.adapters">
- <factory
- adaptableType="org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel"
- class="org.eclipse.jst.jsp.ui.internal.validation.MarkupValidatorAdapterFactory">
- <adapter
- type="org.eclipse.jst.jsp.core.internal.validation.MarkupValidatorDelegate"/>
- </factory>
- </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 ecbae03f76..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
+++ /dev/null
@@ -1,385 +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
- * Matthias Fuessel, mat.fuessel@gmx.net - [177387] use base hyperlinking extension points
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-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.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-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.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.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-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.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
-import org.w3c.dom.Node;
-
-/**
- * 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;
- private ILabelProvider fStatusLineLabelProvider;
-
- /**
- * 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 || contentType == IJSPPartitions.JSP_DIRECTIVE) {
- // 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) {
- IContentFormatter formatter = super.getContentFormatter(sourceViewer);
- // super was unable to create a formatter, probably because
- // sourceViewer does not have document set yet, so just create a
- // generic one
- if (!(formatter instanceof MultiPassContentFormatter))
- formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT);
-
- MultiPassContentFormatter multiFormatter = (MultiPassContentFormatter) formatter;
- multiFormatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
- multiFormatter.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 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;
- }
-
- 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 ILabelProvider getStatusLineLabelProvider(ISourceViewer sourceViewer) {
- if (fStatusLineLabelProvider == null) {
- fStatusLineLabelProvider = new JFaceNodeLabelProvider() {
- public String getText(Object element) {
- if (element == null)
- return null;
-
- if (!(element instanceof Node)) {
- return super.getText(element);
- }
-
- StringBuffer s = new StringBuffer();
- Node node = (Node) element;
- while (node != null) {
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, super.getText(node));
- }
- node = node.getParentNode();
- if (node != null && node.getNodeType() != Node.DOCUMENT_NODE) {
- s.insert(0, IPath.SEPARATOR);
- }
- }
- return s.toString();
- }
-
- };
- }
- return fStatusLineLabelProvider;
- }
-
- private StructuredTextViewerConfiguration getXMLSourceViewerConfiguration() {
- if (fXMLSourceViewerConfiguration == null) {
- fXMLSourceViewerConfiguration = new StructuredTextViewerConfigurationXML();
- }
- return fXMLSourceViewerConfiguration;
- }
-
- protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
- Map targets = super.getHyperlinkDetectorTargets(sourceViewer);
- targets.put(ContentTypeIdForJSP.ContentTypeID_JSP, null);
-
- // also add html & xml since there could be html/xml content in jsp
- // (just hope the hyperlink detectors will do additional checking)
- targets.put(ContentTypeIdForHTML.ContentTypeID_HTML, null);
- targets.put(ContentTypeIdForXML.ContentTypeID_XML, null);
- return targets;
- }
-}
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 0c8ba64a05..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIMessages.java
+++ /dev/null
@@ -1,174 +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.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 BreakpointNotAllowed;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _UI_WIZARD_TAG_NEW_TITLE;
- public static String _UI_WIZARD_TAG_NEW_HEADING;
- public static String _UI_WIZARD_TAG_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 NewTagTemplatesWizardPage_0;
- public static String NewTagTemplatesWizardPage_1;
- public static String NewTagTemplatesWizardPage_2;
- public static String NewTagTemplatesWizardPage_3;
- public static String NewTagTemplatesWizardPage_4;
- public static String NewTagTemplatesWizardPage_5;
- public static String NewTagTemplatesWizardPage_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;
- public static String SyntaxColoringPage_0;
- public static String SyntaxColoringPage_2;
- public static String SyntaxColoringPage_3;
- public static String SyntaxColoringPage_4;
- public static String SyntaxColoringPage_5;
- public static String SyntaxColoringPage_6;
- public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
-
- public static String JSPTyping_Auto_Complete;
- public static String JSPTyping_Complete_Scriptlets;
- public static String JSPTyping_Complete_Braces;
- public static String JSPValidationPreferencePage_0;
-
- // below are the strings for the validation page
- public static String Validation_description;
- public static String Validation_Warning;
- public static String Validation_Error;
- public static String Validation_Ignore;
-
- public static String VALIDATION_HEADER_DIRECTIVE;
- public static String VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS;
- public static String VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS;
- public static String VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX;
- public static String VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR;
- public static String VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR;
- public static String VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND;
- public static String VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED;
- public static String VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND;
-
- public static String VALIDATION_HEADER_JAVA;
- public static String VALIDATION_JAVA_NOTICE;
- public static String VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED;
- public static String VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED;
- public static String VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE;
- public static String VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE;
- public static String VALIDATION_JAVA_UNUSED_IMPORT;
-
- public static String VALIDATION_HEADER_EL;
- public static String VALIDATION_EL_SYNTAX;
- public static String VALIDATION_EL_LEXER;
-
- public static String VALIDATION_HEADER_CUSTOM_ACTIONS;
- public static String VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE;
- public static String VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE;
- public static String VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG;
- public static String VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE;
- public static String VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND;
- public static String VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED;
- public static String VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION;
- public static String VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND;
-
- public static String VALIDATION_HEADER_STANDARD_ACTIONS;
- public static String VALIDATION_TRANSLATION_USEBEAN_INVALID_ID;
- public static String VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO;
- public static String VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO;
-}
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 43ccb8038f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPlugin.java
+++ /dev/null
@@ -1,99 +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.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);
- registry.addContextType(TemplateContextTypeIdsJSP.NEW_TAG);
-
- 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 d8ca7a2a52..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ /dev/null
@@ -1,154 +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
-###############################################################################
-## 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_=Scripting Element Delimiters
-Refactor_label=Refactor
-RenameElement_label=Rename
-MoveElement_label=Move
-MoveElementWizard=Move the selected elements
-#
-OK=OK
-BreakpointNotAllowed=A breakpoint is not allowed on this line
-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.
-_UI_WIZARD_TAG_NEW_TITLE = New Tag File
-_UI_WIZARD_TAG_NEW_HEADING = Tag File
-_UI_WIZARD_TAG_NEW_DESCRIPTION = Create a new Tag.
-_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.
-NewTagTemplatesWizardPage_0=Select Tag file Template
-NewTagTemplatesWizardPage_1=Select a template as initial content in the Tag file.
-NewTagTemplatesWizardPage_2=Name
-NewTagTemplatesWizardPage_3=Description
-NewTagTemplatesWizardPage_4=Use Tag file Template
-NewTagTemplatesWizardPage_5=Preview
-NewTagTemplatesWizardPage_6=Templates are 'New Tag' 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=Scripting Elements
-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.
-
-SyntaxColoringPage_0=Syntax Element:
-SyntaxColoringPage_2=Enable
-SyntaxColoringPage_3=&Bold
-SyntaxColoringPage_4=&Italic
-SyntaxColoringPage_5=&Strikethrough
-SyntaxColoringPage_6=&Underline
-_UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK=JSP editing preferences. Note that some preferences may be set on the <a>{0}</a> preference page.
-
-# JSP Typing Preference Page
-JSPTyping_Auto_Complete=Automatically close
-JSPTyping_Complete_Scriptlets=&Scriptlet regions
-JSPTyping_Complete_Braces=&Braces in EL expressions
-# Validation page strings
-Validation_description=Select the severity level for the following validation problems:
-Validation_Warning=Warning
-Validation_Error=Error
-Validation_Ignore=Ignore
-JSPValidationPreferencePage_0=Errors/Warnings
-
-VALIDATION_HEADER_DIRECTIVE=Directives
-VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS=Same prefix used for different URIs or tagdir:
-VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS=Redundant tag library directive:
-VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX=No prefix specified:
-VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR=No URI or tagdir specified:
-VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR=Unresolvable URI or tagdir:
-VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND=Superclass not found:
-VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED=Included fragment file not specified:
-VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND=Included fragment file not found:
-
-VALIDATION_HEADER_JAVA=Java
-VALIDATION_JAVA_NOTICE=These values override those on the <a>''{0}''</a> page:
-VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED=Local variable never used:
-VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED=Parameter is never read:
-VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE=Null pointer access:
-VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE=Potential null pointer access:
-VALIDATION_JAVA_UNUSED_IMPORT=Unused import:
-
-VALIDATION_HEADER_EL=Expression Language
-VALIDATION_EL_SYNTAX=EL Syntax problem:
-VALIDATION_EL_LEXER=Unable to analyze EL expression due to lexical analysis error:
-
-VALIDATION_HEADER_CUSTOM_ACTIONS=Custom actions
-VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE=Missing required attribute:
-VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE=Unknown attribute:
-VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG=Tag declared with empty content has content:
-VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE=TagExtraInfo validation message:
-VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND=TagExtraInfo class not on Java Build Path:
-VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED=Failure instantiating TagExtraInfo class:
-VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION=Other problems with TagExtraInfo class:
-VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND=Classic tag handler class not on Java Build Path:
-
-VALIDATION_HEADER_STANDARD_ACTIONS=Standard actions
-VALIDATION_TRANSLATION_USEBEAN_INVALID_ID=Invalid 'id' specified for jsp:useBean:
-VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO=Missing type information for jsp:useBean:
-VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO=Ambiguous type information for jsp:useBean:
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 5df00f69d3..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, 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;
-
-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);
- }
-}
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 1ecbc02129..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, 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
- * 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 06a13fcb12..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/autoedit/StructuredAutoEditStrategyJSP.java
+++ /dev/null
@@ -1,130 +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
- *******************************************************************************/
-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.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-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.IStructuredDocument;
-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;
-
-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("%") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS)) { //$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("{") && isPreferenceEnabled(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES)) { //$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;
- }
- }
- String text = command.text;
- if (text.length() == 1) {
- char c = text.charAt(0);
- if (c == '\'' || c == '\"') {
- IStructuredDocument doc = (IStructuredDocument) document;
- IStructuredDocumentRegion[] regions = doc.getStructuredDocumentRegions(command.offset - 1, 1);
- if (regions.length > 0) {
- IStructuredDocumentRegion region = regions[regions.length - 1];
- if (region.getRegionAtCharacterOffset(command.offset - 1).getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- command.text += c;
- command.caretOffset = command.offset + 1;
- command.shiftsCaret = false;
- command.doit = false;
- }
- }
- }
- }
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
-
- private boolean isPreferenceEnabled(String key) {
- return (key != null && JSPUIPlugin.getDefault().getPreferenceStore().getBoolean(key));
- }
-
- /**
- * 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;
- }
- }
-}
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 f7e3772430..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, 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.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 bc0725b262..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, 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.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 2c7c51d2c0..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, 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.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 f897fe2603..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, JSPUIMessages.BreakpointNotAllowed, null);
- }
- 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 1fad5968e6..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, 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
- *******************************************************************************/
-/*
- * 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 a3e5a62b34..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/AutoImportProposal.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- * Genuitec, LLC - Fix for bug 203303
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-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.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-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;
- }
-
- // Genuitec bug #6227,
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=203303
- private boolean isCustomTagDocument(IDocument doc) {
- boolean isTag = false;
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
- try {
- if (sModel instanceof IDOMModel) {
- String contentType = ((IDOMModel) sModel).getContentTypeIdentifier();
- if (contentType != null) {
- IContentType modelCT = Platform.getContentTypeManager().getContentType(contentType);
- IContentType tagCT = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
- if (modelCT != null && tagCT != null) {
- isTag = modelCT.isKindOf(tagCT);
- }
- }
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- return isTag;
- }
-
- /**
- *
- * @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")) || docElement.getAttributeNode("xmlns:jsp") != null || ((((IDOMNode) docElement).getStartStructuredDocumentRegion() == null && ((IDOMNode) docElement).getEndStructuredDocumentRegion() == null))); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
- 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);
- boolean isCustomTag = isCustomTagDocument(doc);
- final String opening;
- final String closing;
- if (isCustomTag) {
- if (isXml) {
- opening = "<jsp:directive.tag import=\""; //$NON-NLS-1$
- closing = "\"/>"; //$NON-NLS-1$
- }
- else {
- opening = "<%@tag import=\""; //$NON-NLS-1$
- closing = "\"%>"; //$NON-NLS-1$
- }
- }
- else {
- if (isXml) {
- opening = "<jsp:directive.page import=\""; //$NON-NLS-1$
- closing = "\"/>"; //$NON-NLS-1$
- }
- else {
- opening = "<%@page import=\""; //$NON-NLS-1$
- closing = "\"%>"; //$NON-NLS-1$
- }
- }
- return delim + opening + getImportDeclaration() + closing;
- }
-
- 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 918bd2389d..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, 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.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 912121ebf1..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, 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.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 eed9ef7d95..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, 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.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 423e3f60c4..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, 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;
-
-/**
- * @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 d23d28e620..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, 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.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;
- }
-}
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 e66fb7ae62..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProposal.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ICompletionProposalExtension5;
-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, ICompletionProposalExtension5 {
-
- /*
- * 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;
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension5#getAdditionalProposalInfo(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
- Object additionalInfo = super.getAdditionalProposalInfo();
- ICompletionProposal javaProposal = getJavaCompletionProposal();
- if (javaProposal != null) {
- if (javaProposal instanceof ICompletionProposalExtension5)
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=260951
- additionalInfo = ((ICompletionProposalExtension5) javaProposal).getAdditionalProposalInfo(monitor);
- else
- 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 5f7c5090e0..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
+++ /dev/null
@@ -1,1330 +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.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.core.runtime.Path;
-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.JSPCMDocumentFactory;
-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.contenttype.DeploymentDescriptorPropertyCache;
-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.JSP20Namespace;
-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.templates.TemplateContextTypeIdsJSP;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-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.StructuredTextViewerConfigurationHTML;
-import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
-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();
- private IContentAssistProcessor fJSContentAssistProcessor;
-
- 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());
- fNameToProcessorMap.put(JSP11Namespace.ElementName.DIRECTIVE_TAGLIB, new JSPTaglibDirectiveContentAssistProcessor());
- }
-
- /**
- * 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();
- IContentAssistProcessor javascriptProcessor = getJSContentAssistProcessor();
-
- 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_DEFAULT_EL, jspJavaProcessor);
- if (javascriptProcessor != null) {
- fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, javascriptProcessor);
- 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) {
- if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(((IDOMNode) contentAssistRequest.getNode()).getModel().getContentTypeIdentifier())) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsJSP.NEW_TAG);
- }
- else {
- 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 = getDefaultJSPCMDocument((IDOMNode) node);
- CMNamedNodeMap jspelements = jcmdoc.getElements();
-
- /*
- * For a built-in JSP action the content model is properly
- * set up, so don't just blindly add the rest--unless this
- * will be a direct child of the document
- */
- if (jspelements != null && (!(doc instanceof JSPCMDocument) || node.getNodeType() == Node.DOCUMENT_NODE)) {
- 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);
- rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_TAG);
- rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_ATTRIBUTE);
- rejectElements.add(JSP20Namespace.ElementName.DIRECTIVE_VARIABLE);
- 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);
- }
-
- }
- }
- // No cm document (such as for the Document (a non-Element) node itself)
- else {
- CMNamedNodeMap jspElements = getDefaultJSPCMDocument((IDOMNode) node).getElements();
- int length = jspElements.getLength();
- for (int i = 0; i < length; i++) {
- elementDecls.add(jspElements.item(i));
- }
- }
- }
- }
- return elementDecls;
- }
-
- /**
- * For JSP files and segments, this is just the JSP
- * document, but when editing tag files and their fragments, it
- * should be the tag document.
- *
- * It may also vary based on the model being edited in the future.
- *
- * @return the default non-embedded CMDocument for the document being
- * edited.
- */
- CMDocument getDefaultJSPCMDocument(IDOMNode node) {
- // handle tag files here
- String contentType = node.getModel().getContentTypeIdentifier();
- if (ContentTypeIdForJSP.ContentTypeID_JSPTAG.equals(contentType))
- return JSPCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);
-
- CMDocument jcmdoc = null;
- String modelPath = node.getModel().getBaseLocation();
- if (modelPath != null && !IModelManager.UNMANAGED_MODEL.equals(modelPath)) {
- float version = DeploymentDescriptorPropertyCache.getInstance().getJSPVersion(new Path(modelPath));
- jcmdoc = JSPCMDocumentFactory.getCMDocument(version);
- }
- if (jcmdoc == null) {
- jcmdoc = JSPCMDocumentFactory.getCMDocument();
- }
-
- return jcmdoc;
- }
-
- 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(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 (!((getJSContentAssistProcessor() != null && getJSContentAssistProcessor().getClass().isInstance(p)) || 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()]);
- }
-
- private IContentAssistProcessor getJSContentAssistProcessor() {
- if (fJSContentAssistProcessor == null) {
- fJSContentAssistProcessor = new StructuredTextViewerConfigurationHTML().getContentAssistant(null).getContentAssistProcessor(IHTMLPartitions.SCRIPT);
- }
- return fJSContentAssistProcessor;
- }
-
- /*
- * 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() {
- IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT);
- return p.getCompletionProposalAutoActivationCharacters();
- }
-
- /*
- * @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(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;
- }
-}
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 4664973fff..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, 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.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);
- }
-
-}
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 ad5ce00aa9..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELContentAssistProcessor.java
+++ /dev/null
@@ -1,149 +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.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(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 5aa3eb8894..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPELProposalCollector.java
+++ /dev/null
@@ -1,92 +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.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 1e4b3981fe..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
+++ /dev/null
@@ -1,305 +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.contentassist;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-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.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-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.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 {
- /**
- * Preference listener to keep track of changes to content assist
- * preferences
- */
- private class PreferenceListener implements IPropertyChangeListener {
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- IPreferenceStore store = getJavaPreferenceStore();
-
- if (PreferenceConstants.CODEASSIST_AUTOACTIVATION.equals(property)) {
- fAutoActivate = store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
- }
- else if (PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA.equals(property)) {
- String autoCharacters = store.getString(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA);
- completionProposalAutoActivationCharacters = (autoCharacters != null) ? autoCharacters.toCharArray() : new char[0];
- }
- }
- }
-
- private boolean fAutoActivate = true;
- 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;
- private IPropertyChangeListener fJavaPreferenceListener;
-
- 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(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() {
- // if no listener has been created, preferenes have not been
- // initialized
- if (fJavaPreferenceListener == null)
- initializePreferences();
-
- if (fAutoActivate)
- return completionProposalAutoActivationCharacters;
- else
- 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 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() {
- // remove listener on java preferences if we added one
- if (fJavaPreferenceListener != null) {
- getJavaPreferenceStore().removePropertyChangeListener(fJavaPreferenceListener);
- }
-
- 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();
- }
-
- /**
- * Gets the java preference store. If this is the first time getting it,
- * add a preference listener to it.
- *
- * @return IPreferenceStore
- */
- private IPreferenceStore getJavaPreferenceStore() {
- IPreferenceStore store = PreferenceConstants.getPreferenceStore();
- if (fJavaPreferenceListener == null) {
- fJavaPreferenceListener = new PreferenceListener();
- store.addPropertyChangeListener(fJavaPreferenceListener);
- }
- return store;
- }
-
- /**
- * Initialize preference for content assist
- */
- private void initializePreferences() {
- IPreferenceStore store = getJavaPreferenceStore();
-
- fAutoActivate = store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);
- String autoCharacters = store.getString(PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA);
- completionProposalAutoActivationCharacters = (autoCharacters != null) ? autoCharacters.toCharArray() : new char[0];
- }
-}
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 007744d872..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, 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.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;
- }
-}
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 61e9cebd6b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPProposalCollector.java
+++ /dev/null
@@ -1,219 +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.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/JSPTaglibDirectiveContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
deleted file mode 100644
index b2f7d0839c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPTaglibDirectiveContentAssistProcessor.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.contentassist;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Locale;
-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.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
-import org.eclipse.jst.jsp.core.taglib.IJarRecord;
-import org.eclipse.jst.jsp.core.taglib.ITLDRecord;
-import org.eclipse.jst.jsp.core.taglib.ITagDirRecord;
-import org.eclipse.jst.jsp.core.taglib.ITaglibDescriptor;
-import org.eclipse.jst.jsp.core.taglib.ITaglibRecord;
-import org.eclipse.jst.jsp.core.taglib.IURLRecord;
-import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.html.core.internal.contentmodel.JSP20Namespace;
-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.sse.ui.internal.contentassist.IRelevanceConstants;
-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.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.w3c.dom.Node;
-
-/**
- * @plannedfor 1.0
- */
-public class JSPTaglibDirectiveContentAssistProcessor extends JSPDummyContentAssistProcessor {
-
- public JSPTaglibDirectiveContentAssistProcessor() {
- super();
- }
-
- String getSmallImageURL(ITaglibRecord taglibRecord) {
- String url = null;
- switch (taglibRecord.getRecordType()) {
- case (ITaglibRecord.TLD) : {
- ITLDRecord record = (ITLDRecord) taglibRecord;
- IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
- if (file.getLocation() != null && record.getDescriptor().getSmallIcon().length() > 0) {
- url = "file:" + FacetModuleCoreSupport.resolve(file.getFullPath(), record.getDescriptor().getSmallIcon()); //$NON-NLS-1$
- }
- }
- break;
- case (ITaglibRecord.JAR) : {
- IJarRecord record = (IJarRecord) taglibRecord;
- if (record.getDescriptor().getSmallIcon().length() > 0) {
- // url = "file:" +
- // URIHelper.normalize(record.getDescriptor().getSmallIcon(),
- // record.getLocation().toString(), "/"); //$NON-NLS-1$
- }
- }
- break;
- case (ITaglibRecord.TAGDIR) : {
- }
- break;
- case (ITaglibRecord.URL) : {
- IURLRecord record = (IURLRecord) taglibRecord;
- if (record.getDescriptor().getSmallIcon().length() > 0) {
- url = URIHelper.normalize(record.getDescriptor().getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
- }
- }
- break;
- }
- return url;
- }
-
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- IPath basePath = getBasePath(contentAssistRequest);
- if (basePath == null)
- return;
-
- 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());
- }
- 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 {
- String lowerCaseMatch = matchString.toLowerCase(Locale.US);
- if (attributeName.equals(JSP11Namespace.ATTR_NAME_URI)) {
- ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
- /*
- * a simple enough way to remove duplicates (resolution at
- * runtime would be nondeterministic anyway)
- */
- Map uriToRecords = new HashMap();
- for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
- ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
- ITaglibDescriptor descriptor = taglibRecord.getDescriptor();
- String uri = null;
- switch (taglibRecord.getRecordType()) {
- case ITaglibRecord.URL :
- uri = descriptor.getURI();
- uriToRecords.put(uri, taglibRecord);
- break;
- case ITaglibRecord.JAR : {
- IPath location = ((IJarRecord) taglibRecord).getLocation();
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
- IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
- for (int fileNumber = 0; fileNumber < files.length; fileNumber++) {
- if (localContextRoot.isPrefixOf(files[fileNumber].getFullPath())) {
- uri = IPath.SEPARATOR + files[fileNumber].getFullPath().removeFirstSegments(localContextRoot.segmentCount()).toString();
- uriToRecords.put(uri, taglibRecord);
- }
- else {
- uri = FacetModuleCoreSupport.getRuntimePath(files[fileNumber].getFullPath()).toString();
- uriToRecords.put(uri, taglibRecord);
- }
- }
- break;
- }
- case ITaglibRecord.TLD : {
- IPath path = ((ITLDRecord) taglibRecord).getPath();
- IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
- if (localContextRoot.isPrefixOf(path)) {
- uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
- uriToRecords.put(uri, taglibRecord);
- }
- else {
- uri = FacetModuleCoreSupport.getRuntimePath(path).toString();
- uriToRecords.put(uri, taglibRecord);
- }
- break;
- }
- }
- }
- /*
- * use the records and their descriptors to construct
- * proposals
- */
- Object[] uris = uriToRecords.keySet().toArray();
- for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
- String uri = uris[uriNumber].toString();
- ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
- ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
- if (uri != null && uri.length() > 0 && (matchString.length() == 0 || uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
- String url = getSmallImageURL(taglibRecord);
- ImageDescriptor imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
- if (imageDescriptor == null && url != null) {
- URL imageURL;
- try {
- imageURL = new URL(url);
- imageDescriptor = ImageDescriptor.createFromURL(imageURL);
- JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
- }
- catch (MalformedURLException e) {
- Logger.logException(e);
- }
- }
- String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion();
- Image image = null;
- try {
- image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- }
- CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + uri + "\"", start, length, uri.length() + 2, image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else if (attributeName.equals(JSP20Namespace.ATTR_NAME_TAGDIR)) {
- ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
- /*
- * a simple enough way to remove duplicates (resolution at
- * runtime would be nondeterministic anyway)
- */
- Map uriToRecords = new HashMap();
- for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
- ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
- String uri = null;
- if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
- IPath path = ((ITagDirRecord) taglibRecord).getPath();
- IPath localContextRoot = TaglibIndex.getContextRoot(basePath);
- if (localContextRoot.isPrefixOf(path)) {
- uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
- uriToRecords.put(uri, taglibRecord);
- }
- }
- }
- /*
- * use the records and their descriptors to construct
- * proposals
- */
- Object[] uris = uriToRecords.keySet().toArray();
- for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
- String uri = uris[uriNumber].toString();
- ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
- ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
- if (uri != null && uri.length() > 0 && (matchString.length() == 0 || uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
- String url = getSmallImageURL(taglibRecord);
- ImageDescriptor imageDescriptor = null;
- if (url != null) {
- imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
- }
- if (imageDescriptor == null && url != null) {
- URL imageURL;
- try {
- imageURL = new URL(url);
- imageDescriptor = ImageDescriptor.createFromURL(imageURL);
- JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
- }
- catch (MalformedURLException e) {
- Logger.logException(e);
- }
- }
- String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion();
- Image image = null;
- try {
- image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- if (image == null) {
- image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- }
- CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + uri + "\"", start, length, uri.length() + 2, image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
- Node uriAttr = node.getAttributes().getNamedItem(JSP11Namespace.ATTR_NAME_URI);
- String uri = null;
- if (uriAttr != null) {
- uri = uriAttr.getNodeValue();
- ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
- Map prefixMap = new HashMap();
- for (int taglibrecordNumber = 0; taglibrecordNumber < availableTaglibRecords.length; taglibrecordNumber++) {
- ITaglibDescriptor descriptor = availableTaglibRecords[taglibrecordNumber].getDescriptor();
- if (descriptor != null && descriptor.getURI() != null && descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US))) {
- String shortName = descriptor.getShortName().trim();
- if (shortName.length() > 0) {
- boolean valid = true;
- for (int character = 0; character < shortName.length(); character++) {
- valid = valid && !Character.isWhitespace(shortName.charAt(character));
- }
- if (valid) {
- prefixMap.put(shortName, descriptor);
- }
- }
- }
- }
- Object prefixes[] = prefixMap.keySet().toArray();
- for (int j = 0; j < prefixes.length; j++) {
- String prefix = (String) prefixes[j];
- ITaglibDescriptor descriptor = (ITaglibDescriptor) prefixMap.get(prefix);
- Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + prefix + "\"", start, length, prefix.length() + 2, image, prefix, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- else {
- Node dirAttr = node.getAttributes().getNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR);
- if (dirAttr != null) {
- String dir = dirAttr.getNodeValue();
- if (dir != null) {
- ITaglibRecord record = TaglibIndex.resolve(basePath.toString(), dir, false);
- if (record != null) {
- ITaglibDescriptor descriptor = record.getDescriptor();
- if (descriptor != null) {
- String shortName = descriptor.getShortName();
-
- Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + shortName + "\"", start, length, shortName.length() + 2, image, shortName, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- else {
- if (dir.startsWith("/WEB-INF/")) {
- dir = dir.substring(9);
- }
- String prefix = StringUtils.replace(dir, "/", "-");
-
- Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- CustomCompletionProposal proposal = new CustomCompletionProposal("\"" + prefix + "\"", start, length, prefix.length() + 2, image, prefix, null, null, IRelevanceConstants.R_NONE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * Returns project request is in
- *
- * @param request
- * @return
- */
- private IPath getBasePath(ContentAssistRequest request) {
- IPath 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) {
- String location = model.getBaseLocation();
- if (location != null) {
- baselocation = new Path(location);
- }
- }
- }
- finally {
- if (model != null)
- model.releaseFromRead();
- }
- }
- }
- return baselocation;
- }
-
-}
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 120986d363..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, 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.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;
- }
-
-}
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 633a4c24bd..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaParameterListValidator.java
+++ /dev/null
@@ -1,228 +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.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;
- }
-
- if (fInformation == null)
- 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 1ba8e64b0f..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, 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.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);
- }
-
-}
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 f11c3b1c10..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, 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 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;
- }
-}
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 61a2dd8157..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.sse.ui.internal.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 a53c8e0653..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, 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.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;
- }
-}
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 c8e77df740..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentproperties/ui/JSPFContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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
- * David Schneider, david.schneider@unisys.com - [142500] WTP properties pages fonts don't follow Eclipse preferences
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.contentproperties.ui;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.Dialog;
-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);
-
- /*
- * The following controls are duplicated on JSP Validation
- * preference page; disable permanently.
- */
- // 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);
-
- fSpecificSetting.setEnabled(false);
- fValidateFragments.setEnabled(false);
-
- initializeValues();
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(propertyPage, IHelpContextIds.JSP_FRAGMENT_HELPID);
- Dialog.applyDialogFont(parent);
- 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;
- IAdaptable adaptable = getElement();
- if (adaptable instanceof IResource) {
- resource = (IResource) adaptable;
- } else if (adaptable != null) {
- Object o = adaptable.getAdapter(IResource.class);
- if (o instanceof IResource) {
- resource = (IResource)o;
- }
- }
- 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);
- fSpecificSetting.setGrayed(true);
- fValidateFragments.setGrayed(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 = 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 e198a2766a..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, 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
- * 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 4a9715e4a0..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, 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.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.UNDERSCORE);
- 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.UNDERSCORE);
- 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 70193600cd..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, 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.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$
-}
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 d4ca9f36f4..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, 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.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;
- }
-}
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 bd38f2a288..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/JSPEditorPluginImages.java
+++ /dev/null
@@ -1,49 +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.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.png"; //$NON-NLS-1$
- public static final String IMG_OBJ_WIZBAN_NEWTAGFILE = "icons/full/wizban/newjspfile_wiz.png"; //$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 ec15d5c1e3..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, 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.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 d420dfcfe2..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/format/FormattingStrategyJSPJava.java
+++ /dev/null
@@ -1,116 +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.jst.jsp.ui.internal.format;
-
-import java.util.LinkedList;
-import java.util.Map;
-
-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.IDocumentExtension4;
-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;
- /* Keep track of last JSP document modification to reduce formatting calls */
- private long fLastModified = -1;
- /**
- * 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 instanceof IDocumentExtension4 && ((IDocumentExtension4) document).getModificationStamp() == fLastModified)
- return;
-
- if (document != null && partition != null) {
- try {
- JSPTranslationUtil translationUtil = new JSPTranslationUtil(document);
- IDocument javaDoc = translationUtil.getTranslation().getJavaDocument();
-
- if (javaDoc != null) {
- String javaSource = javaDoc.get();
- TextEdit textEdit = formatString(CodeFormatter.K_COMPILATION_UNIT, javaSource, 0, TextUtilities.getDefaultLineDelimiter(document), getPreferences());
-
- TextEdit jspEdit = translationUtil.getTranslation().getJspEdit(textEdit);
- if (jspEdit != null && jspEdit.hasChildren()) {
- jspEdit.apply(document);
-
- if (document instanceof IDocumentExtension4) {
- fLastModified = ((IDocumentExtension4) document).getModificationStamp();
- }
- }
-
- }
-
- }
- catch (MalformedTreeException exception) {
- Logger.logException(exception);
- }
- catch (BadLocationException exception) {
- // Can only happen on concurrent document modification - log
- // and bail out
- 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/handlers/JSPFindOccurrencesHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
deleted file mode 100644
index c3467da564..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/handlers/JSPFindOccurrencesHandler.java
+++ /dev/null
@@ -1,38 +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.jst.jsp.ui.internal.handlers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesProcessor;
-import org.eclipse.wst.sse.ui.internal.handlers.FindOccurrencesHandler;
-
-public class JSPFindOccurrencesHandler extends FindOccurrencesHandler {
- 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/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 a85757e5a3..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 fHyperlinkFile.getAbsolutePath();
- }
-
- public String getHyperlinkText() {
- return fHyperlinkFile.getName();
- }
-
- 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 38d81b0b2e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlink.java
+++ /dev/null
@@ -1,65 +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() {
- return fElement.getPath().toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return fElement.getElementName();
- }
-
- /*
- * (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 846dee2b30..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/JSPJavaHyperlinkDetector.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.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.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-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.sse.core.internal.util.URIResolver;
-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 extends AbstractHyperlinkDetector {
-
- 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) {
- URIResolver resolver = sModel.getResolver();
- if (resolver != null) {
- String uriString = resolver.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) {
- Path filePath = new Path(fileString);
- if (filePath.segmentCount() > 1 && ResourcesPlugin.getWorkspace().getRoot().getFile(filePath).exists()) {
- return ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
- }
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(filePath);
- 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/TLDFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
deleted file mode 100644
index 9b059c4627..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TLDFileHyperlink.java
+++ /dev/null
@@ -1,124 +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.jst.jsp.ui.internal.hyperlink;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-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.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.ide.IDE;
-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.IDOMModel;
-
-class TLDFileHyperlink implements IHyperlink {
-
- private IResource fResource;
- private IRegion fHyperlinkRegion;
- private String fSearchName;
- private int fSearchType;
-
- public TLDFileHyperlink(IResource resource, int searchType, String searchName, IRegion hyperlinkRegion) {
- super();
- fResource = resource;
- fSearchName = searchName;
- fSearchType = searchType;
- fHyperlinkRegion = hyperlinkRegion;
- }
-
- private IMarker createMarker(IFile file, IRegion region) throws CoreException {
- // org.eclipse.ui.texteditor.MarkerUtilities.setCharStart(IMarker, int)
- IMarker marker = file.createMarker(JSPUIPlugin.ID + "hyperlink"); //$NON-NLS-1$
- marker.setAttribute(IMarker.TRANSIENT, Boolean.TRUE);
- marker.setAttribute(IMarker.SOURCE_ID, getClass().getName());
- marker.setAttribute(IMarker.CHAR_START, region.getOffset());
- marker.setAttribute(IMarker.CHAR_END, region.getOffset() + region.getLength());
- return marker;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- public String getHyperlinkText() {
- return fResource.getFullPath().toString();
- }
-
- public String getTypeLabel() {
- return null;
- }
-
- public void open() {
- IWorkbenchWindow window = JSPUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (fResource.getType() == IResource.FILE) {
- IFile file = (IFile) fResource;
- IMarker marker = null;
- IDOMModel domModel = null;
- try {
- IStructuredModel model = StructuredModelManager.getModelManager().getModelForRead(file);
- if (model instanceof IDOMModel) {
- domModel = (IDOMModel) model;
- if (domModel != null) {
- IRegion targetRegion = TaglibHyperlinkDetector.findDefinition(domModel, fSearchName, fSearchType);
- if (targetRegion != null) {
- try {
- marker = createMarker(file, targetRegion);
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- if (marker != null) {
- try {
- IDE.openEditor(page, marker);
- }
- catch (PartInitException e1) {
- Logger.logException(e1);
- }
- finally {
- try {
- marker.delete();
- }
- catch (CoreException e) {
- Logger.logException(e);
- }
- }
- }
- else {
- IDE.openEditor(page, file);
- }
- }
- }
- }
- catch (IOException e2) {
- }
- catch (CoreException e2) {
- }
- finally {
- if (domModel != null) {
- domModel.releaseFromRead();
- }
- }
- }
- }
- }
-}
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 a3aa679a32..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.jst.jsp.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.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.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMElementDeclarationImpl;
-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.JSP11TLDNames;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP11Namespace;
-import org.eclipse.jst.jsp.core.internal.provisional.JSP12Namespace;
-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.internal.provisional.text.ITextRegionCollection;
-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.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.provisional.contentmodel.CMNodeWrapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-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.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Detects hyperlinks for taglibs.
- */
-public class TaglibHyperlinkDetector extends AbstractHyperlinkDetector {
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
- private final String JAR_PROTOCOL = "jar:file:";//$NON-NLS-1$
- // private String URN_TAGDIR = "urn:jsptagdir:";
- private String URN_TLD = "urn:jsptld:";
- private String XMLNS = "xmlns:"; //$NON-NLS-1$
-
- static final int TAG = 1;
- static final int ATTRIBUTE = 2;
-
- static IRegion findDefinition(IDOMModel model, String searchName, int searchType) {
- NodeList declarations = null;
- if (searchType == TAG)
- declarations = model.getDocument().getElementsByTagNameNS("*", JSP11TLDNames.TAG);
- else if (searchType == ATTRIBUTE)
- declarations = model.getDocument().getElementsByTagNameNS("*", JSP11TLDNames.ATTRIBUTE);
- if (declarations == null || declarations.getLength() == 0) {
- if (searchType == TAG)
- declarations = model.getDocument().getElementsByTagName(JSP11TLDNames.TAG);
- else if (searchType == ATTRIBUTE)
- declarations = model.getDocument().getElementsByTagName(JSP11TLDNames.ATTRIBUTE);
- }
- for (int i = 0; i < declarations.getLength(); i++) {
- NodeList names = model.getDocument().getElementsByTagName(JSP11TLDNames.NAME);
- for (int j = 0; j < names.getLength(); j++) {
- String name = getContainedText(names.item(j));
- if (searchName.compareTo(name) == 0) {
- int start = -1;
- int end = -1;
- Node caret = names.item(j).getFirstChild();
- if (caret != null) {
- start = ((IDOMNode) caret).getStartOffset();
- }
- while (caret != null) {
- end = ((IDOMNode) caret).getEndOffset();
- caret = caret.getNextSibling();
- }
- if (start > 0) {
- return new Region(start, end - start);
- }
- }
- }
- }
-
- return null;
- }
-
- private static String getContainedText(Node parent) {
- NodeList children = parent.getChildNodes();
- if (children.getLength() == 1) {
- return children.item(0).getNodeValue().trim();
- }
- StringBuffer s = new StringBuffer();
- Node child = parent.getFirstChild();
- while (child != null) {
- if (child.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- String reference = ((EntityReference) child).getNodeValue();
- if (reference == null && child.getNodeName() != null) {
- reference = "&" + child.getNodeName() + ";"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (reference != null) {
- s.append(reference.trim());
- }
- }
- else {
- s.append(child.getNodeValue().trim());
- }
- child = child.getNextSibling();
- }
- return s.toString().trim();
- }
-
- 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) {
- String baseLocationForTaglib = getBaseLocationForTaglib(doc);
- if (baseLocationForTaglib != null && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
- /**
- * The taglib directive itself
- */
- // get the uri attribute
- Attr taglibURINode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
- if (taglibURINode != null) {
- ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, taglibURINode.getValue(), false);
- // when using a tagdir
- // (ITaglibRecord.TAGDIR),
- // there's nothing to link to
- if (reference != null) {
- // handle taglibs
- switch (reference.getRecordType()) {
- case (ITaglibRecord.TLD) : {
- ITLDRecord record = (ITLDRecord) reference;
- String uriString = record.getPath().toString();
- IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
- if (hyperlinkRegion != null) {
- hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
- }
- }
- break;
- case (ITaglibRecord.JAR) :
- case (ITaglibRecord.URL) : {
- IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
- if (hyperlinkRegion != null) {
- hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
- }
- }
- }
- }
- }
- }
- else if (baseLocationForTaglib != null && JSP12Namespace.ElementName.ROOT.equalsIgnoreCase(currentNode.getNodeName())) {
- /**
- * The jsp:root element
- */
- NamedNodeMap attrs = currentNode.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++) {
- Attr attr = (Attr) attrs.item(i);
- if (attr.getNodeName().startsWith(XMLNS)) {
- String uri = StringUtils.strip(attr.getNodeValue());
- if (uri.startsWith(URN_TLD)) {
- uri = uri.substring(URN_TLD.length());
- }
- ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, uri, false);
- // when using a tagdir
- // (ITaglibRecord.TAGDIR),
- // there's nothing to link to
- if (reference != null) {
- // handle taglibs
- switch (reference.getRecordType()) {
- case (ITaglibRecord.TLD) : {
- ITLDRecord record = (ITLDRecord) reference;
- String uriString = record.getPath().toString();
- IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
- if (hyperlinkRegion != null) {
- hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
- }
- }
- break;
- case (ITaglibRecord.JAR) :
- case (ITaglibRecord.URL) : {
- IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
- if (hyperlinkRegion != null) {
- hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
- }
- }
- }
- }
- }
- }
- }
- else {
- /**
- * Hyperlink custom tag to its TLD or tag file
- */
- TLDCMDocumentManager documentManager = TaglibController.getTLDCMDocumentManager(doc);
- if (documentManager != null) {
- List documentTrackers = documentManager.getCMDocumentTrackers(currentNode.getPrefix(), region.getOffset());
- for (int i = 0; i < documentTrackers.size(); i++) {
- TaglibTracker tracker = (TaglibTracker) documentTrackers.get(i);
- CMElementDeclaration decl = (CMElementDeclaration) tracker.getElements().getNamedItem(currentNode.getNodeName());
- if (decl != null) {
- decl = (CMElementDeclaration) ((CMNodeWrapper) decl).getOriginNode();
- if (decl instanceof CMElementDeclarationImpl) {
- String base = ((CMElementDeclarationImpl) decl).getLocationString();
- IRegion hyperlinkRegion = getHyperlinkRegion(currentNode, region);
- if (hyperlinkRegion != null) {
- hyperlink = createHyperlink(base, hyperlinkRegion, doc, currentNode);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- 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 boundingRegion) {
- 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);
- }
- }
- if (nodeType == Node.ELEMENT_NODE) {
- // Handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = getNameRegion(docNode.getFirstStructuredDocumentRegion());
- if (hyperRegion == null) {
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getFirstStructuredDocumentRegion().getTextLength());
- }
- }
- }
- /**
- * Only return a hyperlink region that overlaps the search region.
- * This will help us to not underline areas not under the cursor.
- */
- if (hyperRegion != null && intersects(hyperRegion, boundingRegion))
- return hyperRegion;
- return null;
- }
-
- private boolean intersects(IRegion hyperlinkRegion, IRegion detectionRegion) {
- int hyperLinkStart = hyperlinkRegion.getOffset();
- int hyperLinkEnd = hyperlinkRegion.getOffset() + hyperlinkRegion.getLength();
- int detectionStart = detectionRegion.getOffset();
- int detectionEnd = detectionRegion.getOffset() + detectionRegion.getLength();
- return (hyperLinkStart <= detectionStart && detectionStart < hyperLinkEnd) || (hyperLinkStart <= detectionEnd && detectionEnd < hyperLinkEnd);// ||
- // (startOffset2
- // <=
- // startOffset1
- // &&
- // startOffset1
- // <=
- // endOffset2)
- // ||
- // (startOffset2
- // <=
- // endOffset2
- // &&
- // endOffset2
- // <=
- // endOffset2);
- }
-
- private IRegion getNameRegion(ITextRegionCollection containerRegion) {
- ITextRegionList regions = containerRegion.getRegions();
- ITextRegion nameRegion = null;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion r = regions.get(i);
- if (r.getType() == DOMRegionContext.XML_TAG_NAME) {
- nameRegion = r;
- break;
- }
- }
- if (nameRegion != null)
- return new Region(containerRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
- return null;
- }
-
- /**
- * 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);
- }
- else if (temp.startsWith(JAR_PROTOCOL)) {
- // this is a URLFileHyperlink since this is a local address
- try {
- link = new URLFileRegionHyperlink(hyperlinkRegion, TAG, node.getLocalName(), new URL(uriString));
- }
- catch (MalformedURLException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- else {
- // try to locate the file in the workspace
- IPath path = new Path(uriString);
- if (path.segmentCount() > 1) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file.getType() == IResource.FILE && file.isAccessible()) {
- if (node != null) {
- link = new TLDFileHyperlink(file, TAG, node.getLocalName(), hyperlinkRegion);
- }
- else {
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- }
- }
- }
- }
- if (link == null) {
- // 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);
- if (sModel != null) {
- 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 30394470c8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarHyperlink.java
+++ /dev/null
@@ -1,112 +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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return fZipFilePath.toString();
- }
-
- 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 8333586803..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibJarUriHyperlink.java
+++ /dev/null
@@ -1,85 +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() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- if (fTaglibRecord != null) {
- switch (fTaglibRecord.getRecordType()) {
- case (ITaglibRecord.JAR) : {
- IJarRecord record = (IJarRecord) fTaglibRecord;
- return record.getLocation().toString();
- }
- case (ITaglibRecord.URL) : {
- IURLRecord record = (IURLRecord) fTaglibRecord;
- return record.getBaseLocation();
- }
- }
- }
- 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 fac4bd80dd..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
+++ /dev/null
@@ -1,173 +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 boolean equals(Object obj) {
- if (obj instanceof StorageEditorInput) {
- return fStorage.equals(((StorageEditorInput) obj).fStorage);
- }
- return super.equals(obj);
- }
-
- 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 boolean equals(Object obj) {
- if (obj instanceof URLStorage) {
- return fURL.equals(((URLStorage) obj).fURL);
- }
- return super.equals(obj);
- }
-
- 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() {
- return fURL.toString();
- }
-
- /*
- * (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/URLFileRegionHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
deleted file mode 100644
index 115ebed1a6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileRegionHyperlink.java
+++ /dev/null
@@ -1,217 +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.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.TextSelection;
-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.IEditorPart;
-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;
-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.IDOMModel;
-
-/**
- * Hyperlink for URLs (opens in read-only mode)
- */
-class URLFileRegionHyperlink 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 boolean equals(Object obj) {
- if (obj instanceof StorageEditorInput) {
- return fStorage.equals(((StorageEditorInput) obj).fStorage);
- }
- return super.equals(obj);
- }
-
- 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 boolean equals(Object obj) {
- if (obj instanceof URLStorage) {
- return fURL.equals(((URLStorage) obj).fURL);
- }
- return super.equals(obj);
- }
-
- 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;
- private int fSearchType;
- private String fSearchName;
-
- public URLFileRegionHyperlink(IRegion region, int searchType, String searchName, URL url) {
- fRegion = region;
- fURL = url;
- fSearchName = searchName;
- fSearchType = searchType;
- }
-
- 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() {
- return fURL.toString();
- }
-
- /*
- * (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();
- IEditorPart openedEditor = IDE.openEditor(page, input, descriptor.getId(), true);
- IRegion definitionRegion = findDefinitionRegion(new URLStorage(fURL));
- if (definitionRegion != null) {
- openedEditor.getSite().getSelectionProvider().setSelection(new TextSelection(definitionRegion.getOffset(), definitionRegion.getLength()));
- }
- }
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-
- /**
- * @return
- */
- private IRegion findDefinitionRegion(IStorage storage) {
- IRegion definition = null;
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getModelForRead(storage.getName(), storage.getContents(), null);
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- if (model != null) {
- if (model instanceof IDOMModel) {
- definition = TaglibHyperlinkDetector.findDefinition((IDOMModel) model, fSearchName, fSearchType);
- }
- model.releaseFromRead();
- }
- return definition;
- }
-}
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 6b8ceb8fda..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,78 +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() {
- return fFile.getFullPath().toString();
- }
-
- 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/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 fbeae08f0f..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, 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 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$
- }
-}
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 08b6c96b45..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, 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.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 eea4cac8c3..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, 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.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;
- }
-}
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 0e23beff8f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPMethodRenameParticipant.java
+++ /dev/null
@@ -1,74 +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.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 428fe76e36..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, 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 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 e273dbd50b..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, 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.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 c6b9d03462..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, 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.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;
- }
-}
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 6aed5ecf90..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, 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.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;
- }
-
-
-}
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 da211bbd2c..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, 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.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 0448544eea..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, 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.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;
- }
-}
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 312efe3e68..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, 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.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;
- }
-
-
-}
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 4953031ba3..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, 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 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 e59baf5b49..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, 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.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;
- }
-}
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 2332069899..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, 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.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;
- }
-
-
-}
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 cff180cd57..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, 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 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/refactoring/MoveElementHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/MoveElementHandler.java
deleted file mode 100644
index 21abbf0ed8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/MoveElementHandler.java
+++ /dev/null
@@ -1,76 +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.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-/**
- * A handler 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 MoveElementHandler extends AbstractHandler {
-// private IEditorPart fEditor;
-
- public Object execute(ExecutionEvent arg0) throws ExecutionException {
- // 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$
-// }
- return null;
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
deleted file mode 100644
index 7d054c27df..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameElementHandler.java
+++ /dev/null
@@ -1,78 +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.jst.jsp.ui.internal.java.refactoring;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-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.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.sse.ui.internal.util.PlatformStatusLineUtil;
-
-public class RenameElementHandler extends AbstractHandler {
- private IEditorPart fEditor;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- fEditor = HandlerUtil.getActiveEditor(event);
-
- 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();
- }
-
- return null;
- }
-
- 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/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 1acb7befe0..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, 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.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$
- }
-}
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 1de8c3dd27..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, 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.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 af8ca1127a..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, 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.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 2cb4ae19d2..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, 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.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("offset: " + Integer.toString(jspStart), e); //$NON-NLS-1$
- }
- 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);
- }
- }
-}
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 ce0792bdc2..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, 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.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);
- }
-}
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 c257ee9ceb..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, 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.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 b0e9b10c10..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceInitializer.java
+++ /dev/null
@@ -1,78 +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.resource.ColorRegistry;
-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.ui.PlatformUI;
-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();
- ColorRegistry registry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- // 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 JUSTITALIC = " | null | false | true"; //$NON-NLS-1$
- String styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_NAME, 127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, 42, 0, 255) + JUSTITALIC;
- 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.findRGBString(registry, IStyleConstantsXML.COMMENT_BORDER, 63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.COMMENT_TEXT, 63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_BORDER, 0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsXML.TAG_NAME, 63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-
- styleValue = ColorHelper.findRGBString(registry, IStyleConstantsHTML.SCRIPT_AREA_BORDER, 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);
-
- store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, true);
- store.setDefault(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, true);
- }
-
-}
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 fb67d1a70f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/JSPUIPreferenceNames.java
+++ /dev/null
@@ -1,83 +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.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$
-
- /**
- * The key to store the option for auto-completing EL braces after entering
- * <code>${</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_EL_BRACES = "typingCompleteElBraces"; //$NON-NLS-1$
-
- /**
- * The key to store the option for auto-completing scriptlets after entering
- * <code>&lt;%</code>
- * <p>
- * Value is of type <code>boolean</code>.
- * </p>
- */
- public static final String TYPING_COMPLETE_SCRIPTLETS = "typingCompleteScriptlets"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
deleted file mode 100644
index 25b9311dd3..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractPropertyPreferencePage.java
+++ /dev/null
@@ -1,300 +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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.preferences.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-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;
-
-/**
- * Based loosely on org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage
- */
-abstract class AbstractPropertyPreferencePage 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;
-
- private Control fCommon;
-
- private ControlEnableState fEnablements;
-
- public AbstractPropertyPreferencePage() {
- 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);
- fCommon = createCommonContents(composite);
-
- fCommon.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- if (fEnableProjectSettings != null) {
- SelectionAdapter selectionAdapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- enablePreferenceContent(fEnableProjectSettings.getSelection());
- }
- };
- selectionAdapter.widgetSelected(null);
- fEnableProjectSettings.addSelectionListener(selectionAdapter);
- }
-
- applyDialogFont(composite);
- return composite;
- }
-
- 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) {
- if (getElement() instanceof IProject) {
- return (IProject) getElement();
- }
- Object adapter = getElement().getAdapter(IProject.class);
- if (adapter instanceof IProject) {
- return (IProject) adapter;
- }
- adapter = getElement().getAdapter(IResource.class);
- if (adapter instanceof IProject) {
- return (IProject) adapter;
- }
- }
- 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;
- }
-
- protected void performDefaults() {
- if(getProject() != null && fEnableProjectSettings != null) {
- fEnableProjectSettings.setSelection(false);
- enablePreferenceContent(false);
- }
- super.performDefaults();
- }
-
- private void updateLinkEnablement() {
- if (fData != null && fProjectSettingsLink != null) {
- fProjectSettingsLink.setEnabled(!Boolean.TRUE.equals(fData.get(DISABLE_LINK)));
- }
- }
-
- /**
- * Controls the enablement of the common content region
- * of a property or preference page
- *
- * @param enable the enabled state of the common content
- * area
- */
- protected void enablePreferenceContent(boolean enable) {
- if(enable) {
- if(fEnablements != null) {
- fEnablements.restore();
- fEnablements = null;
- }
- }
- else {
- if(fEnablements == null)
- fEnablements = ControlEnableState.disable(fCommon);
- }
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
deleted file mode 100644
index 616486775c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/AbstractValidationSettingsPage.java
+++ /dev/null
@@ -1,422 +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.jst.jsp.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.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.IDialogSettings;
-import org.eclipse.jface.resource.JFaceResources;
-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.MessageBox;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.forms.events.ExpansionAdapter;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-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.ScrolledPageContent;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * Based on org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock
- */
-abstract class AbstractValidationSettingsPage extends AbstractPropertyPreferencePage {
-
- private List fCombos;
- private List fExpandables;
-
- private SelectionListener fSelectionListener;
-
- private IPreferencesService fPreferencesService = null;
-
- private static final String SETTINGS_EXPANDED = "expanded"; //$NON-NLS-1$
-
- private ValidationFramework fValidation;
-
- 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) {
- setIndex(i);
- return;
- }
- }
-
- setIndex(-1);
- }
-
- public int getSeverity() {
- return (fIndex >= 0 && fSeverities != null && fIndex < fSeverities.length) ? fSeverities[fIndex] : -1;
- }
-
- boolean isChanged() {
- return fSeverities[fIndex] != originalSeverity;
- }
- }
-
- public AbstractValidationSettingsPage() {
- super();
- fCombos = new ArrayList();
- fExpandables = new ArrayList();
- fPreferencesService = Platform.getPreferencesService();
- fValidation = ValidationFramework.getDefault();
- }
-
- /**
- * Creates a Combo widget in the composite <code>parent</code>. The data
- * in the Combo is associated with <code>key</code>. The Combo data is
- * generated based on the integer <code>values</code> where the index
- * of <code>values</code> corresponds to the index of <code>valueLabels</code>
- *
- * @param parent the composite to create the combo box in
- * @param label the label to give the combo box
- * @param key the unique key to identify the combo box
- * @param values the values represented by the combo options
- * @param valueLabels the calues displayed in the combo box
- * @param indent how far to indent the combo box label
- *
- * @return the generated combo box
- */
- 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());
-
- makeScrollableCompositeAware(comboBox);
-
- 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 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) {
-
- }
- }
- }
-
- protected ExpandableComposite getParentExpandableComposite(Control control) {
- Control parent = control.getParent();
- while (!(parent instanceof ExpandableComposite) && parent != null) {
- parent = parent.getParent();
- }
- if (parent instanceof ExpandableComposite) {
- return (ExpandableComposite) parent;
- }
- return null;
- }
-
- protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
- ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
- excomposite.setText(label);
- excomposite.setExpanded(false);
- excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
- excomposite.addExpansionListener(new ExpansionAdapter() {
- public void expansionStateChanged(ExpansionEvent e) {
- expandedStateChanged((ExpandableComposite) e.getSource());
- }
- });
- fExpandables.add(excomposite);
- makeScrollableCompositeAware(excomposite);
- return excomposite;
- }
-
- protected Composite createStyleSectionWithContentComposite(Composite parent, String label, int nColumns) {
- ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
- excomposite.setText(label);
- excomposite.setExpanded(false);
- excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
- excomposite.addExpansionListener(new ExpansionAdapter() {
- public void expansionStateChanged(ExpansionEvent e) {
- expandedStateChanged((ExpandableComposite) e.getSource());
- }
- });
- fExpandables.add(excomposite);
- makeScrollableCompositeAware(excomposite);
-
- Composite inner = new Composite(excomposite, SWT.NONE);
- inner.setFont(excomposite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
- return inner;
- }
-
- protected final void expandedStateChanged(ExpandableComposite expandable) {
- ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(expandable);
- if (parentScrolledComposite != null) {
- parentScrolledComposite.reflow(true);
- }
- }
-
- private void makeScrollableCompositeAware(Control control) {
- ScrolledPageContent parentScrolledComposite = getParentScrolledComposite(control);
- if (parentScrolledComposite != null) {
- parentScrolledComposite.adaptChild(control);
- }
- }
-
- protected ScrolledPageContent getParentScrolledComposite(Control control) {
- Control parent = control.getParent();
- while (!(parent instanceof ScrolledPageContent) && parent != null) {
- parent = parent.getParent();
- }
- if (parent instanceof ScrolledPageContent) {
- return (ScrolledPageContent) parent;
- }
- return null;
- }
-
- protected void storeSectionExpansionStates(IDialogSettings section) {
- for (int i = 0; i < fExpandables.size(); i++) {
- ExpandableComposite comp = (ExpandableComposite) fExpandables.get(i);
- section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
- }
- }
-
- protected void restoreSectionExpansionStates(IDialogSettings settings) {
- for (int i= 0; i < fExpandables.size(); i++) {
- ExpandableComposite excomposite= (ExpandableComposite) fExpandables.get(i);
- if (settings == null) {
- excomposite.setExpanded(i == 0); // only expand the first node by default
- } else {
- excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i)));
- }
- }
- }
-
- 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());
- }
- }
-
- protected boolean shouldRevalidateOnSettingsChange() {
- Iterator it = fCombos.iterator();
-
- while (it.hasNext()) {
- ComboData data = (ComboData) ((Combo) it.next()).getData();
- if (data.isChanged())
- return true;
- }
- return false;
- }
-
- 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 */
- String msg = (getProject() == null) ? HTMLUIMessages.Validation_Workspace : HTMLUIMessages.Validation_Project;
- mb.setMessage(msg);
- switch(mb.open()) {
- case SWT.CANCEL:
- return false;
- case SWT.YES:
- ValidateJob job = new ValidateJob(HTMLUIMessages.Validation_jobName);
- job.schedule();
- case SWT.NO:
- default:
- return true;
- }
- }
- return true;
- }
-
- /**
- * Performs validation after validation preferences have been modified.
- */
- private class ValidateJob extends Job {
-
- public ValidateJob(String name) {
- super(name);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- try {
- IProject[] projects = null;
- /* Changed preferences for a single project, only validate it */
- if (getProject() != null)
- projects = new IProject[]{getProject()};
- /* Workspace-wide preferences changed */
- else {
- /* Get all of the projects in the workspace */
- projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- IEclipsePreferences prefs = null;
- List projectList = new ArrayList();
-
- /* Filter out projects that use project-specific settings or have been closed */
- for (int i = 0; i < projects.length; i++) {
- prefs = new ProjectScope(projects[i]).getNode(getPreferenceNodeQualifier());
- if (projects[i].isAccessible() && !prefs.getBoolean(getProjectSettingsKey(), false))
- projectList.add(projects[i]);
- }
- projects = (IProject[]) projectList.toArray(new IProject[projectList.size()]);
- }
- fValidation.validate(projects, true, false, monitor);
- }
- catch (CoreException ce) {
- status = Status.CANCEL_STATUS;
- }
-
- return status;
- }
-
- }
-
-}
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 2dd5a4c75b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPColorPage.java
+++ /dev/null
@@ -1,170 +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.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;
-
-/**
- * @deprecated
- */
-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 f8abc65e7d..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPFilesPreferencePage.java
+++ /dev/null
@@ -1,80 +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.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.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.html.ui.internal.preferences.ui.HTMLFilesPreferencePage;
-
-public class JSPFilesPreferencePage extends HTMLFilesPreferencePage {
- /*
- * (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
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- JSPCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- protected IContentType getContentType() {
- return Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
- }
-
- protected Preferences getModelPreferences() {
- return JSPCorePlugin.getDefault().getPluginPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#initializeValuesForLoadingGroup()
- */
- protected void initializeValuesForLoadingGroup() {
- // no loading preferences
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.html.ui.preferences.ui.HTMLFilesPreferencePage#performDefaultsForLoadingGroup()
- */
- protected void performDefaultsForLoadingGroup() {
- // no loading preferences
- }
-
- /*
- * (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 6176b4dee5..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSourcePreferencePage.java
+++ /dev/null
@@ -1,80 +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.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.swt.SWT;
-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.Label;
-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 = createComposite(parent, 1);
-
- new PreferenceLinkArea(composite, SWT.WRAP | SWT.MULTI, "org.eclipse.wst.sse.ui.preferences.editor", JSPUIMessages._UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK,//$NON-NLS-1$
- (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().indent(5, 0).hint(150, SWT.DEFAULT).create());
- new Label(composite, SWT.NONE).setLayoutData(GridDataFactory.swtDefaults().create());
-
- Text label = new Text(composite, SWT.READ_ONLY);
- label.setText(JSPUIMessages.JSPSourcePreferencePage_0);
- GridData data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
- 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(SWT.FILL, SWT.DEFAULT, true, false);
- 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(SWT.FILL, SWT.DEFAULT, true, false);
- data.horizontalIndent = 5;
- contentTypeArea.getControl().setLayoutData(data);
- return composite;
- }
-
- 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);
- data.horizontalIndent = 0;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
-
- 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/JSPSyntaxColoringPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
deleted file mode 100644
index d7d8138bb8..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPSyntaxColoringPage.java
+++ /dev/null
@@ -1,854 +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.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.preference.ColorSelector;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-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.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-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.accessibility.ACC;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-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.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.SSEUIMessages;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
-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.ColorHelper;
-import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * A preference page to configure our XML syntax color. It resembles the JDT
- * and CDT pages far more than our original color page while retaining the
- * extra "click-to-find" functionality.
- */
-public final class JSPSyntaxColoringPage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private Button fBold;
- private Label fForegroundLabel;
- private Label fBackgroundLabel;
- private Button fClearStyle;
- private Map fContextToStyleMap;
- private Color fDefaultForeground = null;
- private Color fDefaultBackground = null;
- private IStructuredDocument fDocument;
- private ColorSelector fForegroundColorEditor;
- private ColorSelector fBackgroundColorEditor;
- private Button fItalic;
- private OverlayPreferenceStore fOverlayStore;
- private Button fStrike;
- private Collection fStylePreferenceKeys;
- private StructuredViewer fStylesViewer = null;
- private Map fStyleToDescriptionMap;
- private StyledText fText;
- private Button fUnderline;
-
-
- // activate controls based on the given local color type
- private void activate(String namedStyle) {
- Color foreground = fDefaultForeground;
- Color background = fDefaultBackground;
- if (namedStyle == null) {
- fClearStyle.setEnabled(false);
- fBold.setEnabled(false);
- fItalic.setEnabled(false);
- fStrike.setEnabled(false);
- fUnderline.setEnabled(false);
- fForegroundLabel.setEnabled(false);
- fBackgroundLabel.setEnabled(false);
- fForegroundColorEditor.setEnabled(false);
- fBackgroundColorEditor.setEnabled(false);
- fBold.setSelection(false);
- fItalic.setSelection(false);
- fStrike.setSelection(false);
- fUnderline.setSelection(false);
- }
- else {
- TextAttribute attribute = getAttributeFor(namedStyle);
- fClearStyle.setEnabled(true);
- boolean enableBackgroundOnly = IStyleConstantsJSP.JSP_CONTENT.equals(namedStyle);
- fBold.setEnabled(!enableBackgroundOnly);
- fItalic.setEnabled(!enableBackgroundOnly);
- fStrike.setEnabled(!enableBackgroundOnly);
- fUnderline.setEnabled(!enableBackgroundOnly);
- fForegroundLabel.setEnabled(!enableBackgroundOnly);
- fForegroundColorEditor.setEnabled(!enableBackgroundOnly);
- fBackgroundLabel.setEnabled(true);
- fBackgroundColorEditor.setEnabled(true);
- fBold.setSelection((attribute.getStyle() & SWT.BOLD) != 0);
- fItalic.setSelection((attribute.getStyle() & SWT.ITALIC) != 0);
- fStrike.setSelection((attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0);
- fUnderline.setSelection((attribute.getStyle() & TextAttribute.UNDERLINE) != 0);
- if (attribute.getForeground() != null) {
- foreground = attribute.getForeground();
- }
- if (attribute.getBackground() != null) {
- background = attribute.getBackground();
- }
- }
-
- fForegroundColorEditor.setColorValue(foreground.getRGB());
- fBackgroundColorEditor.setColorValue(background.getRGB());
- }
-
- /**
- * Color the text in the sample area according to the current preferences
- */
- void applyStyles() {
- if (fText == null || fText.isDisposed())
- return;
- IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
- while (documentRegion != null) {
- ITextRegionList regions = documentRegion.getRegions();
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion currentRegion = regions.get(i);
- // lookup the local coloring type and apply it
- String namedStyle = (String) fContextToStyleMap.get(currentRegion.getType());
- if (namedStyle == null)
- continue;
- TextAttribute attribute = getAttributeFor(namedStyle);
- if (attribute == null)
- continue;
- StyleRange style = new StyleRange(documentRegion.getStartOffset(currentRegion), currentRegion.getTextLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
- style.strikeout = (attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0;
- style.underline = (attribute.getStyle() & TextAttribute.UNDERLINE) != 0;
- fText.setStyleRange(style);
- }
- documentRegion = documentRegion.getNext();
- }
- }
-
- Button createCheckbox(Composite parent, String label) {
- Button button = new Button(parent, SWT.CHECK);
- button.setText(label);
- button.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- return button;
- }
-
- /**
- * Creates composite control and sets the default layout data.
- */
- private Composite createComposite(Composite parent, int numColumns) {
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.makeColumnsEqualWidth = false;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- composite.setLayoutData(data);
- return composite;
- }
-
- protected Control createContents(final Composite parent) {
- initializeDialogUnits(parent);
-
- fDefaultForeground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- fDefaultBackground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- Composite pageComponent = createComposite(parent, 2);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.JSP_PREFWEBX_STYLES_HELPID);
-
- Link link = new Link(pageComponent, SWT.WRAP);
- link.setText(SSEUIMessages.SyntaxColoring_Link);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- PreferencesUtil.createPreferenceDialogOn(parent.getShell(), e.text, null, null);
- }
- });
-
- GridData linkData= new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1);
- linkData.widthHint= 150; // only expand further if anyone else requires it
- link.setLayoutData(linkData);
-
- new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
- new Label(pageComponent, SWT.NONE).setLayoutData(new GridData());
-
- SashForm editor = new SashForm(pageComponent, SWT.VERTICAL);
- GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData2.horizontalSpan = 2;
- editor.setLayoutData(gridData2);
- SashForm top = new SashForm(editor, SWT.HORIZONTAL);
- Composite styleEditor = createComposite(top, 1);
- ((GridLayout) styleEditor.getLayout()).marginRight = 5;
- ((GridLayout) styleEditor.getLayout()).marginLeft = 0;
- createLabel(styleEditor, JSPUIMessages.SyntaxColoringPage_0);
- fStylesViewer = createStylesViewer(styleEditor);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.horizontalIndent = 0;
- Iterator iterator = fStyleToDescriptionMap.values().iterator();
- while (iterator.hasNext()) {
- gridData.widthHint = Math.max(gridData.widthHint, convertWidthInCharsToPixels(iterator.next().toString().length()));
- }
- gridData.heightHint = convertHeightInCharsToPixels(5);
- fStylesViewer.getControl().setLayoutData(gridData);
-
- Composite editingComposite = createComposite(top, 1);
- ((GridLayout) styleEditor.getLayout()).marginLeft = 5;
- createLabel(editingComposite, ""); //$NON-NLS-1$
- Button enabler = createCheckbox(editingComposite, JSPUIMessages.SyntaxColoringPage_2);
- enabler.setEnabled(false);
- enabler.setSelection(true);
- Composite editControls = createComposite(editingComposite, 2);
- ((GridLayout) editControls.getLayout()).marginLeft = 20;
-
- fForegroundLabel = createLabel(editControls, SSEUIMessages.Foreground_UI_);
- ((GridData) fForegroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
- fForegroundLabel.setEnabled(false);
-
- fForegroundColorEditor = new ColorSelector(editControls);
- Button fForegroundColor = fForegroundColorEditor.getButton();
- GridData gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
- fForegroundColor.setLayoutData(gd);
- fForegroundColorEditor.setEnabled(false);
-
- fBackgroundLabel = createLabel(editControls, SSEUIMessages.Background_UI_);
- ((GridData) fBackgroundLabel.getLayoutData()).verticalAlignment = SWT.CENTER;
- fBackgroundLabel.setEnabled(false);
-
- fBackgroundColorEditor = new ColorSelector(editControls);
- Button fBackgroundColor = fBackgroundColorEditor.getButton();
- gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
- fBackgroundColor.setLayoutData(gd);
- fBackgroundColorEditor.setEnabled(false);
-
- fBold = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_3);
- fBold.setEnabled(false);
- ((GridData) fBold.getLayoutData()).horizontalSpan = 2;
- fItalic = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_4);
- fItalic.setEnabled(false);
- ((GridData) fItalic.getLayoutData()).horizontalSpan = 2;
- fStrike = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_5);
- fStrike.setEnabled(false);
- ((GridData) fStrike.getLayoutData()).horizontalSpan = 2;
- fUnderline = createCheckbox(editControls, JSPUIMessages.SyntaxColoringPage_6);
- fUnderline.setEnabled(false);
- ((GridData) fUnderline.getLayoutData()).horizontalSpan = 2;
- fClearStyle = new Button(editingComposite, SWT.PUSH);
- fClearStyle.setText(SSEUIMessages.Restore_Default_UI_); //$NON-NLS-1$ = "Restore Default"
- fClearStyle.setLayoutData(new GridData(SWT.BEGINNING));
- ((GridData) fClearStyle.getLayoutData()).horizontalIndent = 20;
- fClearStyle.setEnabled(false);
-
- Composite sampleArea = createComposite(editor, 1);
-
- ((GridLayout) sampleArea.getLayout()).marginLeft = 5;
- ((GridLayout) sampleArea.getLayout()).marginTop = 5;
- createLabel(sampleArea, SSEUIMessages.Sample_text__UI_); //$NON-NLS-1$ = "&Sample text:"
- SourceViewer viewer = new SourceViewer(sampleArea, null, SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- fText = viewer.getTextWidget();
- GridData gridData3 = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData3.widthHint = convertWidthInCharsToPixels(20);
- gridData3.heightHint = convertHeightInCharsToPixels(5);
- gridData3.horizontalSpan = 2;
- fText.setLayoutData(gridData3);
- fText.setEditable(false);
- fText.setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- fText.addKeyListener(getTextKeyListener());
- fText.addSelectionListener(getTextSelectionListener());
- fText.addMouseListener(getTextMouseListener());
- fText.addTraverseListener(getTraverseListener());
- setAccessible(fText, SSEUIMessages.Sample_text__UI_);
- fDocument = StructuredModelManager.getModelManager().createStructuredDocumentFor(ContentTypeIdForJSP.ContentTypeID_JSP);
- fDocument.set(getExampleText());
- viewer.setDocument(fDocument);
-
- top.setWeights(new int[]{1, 1});
- editor.setWeights(new int[]{1, 1});
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.JSP_PREFWEBX_STYLES_HELPID);
-
- fStylesViewer.setInput(getStylePreferenceKeys());
-
- applyStyles();
-
- fStylesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- if (!event.getSelection().isEmpty()) {
- Object o = ((IStructuredSelection) event.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- activate(namedStyle);
- if (namedStyle == null)
- return;
- }
- }
- });
-
- fForegroundColorEditor.addListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
- Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[0];
- // open color dialog to get new color
- String newValue = ColorHelper.toRGBString(fForegroundColorEditor.getColorValue());
-
- if (!newValue.equals(oldValue)) {
- stylePrefs[0] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- fText.redraw();
- }
- }
- }
- }
- });
-
- fBackgroundColorEditor.addListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(ColorSelector.PROP_COLORCHANGE)) {
- Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[1];
- // open color dialog to get new color
- String newValue = ColorHelper.toRGBString(fBackgroundColorEditor.getColorValue());
-
- if (!newValue.equals(oldValue)) {
- stylePrefs[1] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- fText.redraw();
- activate(namedStyle);
- }
- }
- }
- }
- });
-
- fBold.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[2];
- String newValue = String.valueOf(fBold.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[2] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- fText.redraw();
- }
- }
- }
- });
-
- fItalic.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[3];
- String newValue = String.valueOf(fItalic.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[3] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- fText.redraw();
- }
- }
- }
- });
-
- fStrike.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[4];
- String newValue = String.valueOf(fStrike.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[4] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- fText.redraw();
- }
- }
- }
- });
-
- fUnderline.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- // get current (newly old) style
- Object o = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement();
- String namedStyle = o.toString();
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- String oldValue = stylePrefs[5];
- String newValue = String.valueOf(fUnderline.getSelection());
- if (!newValue.equals(oldValue)) {
- stylePrefs[5] = newValue;
- String newPrefString = ColorHelper.packStylePreferences(stylePrefs);
- getOverlayStore().setValue(namedStyle, newPrefString);
- applyStyles();
- fText.redraw();
- }
- }
- }
- });
-
- fClearStyle.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (fStylesViewer.getSelection().isEmpty())
- return;
- String namedStyle = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement().toString();
- getOverlayStore().setToDefault(namedStyle);
- applyStyles();
- fText.redraw();
- activate(namedStyle);
- }
- });
-
- return pageComponent;
- }
-
- private Label createLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.WRAP);
- label.setText(text);
- GridData data = new GridData(SWT.FILL, SWT.FILL, false, false);
- label.setLayoutData(data);
- label.setBackground(parent.getBackground());
- return label;
- }
-
- // protected Label createDescriptionLabel(Composite parent) {
- // return null;
- // }
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- private OverlayKey[] createOverlayStoreKeys() {
- List overlayKeys = new ArrayList();
-
- Iterator i = getStylePreferenceKeys().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;
- }
-
- /**
- * Creates the List viewer where we see the various syntax element display
- * names--would it ever be a Tree like JDT's?
- *
- * @param parent
- * @return
- */
- private StructuredViewer createStylesViewer(Composite parent) {
- StructuredViewer stylesViewer = new ListViewer(parent, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
- stylesViewer.setComparator(new ViewerComparator(Collator.getInstance()));
- stylesViewer.setLabelProvider(new LabelProvider() {
- public String getText(Object element) {
- Object description = fStyleToDescriptionMap.get(element);
- if (description != null)
- return description.toString();
- return super.getText(element);
- }
- });
- stylesViewer.setContentProvider(new ITreeContentProvider() {
- public void dispose() {
- }
-
- public Object[] getChildren(Object parentElement) {
- return getStylePreferenceKeys().toArray();
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public Object getParent(Object element) {
- return getStylePreferenceKeys();
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- });
- return stylesViewer;
- }
-
- public void dispose() {
- if (fOverlayStore != null) {
- fOverlayStore.stop();
- }
- super.dispose();
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- private TextAttribute getAttributeFor(String namedStyle) {
- TextAttribute ta = new TextAttribute(fDefaultForeground, fDefaultBackground, SWT.NORMAL);
-
- if (namedStyle != null && fOverlayStore != null) {
- // note: "namedStyle" *is* the preference key
- String prefString = getOverlayStore().getString(namedStyle);
- String[] stylePrefs = ColorHelper.unpackStylePreferences(prefString);
- if (stylePrefs != null) {
- RGB foreground = ColorHelper.toRGB(stylePrefs[0]);
- RGB background = ColorHelper.toRGB(stylePrefs[1]);
-
- int fontModifier = SWT.NORMAL;
-
- if (stylePrefs.length > 2) {
- boolean on = Boolean.valueOf(stylePrefs[2]).booleanValue();
- if (on)
- fontModifier = fontModifier | SWT.BOLD;
- }
- if (stylePrefs.length > 3) {
- boolean on = Boolean.valueOf(stylePrefs[3]).booleanValue();
- if (on)
- fontModifier = fontModifier | SWT.ITALIC;
- }
- if (stylePrefs.length > 4) {
- boolean on = Boolean.valueOf(stylePrefs[4]).booleanValue();
- if (on)
- fontModifier = fontModifier | TextAttribute.STRIKETHROUGH;
- }
- if (stylePrefs.length > 5) {
- boolean on = Boolean.valueOf(stylePrefs[5]).booleanValue();
- if (on)
- fontModifier = fontModifier | TextAttribute.UNDERLINE;
- }
-
- ta = new TextAttribute((foreground != null) ? EditorUtility.getColor(foreground) : null, (background != null) ? EditorUtility.getColor(background) : null, fontModifier);
- }
- }
- return ta;
- }
-
- private String getExampleText() {
- return JSPUIMessages.Sample_JSP_doc;
- }
-
- private String getNamedStyleAtOffset(int offset) {
- // ensure the offset is clean
- if (offset >= fDocument.getLength())
- return getNamedStyleAtOffset(fDocument.getLength() - 1);
- else if (offset < 0)
- return getNamedStyleAtOffset(0);
- IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
- while (documentRegion != null && !documentRegion.containsOffset(offset)) {
- documentRegion = documentRegion.getNext();
- }
- if (documentRegion != null) {
- // find the ITextRegion's Context at this offset
- ITextRegion interest = documentRegion.getRegionAtCharacterOffset(offset);
- if (interest == null)
- return null;
- if (offset > documentRegion.getTextEndOffset(interest))
- return null;
- String regionContext = interest.getType();
- if (regionContext == null)
- return null;
- // find the named style (internal/selectable name) for that
- // context
- String namedStyle = (String) fContextToStyleMap.get(regionContext);
- if (namedStyle != null) {
- return namedStyle;
- }
- }
- return null;
- }
-
- private OverlayPreferenceStore getOverlayStore() {
- return fOverlayStore;
- }
-
- private Collection getStylePreferenceKeys() {
- if (fStylePreferenceKeys == null) {
- List styles = new ArrayList();
- styles.add(IStyleConstantsXML.TAG_BORDER);
- styles.add(IStyleConstantsXML.TAG_NAME);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- styles.add(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- styles.add(IStyleConstantsXML.COMMENT_BORDER);
- styles.add(IStyleConstantsXML.COMMENT_TEXT);
- styles.add(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- styles.add(IStyleConstantsJSP.JSP_CONTENT);
- fStylePreferenceKeys = styles;
- }
- return fStylePreferenceKeys;
- }
-
- private KeyListener getTextKeyListener() {
- return new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.widget instanceof StyledText) {
- int x = ((StyledText) e.widget).getCaretOffset();
- selectColorAtOffset(x);
- }
- }
-
- public void keyReleased(KeyEvent e) {
- if (e.widget instanceof StyledText) {
- int x = ((StyledText) e.widget).getCaretOffset();
- selectColorAtOffset(x);
- }
- }
- };
- }
-
- private MouseListener getTextMouseListener() {
- return new MouseListener() {
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseUp(MouseEvent e) {
- if (e.widget instanceof StyledText) {
- int x = ((StyledText) e.widget).getCaretOffset();
- selectColorAtOffset(x);
- }
- }
- };
- }
-
- private SelectionListener getTextSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- selectColorAtOffset(e.x);
- if (e.widget instanceof StyledText) {
- ((StyledText) e.widget).setSelection(e.x);
- }
- }
-
- public void widgetSelected(SelectionEvent e) {
- selectColorAtOffset(e.x);
- if (e.widget instanceof StyledText) {
- ((StyledText) e.widget).setSelection(e.x);
- }
- }
- };
- }
-
- private TraverseListener getTraverseListener() {
- return new TraverseListener() {
- /**
- * @see org.eclipse.swt.events.TraverseListener#keyTraversed(TraverseEvent)
- */
- public void keyTraversed(TraverseEvent e) {
- if (e.widget instanceof StyledText) {
- if ((e.detail == SWT.TRAVERSE_TAB_NEXT) || (e.detail == SWT.TRAVERSE_TAB_PREVIOUS))
- e.doit = true;
- }
- }
- };
- }
-
- public void init(IWorkbench workbench) {
- setDescription(SSEUIMessages.SyntaxColoring_Description);
-
- fStyleToDescriptionMap = new HashMap();
- fContextToStyleMap = new HashMap();
-
- initStyleToDescriptionMap();
- initRegionContextToStyleMap();
-
- fOverlayStore = new OverlayPreferenceStore(getPreferenceStore(), createOverlayStoreKeys());
- fOverlayStore.load();
- fOverlayStore.start();
- }
-
- private void initRegionContextToStyleMap() {
- fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- fContextToStyleMap.put(DOMRegionContext.XML_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
-
- fContextToStyleMap.put(DOMRegionContext.XML_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_END_TAG_OPEN, IStyleConstantsXML.TAG_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_TAG_NAME, IStyleConstantsXML.TAG_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- fContextToStyleMap.put(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- fContextToStyleMap.put(DOMRegionContext.XML_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
- fContextToStyleMap.put(DOMRegionContext.XML_EMPTY_TAG_CLOSE, IStyleConstantsXML.TAG_BORDER);
-
- fContextToStyleMap.put(DOMRegionContext.XML_CHAR_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
- fContextToStyleMap.put(DOMRegionContext.XML_ENTITY_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
- fContextToStyleMap.put(DOMRegionContext.XML_PE_REFERENCE, IStyleConstantsXML.ENTITY_REFERENCE);
-
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DECLARATION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_EXPRESSION_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_CLOSE, IStyleConstantsHTML.SCRIPT_AREA_BORDER);
-
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_CONTENT, IStyleConstantsJSP.JSP_CONTENT);
-
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME, IStyleConstantsXML.TAG_NAME);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- fContextToStyleMap.put(DOMJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
-
- fContextToStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_DQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- fContextToStyleMap.put(DOMJSPRegionContexts.XML_TAG_ATTRIBUTE_VALUE_SQUOTE, IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- }
-
- private void initStyleToDescriptionMap() {
- fStyleToDescriptionMap.put(IStyleConstantsXML.COMMENT_BORDER, XMLUIMessages.Comment_Delimiters_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.COMMENT_TEXT, XMLUIMessages.Comment_Content_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_BORDER, XMLUIMessages.Tag_Delimiters_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_NAME, XMLUIMessages.Tag_Names_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, XMLUIMessages.Attribute_Names_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, XMLUIMessages.Attribute_Values_UI_); // =
- fStyleToDescriptionMap.put(IStyleConstantsXML.ENTITY_REFERENCE, XMLUIMessages.Entity_Reference_UI_); //$NON-NLS-1$ = "Entity References"
- fStyleToDescriptionMap.put(IStyleConstantsHTML.SCRIPT_AREA_BORDER, JSPUIMessages.JSP_Delimiters_UI_); //$NON-NLS-1$ = "JSP Delimiters"
- fStyleToDescriptionMap.put(IStyleConstantsJSP.JSP_CONTENT, JSPUIMessages.JSPColorPage_jsp_content);
- }
-
- protected void performDefaults() {
- super.performDefaults();
- getOverlayStore().loadDefaults();
- applyStyles();
- fStylesViewer.setSelection(StructuredSelection.EMPTY);
- activate(null);
- fText.redraw();
- }
-
- public boolean performOk() {
- getOverlayStore().propagate();
-
- JSPUIPlugin.getDefault().savePluginPreferences();
- SSEUIPlugin.getDefault().savePluginPreferences();
- return true;
- }
-
- private void selectColorAtOffset(int offset) {
- String namedStyle = getNamedStyleAtOffset(offset);
- if (namedStyle != null) {
- fStylesViewer.setSelection(new StructuredSelection(namedStyle));
- fStylesViewer.reveal(namedStyle);
- }
- else {
- fStylesViewer.setSelection(StructuredSelection.EMPTY);
- }
- activate(namedStyle);
- }
-
- /**
- * Specifically set the reporting name of a control for accessibility
- */
- private void setAccessible(Control control, String name) {
- if (control == null)
- return;
- final String n = name;
- control.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- if (e.childID == ACC.CHILDID_SELF)
- e.result = n;
- }
- });
- }
-}
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 9d637a9d27..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTemplatePreferencePage.java
+++ /dev/null
@@ -1,165 +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.preferences.ui;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.editor.IHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-
-
-/**
- * Preference page for JSP templates
- */
-public class JSPTemplatePreferencePage extends TemplatePreferencePage {
- class JSPEditTemplateDialog extends EditTemplateDialog {
- public JSPEditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry) {
- super(parent, template, edit, isNameModifiable, registry);
- }
-
- protected SourceViewer createViewer(Composite parent) { SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return baseConfiguration.getConfiguredContentTypes(sourceViewer);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
- }
-
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant = new ContentAssistant();
- assistant.enableAutoActivation(true);
- assistant.enableAutoInsert(true);
- assistant.setContentAssistProcessor(getTemplateProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
- return assistant;
- }
- };
- return doCreateViewer(parent, sourceViewerConfiguration);
-}
- }
-
- 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;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#createViewer(org.eclipse.swt.widgets.Composite)
- */
- protected SourceViewer createViewer(Composite parent) {
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return baseConfiguration.getConfiguredContentTypes(sourceViewer);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
- }
- };
- return doCreateViewer(parent, sourceViewerConfiguration);
- }
-
- SourceViewer doCreateViewer(Composite parent, SourceViewerConfiguration viewerConfiguration) {
- SourceViewer viewer = null;
- String contentTypeID = ContentTypeIdForJSP.ContentTypeID_JSP;
- viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(contentTypeID);
- IDocument document = scratchModel.getStructuredDocument();
- viewer.configure(viewerConfiguration);
- viewer.setDocument(document);
- return viewer;
- }
-
- /**
- * Creates the edit dialog. Subclasses may override this method to provide
- * a custom dialog.
- *
- * @param template
- * the template being edited
- * @param edit
- * whether the dialog should be editable
- * @param isNameModifiable
- * whether the template name may be modified
- * @return the created or modified template, or <code>null</code> if the
- * edition failed
- * @since 3.1
- */
- protected Template editTemplate(Template template, boolean edit, boolean isNameModifiable) {
- EditTemplateDialog dialog = new JSPEditTemplateDialog(getShell(), template, edit, isNameModifiable, getContextTypeRegistry());
- if (dialog.open() == Window.OK) {
- return dialog.getTemplate();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
deleted file mode 100644
index 9db2d84197..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPTypingPreferencePage.java
+++ /dev/null
@@ -1,91 +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.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jst.jsp.ui.internal.JSPUIMessages;
-import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
-import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractPreferencePage;
-
-public class JSPTypingPreferencePage extends AbstractPreferencePage {
-
- private Button fCloseBraces;
- private Button fCloseScriptlets;
-
- protected Control createContents(Composite parent) {
- Composite composite = super.createComposite(parent, 1);
-
- createAutoComplete(composite);
-
- setSize(composite);
- loadPreferences();
-
- return composite;
- }
-
- private void createAutoComplete(Composite parent) {
- Group group = createGroup(parent, 2);
-
- group.setText(JSPUIMessages.JSPTyping_Auto_Complete);
-
- fCloseBraces = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Braces);
- ((GridData) fCloseBraces.getLayoutData()).horizontalSpan = 2;
-
- fCloseScriptlets = createCheckBox(group, JSPUIMessages.JSPTyping_Complete_Scriptlets);
- ((GridData) fCloseScriptlets.getLayoutData()).horizontalSpan = 2;
-
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- JSPUIPlugin.getDefault().savePluginPreferences();
-
- return result;
- }
-
- protected void initializeValues() {
- initCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
- initCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
- }
-
- protected void performDefaults() {
- defaultCheckbox(fCloseBraces, JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES);
- defaultCheckbox(fCloseScriptlets, JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS);
- }
-
- private void initCheckbox(Button box, String key) {
- if(box != null && key != null)
- box.setSelection(getPreferenceStore().getBoolean(key));
- }
-
- private void defaultCheckbox(Button box, String key) {
- if(box != null && key != null)
- box.setSelection(getPreferenceStore().getDefaultBoolean(key));
- }
-
- protected void storeValues() {
- getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_EL_BRACES, (fCloseBraces != null) ? fCloseBraces.getSelection() : false);
- getPreferenceStore().setValue(JSPUIPreferenceNames.TYPING_COMPLETE_SCRIPTLETS, (fCloseScriptlets != null) ? fCloseScriptlets.getSelection() : false);
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
deleted file mode 100644
index f53e9e4a03..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/preferences/ui/JSPValidationPreferencePage.java
+++ /dev/null
@@ -1,277 +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.jst.jsp.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
-import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
-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.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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferenceLinkArea;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ScrolledPageContent;
-import org.eclipse.wst.sse.ui.internal.util.PixelConverter;
-
-public class JSPValidationPreferencePage extends AbstractValidationSettingsPage {
-
- /**
- *
- */
- private static final String PREFERENCE_NODE_QUALIFIER = JSPCorePlugin.getDefault().getBundle().getSymbolicName();
-
- private static final String SETTINGS_SECTION_NAME = "JSPValidationSeverities";//$NON-NLS-1$
-
- private static final int[] SEVERITIES = {ValidationMessage.ERROR, ValidationMessage.WARNING, ValidationMessage.IGNORE};
-
- // Should equal org.eclipse.jdt.internal.ui.preferences.ProblemSeveritiesPreferencePage.PREF_ID
- public static final String JAVA_SEVERITY_PREFERENCE_PAGE = "org.eclipse.jdt.ui.preferences.ProblemSeveritiesPreferencePage";
- // Should equal org.eclipse.jdt.internal.ui.preferences.ProblemSeveritiesPreferencePage.PROP_ID
- public static final String JAVA_SEVERITY_PROPERTY_PAGE = "org.eclipse.jdt.ui.propertyPages.ProblemSeveritiesPreferencePage";
- // Should equal org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage.DATA_NO_LINK
- public static final String DATA_NO_LINK= "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$
-
- private PixelConverter fPixelConverter;
- private Button fValidateFragments;
-
- private boolean fOriginalValidateFragments;
-
- public JSPValidationPreferencePage() {
- super();
- }
-
- /**
- * @param parent
- * @param text
- * @return
- */
- private Button createCheckBox(Composite parent, String text) {
- Button c = new Button(parent, SWT.CHECK);
- c.setText(text);
- c.setLayoutData(GridDataFactory.fillDefaults().create());
- return c;
- }
-
- protected Control createCommonContents(Composite parent) {
- final Composite page = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- page.setLayout(layout);
-
- fPixelConverter = new PixelConverter(parent);
-
- Group filesGroup = new Group(page, SWT.NONE);
- filesGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
- filesGroup.setLayout(new GridLayout(1, false));
- filesGroup.setText(JSPUIMessages.JSPFilesPreferencePage_0);
- createFilesSection(filesGroup);
-
- // spacer
-// new Label(page, SWT.NONE).setLayoutData(GridDataFactory.fillDefaults().create());
-
- Group severitiesGroup = new Group(page, SWT.NONE);
- severitiesGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
- severitiesGroup.setLayout(new GridLayout(1, false));
- severitiesGroup.setText(JSPUIMessages.JSPValidationPreferencePage_0);
- final Composite content = createValidationSection(severitiesGroup);
-
- GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
- gridData.heightHint = fPixelConverter.convertHeightInCharsToPixels(20);
- content.setLayoutData(gridData);
-
- return page;
- }
-
- /**
- * @param fragmentGroup
- */
- private void createFilesSection(Group fragmentGroup) {
- fValidateFragments = createCheckBox(fragmentGroup, JSPUIMessages.JSPFilesPreferencePage_1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fValidateFragments, IHelpContextIds.JSP_PREFWEBX_FILES_HELPID);
- IScopeContext[] contexts = createPreferenceScopes();
- fOriginalValidateFragments = contexts[0].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, contexts[1].getNode(getPreferenceNodeQualifier()).getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true));
- fValidateFragments.setSelection(fOriginalValidateFragments);
- }
-
- private Composite createValidationSection(Composite page) {
- int nColumns = 3;
-
- final ScrolledPageContent spContent = new ScrolledPageContent(page);
-
- Composite composite = spContent.getBody();
-
- GridLayout layout = new GridLayout(nColumns, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
-
- Label description = new Label(composite, SWT.NONE);
- description.setText(JSPUIMessages.Validation_description);
- description.setFont(page.getFont());
-
- String[] errorWarningIgnoreLabels = new String[]{JSPUIMessages.Validation_Error, JSPUIMessages.Validation_Warning, JSPUIMessages.Validation_Ignore};
- Composite section;
-
- // begin directives section
- section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_DIRECTIVE, nColumns);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_UNRESOLVABLE_URI_OR_TAGDIR, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_DIFFERENT_URIS, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_DUPLICATE_PREFIXES_SAME_URIS, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_MISSING_PREFIX, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_TAGLIB_MISSING_URI_OR_TAGDIR, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_FILE_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_INCLUDE_NO_FILE_SPECIFIED, SEVERITIES, errorWarningIgnoreLabels, 0);
-// addComboBox(section, JSPUIMessages.VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_DIRECTIVE_PAGE_SUPERCLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
- // end directives section
-
- // begin custom actions section
- section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_CUSTOM_ACTIONS, nColumns);
- addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_MISSING_REQUIRED_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_UNKNOWN_ATTRIBUTE, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, JSPCorePreferenceNames.VALIDATION_ACTIONS_SEVERITY_NON_EMPTY_INLINE_TAG, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_VALIDATION_MESSAGE, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_NOT_INSTANTIATED, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TEI_CLASS_RUNTIME_EXCEPTION, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, JSPCorePreferenceNames.VALIDATION_TRANSLATION_TAG_HANDLER_CLASS_NOT_FOUND, SEVERITIES, errorWarningIgnoreLabels, 0);
- // end custom actions section
-
- // begin standard actions section
- section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_STANDARD_ACTIONS, nColumns);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USEBEAN_INVALID_ID, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USEBEAN_INVALID_ID, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO, JSPCorePreferenceNames.VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO, SEVERITIES, errorWarningIgnoreLabels, 0);
- // end standard actions section
-
- // begin Java severity override section
- section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_JAVA, nColumns);
- if (getProject() == null) {
- new PreferenceLinkArea(section, SWT.WRAP | SWT.MULTI | SWT.LEFT_TO_RIGHT, JAVA_SEVERITY_PREFERENCE_PAGE, JSPUIMessages.VALIDATION_JAVA_NOTICE, (IWorkbenchPreferenceContainer) getContainer(), null).getControl().setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
- }
- else {
-// Map data = new HashMap();
-// data.put(DATA_NO_LINK, Boolean.TRUE);
-// new PreferenceLinkArea(section, SWT.WRAP | SWT.MULTI | SWT.LEFT_TO_RIGHT, JAVA_SEVERITY_PROPERTY_PAGE, JSPUIMessages.VALIDATION_JAVA_NOTICE, (IWorkbenchPreferenceContainer) getContainer(), data).getControl().setLayoutData(GridDataFactory.fillDefaults().span(2, 1).indent(0, 0).hint(150, SWT.DEFAULT).create());
- // open in same shell?
- // PreferencesUtil.createPropertyDialogOn(getShell(), getProject(), JAVA_SEVERITY_PROPERTY_PAGE, new String[] { JAVA_SEVERITY_PROPERTY_PAGE }, data).open();
- }
- int sectionIndent = convertWidthInCharsToPixels(2);
- addComboBox(section, JSPUIMessages.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, JSPCorePreferenceNames.VALIDATION_JAVA_LOCAL_VARIABLE_NEVER_USED, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
- addComboBox(section, JSPUIMessages.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, JSPCorePreferenceNames.VALIDATION_JAVA_ARGUMENT_IS_NEVER_USED, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
- addComboBox(section, JSPUIMessages.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, JSPCorePreferenceNames.VALIDATION_JAVA_NULL_LOCAL_VARIABLE_REFERENCE, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
- addComboBox(section, JSPUIMessages.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, JSPCorePreferenceNames.VALIDATION_JAVA_POTENTIAL_NULL_LOCAL_VARIABLE_REFERENCE, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
- addComboBox(section, JSPUIMessages.VALIDATION_JAVA_UNUSED_IMPORT, JSPCorePreferenceNames.VALIDATION_JAVA_UNUSED_IMPORT, SEVERITIES, errorWarningIgnoreLabels, sectionIndent);
- // end Java severity override section
-
- // begin EL section
- section = createStyleSectionWithContentComposite(composite, JSPUIMessages.VALIDATION_HEADER_EL, nColumns);
- addComboBox(section, JSPUIMessages.VALIDATION_EL_SYNTAX, JSPCorePreferenceNames.VALIDATION_EL_SYNTAX, SEVERITIES, errorWarningIgnoreLabels, 0);
- addComboBox(section, JSPUIMessages.VALIDATION_EL_LEXER, JSPCorePreferenceNames.VALIDATION_EL_LEXER, SEVERITIES, errorWarningIgnoreLabels, 0);
- // end EL section
-
- restoreSectionExpansionStates(getDialogSettings().getSection(SETTINGS_SECTION_NAME));
-
- return spContent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- public void dispose() {
- storeSectionExpansionStates(getDialogSettings().addNewSection(SETTINGS_SECTION_NAME));
- super.dispose();
- }
-
- protected IDialogSettings getDialogSettings() {
- return JSPUIPlugin.getDefault().getDialogSettings();
- }
-
- protected String getPreferenceNodeQualifier() {
- return PREFERENCE_NODE_QUALIFIER;
- }
-
- protected String getPreferencePageID() {
- return "org.eclipse.jst.jsp.ui.preferences.validation";//$NON-NLS-1$
- }
-
- protected String getProjectSettingsKey() {
- return JSPCorePreferenceNames.VALIDATION_USE_PROJECT_SETTINGS;
- }
-
- protected String getPropertyPageID() {
- return "org.eclipse.jst.jsp.ui.propertyPage.project.validation";//$NON-NLS-1$
- }
-
- public void init(IWorkbench workbench) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- resetSeverities();
-
- IEclipsePreferences defaultContext = new DefaultScope().getNode(getPreferenceNodeQualifier());
- boolean validateFragments = defaultContext.getBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, true);
- fValidateFragments.setSelection(validateFragments);
-
- super.performDefaults();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractSettingsPage#performOk()
- */
- public boolean performOk() {
- boolean result = super.performOk();
- storeValues();
- return result;
- }
-
- protected boolean shouldRevalidateOnSettingsChange() {
- return fOriginalValidateFragments != fValidateFragments.getSelection() || super.shouldRevalidateOnSettingsChange();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsp.ui.internal.preferences.ui.AbstractValidationSettingsPage#storeValues()
- */
- protected void storeValues() {
- super.storeValues();
-
- IScopeContext[] contexts = createPreferenceScopes();
- boolean validateFragments = fValidateFragments.getSelection();
- contexts[0].getNode(getPreferenceNodeQualifier()).putBoolean(JSPCorePreferenceNames.VALIDATE_FRAGMENTS, validateFragments);
- }
-}
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 d632a8996e..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, 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
- * Tom Turrell-Croft, left@ultrasis.com - [174307] Enable folding for div tags in JSP and HTML files
- *******************************************************************************/
-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 and div 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) || HTML40Namespace.ElementName.DIV.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 322f89a449..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, 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 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 8cf43ad284..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, 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.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 d4208c3ac3..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/projection/StructuredTextFoldingProviderJSP.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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.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;
-
- long start = System.currentTimeMillis();
- // 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);
- }
-
- try {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=198304
- // disable redraw while adding all adapters
- fViewer.setRedraw(false);
- addAllAdapters();
- }
- finally {
- fViewer.setRedraw(true);
- }
- }
- fProjectionNeedsToBeEnabled = false;
-
- if (debugProjectionPerf) {
- long end = System.currentTimeMillis();
- System.out.println("StructuredTextFoldingProviderJSP.initialize: " + (end - start)); //$NON-NLS-1$
- }
- }
-
- /**
- * 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 0ad8b15a7a..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/registry/AdapterFactoryProviderForJSP.java
+++ /dev/null
@@ -1,73 +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.internal.registry;
-
-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);
- }
-
- ModelHandlerForJSP.ensureTranslationAdapterFactory(structuredModel);
- }
-
- 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 3656d5dbe5..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 8ff7724075..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, 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
- * 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 4e05aef1a7..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 d0a2386717..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, 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.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 663c81a8ea..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, 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.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 80f6378984..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, 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.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 853af7caab..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/java/LineStyleProviderForJava.java
+++ /dev/null
@@ -1,324 +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 org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-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.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.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.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 extends AbstractLineStyleProvider implements LineStyleProvider{
-
- /** The scanner it uses */
- private JavaCodeScanner fScanner;
-
- 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
- TextAttribute ta = (TextAttribute)getTextAttributes().get(IStyleConstantsJSP.JSP_CONTENT);
- Color bgColor = ta.getBackground();
- if (bgColor == null)
- bgColor = attr.getBackground();
- StyleRange result = new StyleRange(offset, length, attr.getForeground(), bgColor, attr.getStyle());
- if((attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0) {
- result.strikeout = true;
- }
- if((attr.getStyle() & TextAttribute.UNDERLINE) != 0) {
- result.underline = true;
- }
- presentation.add(result);
- }
-
- /**
- * 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);
- boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH);
- boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italics) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, null, style);
- } 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);
- boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_STRING_STRIKETHROUGH);
- boolean underline = store.getBoolean(PreferenceConstants.EDITOR_STRING_UNDERLINE);
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italics) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, null, style);
- } 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);
- boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_STRIKETHROUGH);
- boolean underline = store.getBoolean(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_UNDERLINE);
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italics) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, null, style);
- } 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);
- boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH);
- boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_UNDERLINE);
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italics) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, null, style);
- }
- if (ta != null) {
- getTextAttributes().put(colorKey, ta);
- fScanner.setTokenData(colorKey, ta);
- }
- }
- }
-
- /**
- * 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;
- }
-
- protected void loadColors() {
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_NAME);
- addTextAttribute(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE);
- addTextAttribute(IStyleConstantsJSP.JSP_CONTENT);
-
- 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 (IStyleConstantsJSP.JSP_CONTENT.equals(prefKey)) {
- styleKey = IStyleConstantsJSP.JSP_CONTENT;
- } 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
- fRecHighlighter.refreshDisplay();
- }
- }
-
- public boolean prepareRegions(ITypedRegion typedRegion, int ssssrequestedStart, int ssssrequestedLength, Collection holdResults) {
- boolean result = true;
- /* Initialize the text attributes. Also load the colors and initialize the rules of the scanner */
- getTextAttributes();
- 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 lastStart = typedRegion.getOffset();
- int length = 0;
- IToken lastToken = Token.UNDEFINED;
- fScanner.setRange(getDocument(), lastStart, typedRegion.getLength());
- while (true) {
- IToken token = fScanner.nextToken();
- if (token.isEOF()) {
- if (!lastToken.isUndefined() && length != 0) {
- addRange(holdResults, lastStart, 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, length, getTokenTextAttribute(lastToken));
- lastToken = token;
- lastStart = fScanner.getTokenOffset();
- length = fScanner.getTokenLength();
- continue;
- }
- length += fScanner.getTokenLength();
- }
- } catch (Exception e) {
- // shouldn't happen, but we don't want it to stop other
- // highlighting, if it does.
- result = false;
- }
- return result;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- private IPreferenceStore getJavaColorPreferences() {
- return PreferenceConstants.getPreferenceStore();
- }
-
- protected void registerPreferenceManager() {
- getColorPreferences().addPropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
- }
-
- protected void unRegisterPreferenceManager() {
- getColorPreferences().removePropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- return null;
- }
-}
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 b2c4829842..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, 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
- * 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 7534b9bfd9..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, 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.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 01178a2da1..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, 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.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 e8997007e4..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, 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.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 a10a7ab0da..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, 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.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 3be63566e5..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/style/jspel/LineStyleProviderForJSPEL.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.jst.jsp.ui.internal.style.jspel;
-
-import java.util.Collection;
-
-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.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.ITextRegion;
-import org.eclipse.wst.sse.ui.internal.preferences.ui.ColorHelper;
-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.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 extends AbstractLineStyleProvider implements LineStyleProvider {
-
- /** The scanner it uses */
- private JSPELCodeScanner fScanner;
-
- 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 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);
- boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_STRIKETHROUGH);
- boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_KEYWORD_UNDERLINE);
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italics) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, null, style);
- } 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);
- boolean strikethrough = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_STRIKETHROUGH);
- boolean underline = store.getBoolean(PreferenceConstants.EDITOR_JAVA_DEFAULT_UNDERLINE);
- int style = SWT.NORMAL;
- if (bold) {
- style = style | SWT.BOLD;
- }
- if (italics) {
- style = style | SWT.ITALIC;
- }
- if (strikethrough) {
- style = style | TextAttribute.STRIKETHROUGH;
- }
- if (underline) {
- style = style | TextAttribute.UNDERLINE;
- }
-
- ta = createTextAttribute(foreground, null, style);
- }
- if (ta != null) {
- getTextAttributes().put(colorKey, ta);
- fScanner.setTokenData(colorKey, ta);
- }
- }
- }
-
- /**
- * 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;
- }
-
- protected 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
- fRecHighlighter.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;
- }
-
- protected IPreferenceStore getColorPreferences() {
- return JSPUIPlugin.getDefault().getPreferenceStore();
- }
-
- private IPreferenceStore getJavaColorPreferences() {
- return PreferenceConstants.getPreferenceStore();
- }
-
- protected void registerPreferenceManager() {
- getColorPreferences().addPropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().addPropertyChangeListener(fPreferenceListener);
- }
-
- protected void unRegisterPreferenceManager() {
- getColorPreferences().removePropertyChangeListener(fPreferenceListener);
- getJavaColorPreferences().removePropertyChangeListener(fPreferenceListener);
- }
-
- protected TextAttribute getAttributeFor(ITextRegion region) {
- return null;
- }
-}
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 327371b954..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPInformationProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.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)
- *
- * @deprecated StructuredTextViewerConfiguration creates the appropriate
- * information provider
- */
-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 9798cba5e6..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocHoverProcessor.java
+++ /dev/null
@@ -1,145 +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.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.internal.text.html.HTMLPrinter;
-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 6aa06f1c8e..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/taginfo/JSPJavaJavadocInformationProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 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.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)
- *
- * @deprecated StructuredTextViewerConfiguration creates the appropriate
- * information provider
- */
-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 9c2a7c2224..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, 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.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 5b5109e875..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, 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.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 eec77f9e69..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/templates/TemplateContextTypeIdsJSP.java
+++ /dev/null
@@ -1,52 +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.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();
-
- public static final String NEW_TAG = "tag_new";
-
- 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 60e19e7a34..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, 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.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 113c418d60..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, 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.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 4b80238b04..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/text/JavaCodeReader.java
+++ /dev/null
@@ -1,246 +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.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;
- }
-}
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 106ffdb205..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, 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.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;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/HTMLValidationReporter.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/HTMLValidationReporter.java
deleted file mode 100644
index b0fabbb787..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/HTMLValidationReporter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.jst.jsp.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.html.core.internal.validate.MessageFactory;
-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.ErrorInfo;
-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;
-
-/*
- * Copied from jsp.core's HTMLValidationReporter
- */
-class HTMLValidationReporter implements ValidationReporter {
- private IValidator owner = null;
- private IReporter reporter = null;
- private IFile file = null;
- private IStructuredModel model = null;
- private MessageFactory fFactory = null;
-
- /**
- */
- public HTMLValidationReporter(IValidator owner, IReporter reporter, IFile file, IStructuredModel model) {
- super();
- this.owner = owner;
- this.reporter = reporter;
- this.file = file;
- this.model = model;
- fFactory = new MessageFactory(file != null ? file.getProject() : null);
- }
-
- /**
- */
- public void clear() {
- if (this.file == null)
- return;
-
- if (this.reporter != null) {
- this.reporter.removeAllMessages(this.owner, this.file);
- }
-
- }
-
-
- /**
- */
- public void report(ValidationMessage message) {
- if (message == null || this.file == null || message.getSeverity() == ValidationMessage.IGNORE)
- return;
- IMessage mes = translateMessage(message);
-
- if (this.reporter != null) {
- this.reporter.addMessage(this.owner, mes);
- }
-
- }
-
- /**
- * Translate ValidationMessage to IMessage and generate result log
- */
- private IMessage translateMessage(ValidationMessage message) {
- int severity = IMessage.LOW_SEVERITY;
- switch (message.getSeverity()) {
- case ValidationMessage.ERROR :
- severity = IMessage.HIGH_SEVERITY;
- break;
- case ValidationMessage.WARNING :
- severity = IMessage.NORMAL_SEVERITY;
- break;
- case ValidationMessage.INFORMATION :
- 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;
- }
-
- public void report(ErrorInfo info) {
- report(fFactory.createMessage(info));
- }
-}
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 0ab20f968e..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.JSPContentValidator;
-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(JSPContentValidator.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/validation/JSPContentSourceValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPContentSourceValidator.java
deleted file mode 100644
index 6f6dbccc1f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPContentSourceValidator.java
+++ /dev/null
@@ -1,415 +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.JSPContentValidator;
-import org.eclipse.jst.jsp.ui.internal.Logger;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeConstants;
-import org.eclipse.wst.html.core.internal.validate.HTMLValidationAdapterFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
-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.validate.ValidationAdapter;
-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.core.Message;
-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.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;
-
-/**
- * Source validator for JSP content. This validator currently only validates
- * html content in jsp.
- */
-public class JSPContentSourceValidator extends JSPContentValidator implements ISourceValidator {
- /*
- * Most of this class was copied from the ISourceValidator aspects of
- * html.ui's HTMLValidator
- */
- 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;
- }
-
- protected void validate(IReporter reporter, IFile file, IDOMModel model) {
- if (file == null || model == null)
- return; // error
- IDOMDocument document = model.getDocument();
- if (document == null)
- return; // error
-
- // This validator currently only handles validating HTML content in
- // JSP
- if (hasHTMLFeature(document)) {
- INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
- ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
- if (adapter == null)
- return; // error
-
- HTMLValidationReporter rep = getReporter(reporter, file, model);
- rep.clear();
- adapter.setReporter(rep);
- adapter.validate(document);
- }
- }
-
- /**
- * 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 || !fEnableSourceValidation)
- 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);
-
- Message mess = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString().substring(1));
- 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) {
- IStructuredDocumentRegion[] regions = ((IStructuredDocument) fDocument).getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
- largestRegion = getLargest(regions);
- }
- return largestRegion;
- }
-
- private 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;
- }
-
- private boolean hasHTMLFeature(IDOMDocument document) {
- DocumentTypeAdapter adapter = (DocumentTypeAdapter) document.getAdapterFor(DocumentTypeAdapter.class);
- if (adapter == null)
- return false;
- return adapter.hasFeature(HTMLDocumentTypeConstants.HTML);
- }
-
- private HTMLValidationReporter getReporter(IReporter reporter, IFile file, IDOMModel model) {
- return new HTMLValidationReporter(this, reporter, file, model);
- }
-
- /**
- * 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(JSPContentValidator.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/validation/JSPMarkupValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPMarkupValidator.java
deleted file mode 100644
index 84acd78f35..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPMarkupValidator.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *
- *******************************************************************************/
-package org.eclipse.jst.jsp.ui.internal.validation;
-
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.osgi.util.NLS;
-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.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.correction.ProblemIDsXML;
-import org.eclipse.wst.xml.ui.internal.validation.MarkupValidator;
-
-public class JSPMarkupValidator extends MarkupValidator {
-
- private boolean hasXMLAttributes(IStructuredDocumentRegion structuredDocumentRegion) {
- ITextRegionList regions = structuredDocumentRegion.getRegions();
-
- if (regions.size() > 1 && regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN) {
- ITextRegion region = regions.get(1);
- if (region.getType() == DOMRegionContext.XML_TAG_NAME || region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
- // Tag name has a prefix, be strict about requiring quotes
- if (structuredDocumentRegion.getText(region).indexOf(":") != -1) //$NON-NLS-1$
- return true;
- }
- }
- return false;
- }
-
- protected void checkForAttributeValue(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
-
- if (structuredDocumentRegion.isDeleted()) {
- return;
- }
-
- if (hasXMLAttributes(structuredDocumentRegion))
- super.checkForAttributeValue(structuredDocumentRegion, reporter);
-
- // check for attributes without a value
- // track the attribute/equals/value sequence using a state of 0, 1 ,2
- // representing the name, =, and value, respectively
- int attrState = 0;
- ITextRegionList textRegions = structuredDocumentRegion.getRegions();
-
- int errorCount = 0;
- for (int i = 0; (i < textRegions.size()) && (errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT); i++) {
- ITextRegion textRegion = textRegions.get(i);
- if ((textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) || isTagCloseTextRegion(textRegion)) {
- // dangling name and '='
- if ((attrState == 2) && (i >= 2)) {
- // create annotation
- ITextRegion nameRegion = textRegions.get(i - 2);
- if (!(nameRegion instanceof ITextRegionContainer)) {
- Object[] args = {structuredDocumentRegion.getText(nameRegion)};
- String messageText = NLS.bind(XMLUIMessages.Attribute__is_missing_a_value, args);
-
- int start = structuredDocumentRegion.getStartOffset(nameRegion);
- int end = structuredDocumentRegion.getEndOffset();
- int textLength = structuredDocumentRegion.getText(nameRegion).trim().length();
-
- // quick fix info
- ITextRegion equalsRegion = textRegions.get(i - 2 + 1);
- int insertOffset = structuredDocumentRegion.getTextEndOffset(equalsRegion) - end;
- Object[] additionalFixInfo = {structuredDocumentRegion.getText(nameRegion), new Integer(insertOffset)};
-
- addAttributeError(messageText, additionalFixInfo, start, textLength, ProblemIDsXML.MissingAttrValue, structuredDocumentRegion, reporter);
- // annotation.setAdditionalFixInfo(additionalFixInfo);
- // results.add(annotation);
- errorCount++;
- }
- }
- attrState = 1;
- }
- else if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- attrState = 2;
- }
- else if (textRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- attrState = 0;
- }
- }
-
- }
-
- protected void checkQuotesForAttributeValues(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
- ITextRegionList regions = structuredDocumentRegion.getRegions();
- ITextRegion r = null;
- String attrValueText = ""; //$NON-NLS-1$
- int errorCount = 0;
-
- if (hasXMLAttributes(structuredDocumentRegion))
- super.checkQuotesForAttributeValues(structuredDocumentRegion, reporter);
-
- for (int i = 0; (i < regions.size()) && (errorCount < AbstractStructuredTextReconcilingStrategy.ELEMENT_ERROR_LIMIT); i++) {
- r = regions.get(i);
- if (r.getType() != DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- continue;
- }
-
- attrValueText = structuredDocumentRegion.getText(r);
- // attribute value includes quotes in the string
- // split up attribute value on quotes
- /*
- * WORKAROUND till
- * http://dev.icu-project.org/cgi-bin/icu-bugs/incoming?findid=5207
- * is fixed. (Also see BUG143628)
- */
-
- java.util.StringTokenizer st = new java.util.StringTokenizer(attrValueText, "\"'", true); //$NON-NLS-1$
- int size = st.countTokens();
- // get the pieces of the attribute value
- String one = "", two = ""; //$NON-NLS-1$ //$NON-NLS-2$
- if (size > 0) {
- one = st.nextToken();
- }
- if (size > 1) {
- two = st.nextToken();
- }
- if (size > 2) {
- // should be handled by parsing...
- // as in we can't have an attribute value like: <element
- // attr="a"b"c"/>
- // and <element attr='a"b"c' /> is legal
- continue;
- }
-
-
- if (size == 1) {
- if (one.equals(DQUOTE) || one.equals(SQUOTE)) {
- // missing closing quote
- String message = XMLUIMessages.ReconcileStepForMarkup_0;
- addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter);
- errorCount++;
- }
- }
- else if (size == 2) {
- if ((one.equals(SQUOTE) && !two.equals(SQUOTE)) || (one.equals(DQUOTE) && !two.equals(DQUOTE))) {
- // missing closing quote
- String message = XMLUIMessages.ReconcileStepForMarkup_0;
- addAttributeError(message, attrValueText, structuredDocumentRegion.getStartOffset(r), attrValueText.trim().length(), ProblemIDsXML.Unclassified, structuredDocumentRegion, reporter);
- errorCount++;
- }
- }
- }
- // end of region for loop
- }
-
- private boolean isTagCloseTextRegion(ITextRegion textRegion) {
- return (textRegion.getType() == DOMRegionContext.XML_TAG_CLOSE) || (textRegion.getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE);
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPSourceValidator.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPSourceValidator.java
deleted file mode 100644
index 231f52d64f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/JSPSourceValidator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, 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.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsp.core.internal.validation.MarkupValidatorDelegate;
-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.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.xml.ui.internal.validation.MarkupValidator;
-
-public class JSPSourceValidator implements MarkupValidatorDelegate {
-
- protected MarkupValidator val = new JSPMarkupValidator();
-
- public void validate(IResource resource, IReporter reporter) {
- validateFile( (IFile)resource, reporter);
- updateMessages(resource, reporter);
- }
-
- private void updateMessages(IResource resource, IReporter reporter) {
- List msgList = reporter.getMessages();
- if (msgList == null)
- return;
- for (int i = 0; i < msgList.size(); i++) {
- Object msgObject = msgList.get(i);
- if (msgObject instanceof IMessage) {
- IMessage message = (IMessage)msgObject;
- message.setTargetObject(resource);
- }
- }
-
- }
-
- private void validateFile(IFile file, IReporter reporter) {
- Message message = new LocalizedMessage(IMessage.LOW_SEVERITY, file.getFullPath().toString().substring(1));
- reporter.displaySubtask(val, message);
-
- IStructuredModel model = null;
- try{
- model = StructuredModelManager.getModelManager().getModelForRead(file);
- IStructuredDocument document = null;
- if(model != null) {
- document = model.getStructuredDocument();
- val.connect(document);
- IStructuredDocumentRegion validationRegion = document.getFirstStructuredDocumentRegion();
- while (validationRegion != null) {
- val.validate(validationRegion, reporter);
- validationRegion = validationRegion.getNext();
- }
- val.disconnect(document);
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
-
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java
deleted file mode 100644
index 1686e37095..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/LocalizedMessage.java
+++ /dev/null
@@ -1,61 +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.util.Locale;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.internal.core.Message;
-
-/**
- * Simple implementation of Message all validators in package can use.
- */
-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();
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/MarkupValidatorAdapterFactory.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/MarkupValidatorAdapterFactory.java
deleted file mode 100644
index d69b16ca91..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/validation/MarkupValidatorAdapterFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.jst.jsp.ui.internal.validation;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.validation.MarkupValidatorDelegate;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class MarkupValidatorAdapterFactory implements IAdapterFactory {
-
- private static final Class[] ADAPTER_LIST = { MarkupValidatorDelegate.class };
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof IDOMModel && MarkupValidatorDelegate.class.equals(adapterType)) {
- return new JSPSourceValidator();
- }
- return null;
- }
-
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
-}
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 9c362555ea..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPFileWizardPage.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 ,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.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.core.internal.util.FacetModuleCoreSupport;
-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;
-
-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) {
- boolean is = FacetModuleCoreSupport.isDynamicWebProject(project);
- return is;
- }
-
- /**
- * 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 = FacetModuleCoreSupport.getWebContentRootPath(project);
- 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 edde79b2c1..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPTemplatesWizardPage.java
+++ /dev/null
@@ -1,505 +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 org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
-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;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-
-/**
- * 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) {
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return baseConfiguration.getConfiguredContentTypes(sourceViewer);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
- }
- };
- SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSP);
- IDocument document = scratchModel.getStructuredDocument();
- viewer.configure(sourceViewerConfiguration);
- 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 7db40e24cb..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewJSPWizard.java
+++ /dev/null
@@ -1,164 +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.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.resources.ProjectScope;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-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.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-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;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-public class NewJSPWizard extends Wizard implements INewWizard {
- private NewJSPFileWizardPage fNewFilePage;
- private NewJSPTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- private boolean fShouldOpenEditorOnFinish = true;
- private Display fDisplay;
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248424
- public void setOpenEditorOnFinish(boolean openEditor) {
- this.fShouldOpenEditorOnFinish = openEditor;
- }
-
- 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);
- }
-
- private String applyLineDelimiter(IFile file, String text) {
- String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
- String convertedText = StringUtils.replace(text, "\r\n", "\n");
- convertedText = StringUtils.replace(convertedText, "\r", "\n");
- convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
- return convertedText;
- }
-
- public void createPageControls(Composite pageContainer) {
- fDisplay = pageContainer.getDisplay();
- super.createPageControls(pageContainer);
- }
-
- 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) {
- fDisplay.asyncExec(new Runnable() {
- public void run() {
- if (!PlatformUI.isWorkbenchRunning())
- return;
- 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) {
- templateString = applyLineDelimiter(file, templateString);
- // 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
- if (fShouldOpenEditorOnFinish)
- 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/internal/wizard/NewTagFileWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagFileWizardPage.java
deleted file mode 100644
index d0bcb46d2b..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagFileWizardPage.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 ,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.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.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
-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;
-
-class NewTagFileWizardPage extends WizardNewFileCreationPage {
-
- private IContentType fContentType;
- private List fValidExtensions = null;
-
- public NewTagFileWizardPage(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).append("/WEB-INF/tags");
- 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 = "tag";//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_JSPTAG);
- 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
- */
- boolean isDynamicWebProject(IProject project) {
- boolean is = FacetModuleCoreSupport.isDynamicWebProject(project);
- return is;
- }
-
- /**
- * 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 = FacetModuleCoreSupport.getWebContentRootPath(project);
- return path;
- }
-}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
deleted file mode 100644
index 0accc3332f..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagTemplatesWizardPage.java
+++ /dev/null
@@ -1,505 +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.jst.jsp.ui.internal.wizard;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-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.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
-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;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
-
-/**
- * Templates page in new file wizard. Allows users to select a new file
- * template to be applied in new file.
- *
- */
-public class NewTagTemplatesWizardPage 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_TAG);
- }
-
- /*
- * @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 NewTagTemplatesWizardPage() {
- super("NewJSPTemplatesWizardPage", JSPUIMessages.NewTagTemplatesWizardPage_0, null); //$NON-NLS-1$
- setDescription(JSPUIMessages.NewTagTemplatesWizardPage_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.NewTagTemplatesWizardPage_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.NewTagTemplatesWizardPage_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.NewTagTemplatesWizardPage_2);
-
- TableColumn column2 = new TableColumn(table, SWT.NONE);
- column2.setText(JSPUIMessages.NewTagTemplatesWizardPage_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) {
- SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
- StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationJSP();
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- return baseConfiguration.getConfiguredContentTypes(sourceViewer);
- }
-
- public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
- return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
- }
- };
- SourceViewer viewer = new StructuredTextViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- ((StructuredTextViewer) viewer).getTextWidget().setFont(JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
- IStructuredModel scratchModel = StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
- IDocument document = scratchModel.getStructuredDocument();
- viewer.configure(sourceViewerConfiguration);
- viewer.setDocument(document);
- return viewer;
- }
-
- private SourceViewer doCreateViewer(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(JSPUIMessages.NewTagTemplatesWizardPage_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/NewTagWizard.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagWizard.java
deleted file mode 100644
index 382714c93c..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/wizard/NewTagWizard.java
+++ /dev/null
@@ -1,146 +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.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.resources.ProjectScope;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-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;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-public class NewTagWizard extends Wizard implements INewWizard {
- private NewTagFileWizardPage fNewFilePage;
- private NewTagTemplatesWizardPage fNewFileTemplatesPage;
- private IStructuredSelection fSelection;
-
- public void addPages() {
- fNewFilePage = new NewTagFileWizardPage("TagWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))); //$NON-NLS-1$
- fNewFilePage.setTitle(JSPUIMessages._UI_WIZARD_TAG_NEW_HEADING);
- fNewFilePage.setDescription(JSPUIMessages._UI_WIZARD_TAG_NEW_DESCRIPTION);
- addPage(fNewFilePage);
-
- fNewFileTemplatesPage = new NewTagTemplatesWizardPage();
- addPage(fNewFileTemplatesPage);
- }
-
- private String applyLineDelimiter(IFile file, String text) {
- String lineDelimiter = Platform.getPreferencesService().getString(Platform.PI_RUNTIME, Platform.PREF_LINE_SEPARATOR, System.getProperty("line.separator"), new IScopeContext[] {new ProjectScope(file.getProject()), new InstanceScope() });//$NON-NLS-1$
- String convertedText = StringUtils.replace(text, "\r\n", "\n");
- convertedText = StringUtils.replace(convertedText, "\r", "\n");
- convertedText = StringUtils.replace(convertedText, "\n", lineDelimiter);
- return convertedText;
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- fSelection = aSelection;
- setWindowTitle(JSPUIMessages._UI_WIZARD_TAG_NEW_TITLE);
-
- ImageDescriptor descriptor = JSPEditorPluginImageHelper.getInstance().getImageDescriptor(JSPEditorPluginImages.IMG_OBJ_WIZBAN_NEWTAGFILE);
- 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) {
- templateString = applyLineDelimiter(file, templateString);
- // 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 Tag 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 3146f83ebe..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.properties
+++ /dev/null
@@ -1,60 +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
-###############################################################################
-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="${cursor}" prefix="" %>
-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>
-
-Templates.jsptagdirective.name=Tag file tag directive
-Templates.jsptagdirective.desc=Tag file tag directive
-Templates.jsptagdirective.content=<%@ tag display-name="${cursor}" description="" small-icon="" %>
-
-Templates.jspvariabledirective.name=Tag variable directive
-Templates.jspvariabledirective.desc=Tag variable directive
-Templates.jspvariabledirective.content=<%@ variable variable-class="${cursor}" description="" %>
-
-Templates.jspattributedirective.name=Tag attribute directive
-Templates.jspattributedirective.desc=Tag attribute directive
-Templates.jspattributedirective.content=<%@ attribute name="${cursor}" description="" required="false" type="" %>
-
-Templates.simpletag.name=New Tag File
-Templates.simpletag.desc=New JSP Tag File
-Templates.simpletag.content=<%@ tag language="java" pageEncoding="${encoding}"%>\n
-
-Templates.simpletagx.name=New TagX File
-Templates.simpletagx.desc=New JSP TagX File
-Templates.simpletagx.content=<jsp:directive.tag language="java" pageEncoding="${encoding}">\n
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 d318d24bef..0000000000
--- a/bundles/org.eclipse.jst.jsp.ui/templates/jspdefault-templates.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*******************************************************************************
- * 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
- *******************************************************************************/
- -->
-<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>
-
-<template name="%Templates.jsptagdirective.name" description="%Templates.jsptagdirective.desc" id="org.eclipse.jst.jsp.ui.templates.jsptagdirective" context="jsp_tag" enabled="true">%Templates.jsptagdirective.content</template>
-
-<template name="%Templates.jspvariabledirective.name" description="%Templates.jspvariabledirective.desc" id="org.eclipse.jst.jsp.ui.templates.jspvariabledirective" context="jsp_tag" enabled="true">%Templates.jspvariabledirective.content</template>
-
-<template name="%Templates.jspattributedirective.name" description="%Templates.jspattributedirective.desc" id="org.eclipse.jst.jsp.ui.templates.jspattributedirective" context="jsp_tag" enabled="true">%Templates.jspattributedirective.content</template>
-
-<template name="%Templates.simpletag.name" description="%Templates.simpletag.desc" id="org.eclipse.jst.jsp.ui.templates.simpletag" context="tag_new" enabled="true">%Templates.simpletag.content</template>
-
-<template name="%Templates.simpletagx.name" description="%Templates.simpletagx.desc" id="org.eclipse.jst.jsp.ui.templates.simpletagx" context="tag_new" enabled="true">%Templates.simpletagx.content</template>
-
-</templates>
diff --git a/bundles/org.eclipse.wst.css.core/.classpath b/bundles/org.eclipse.wst.css.core/.classpath
deleted file mode 100644
index c34f122f70..0000000000
--- a/bundles/org.eclipse.wst.css.core/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/w3c/dom/css/**/*"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/sse/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/xml/core/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.wst.css.core/.cvsignore b/bundles/org.eclipse.wst.css.core/.cvsignore
deleted file mode 100644
index eabf67a22a..0000000000
--- a/bundles/org.eclipse.wst.css.core/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-bin
-temp.folder
-cssmodel.jar
-build.xml
-dev.properties
-@dot
-src.zip
-javaCompiler...args
diff --git a/bundles/org.eclipse.wst.css.core/.options b/bundles/org.eclipse.wst.css.core/.options
deleted file mode 100644
index 490975b210..0000000000
--- a/bundles/org.eclipse.wst.css.core/.options
+++ /dev/null
@@ -1,2 +0,0 @@
-org.eclipse.wst.css.core/debug=true
-org.eclipse.wst.css.core/debug/tracefilter= \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/.project b/bundles/org.eclipse.wst.css.core/.project
deleted file mode 100644
index bb046e9d84..0000000000
--- a/bundles/org.eclipse.wst.css.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.css.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index afa5c91352..0000000000
--- a/bundles/org.eclipse.wst.css.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.css.core/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 7ec5750225..0000000000
--- a/bundles/org.eclipse.wst.css.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.css.core/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b9dc209ec9..0000000000
--- a/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,81 +0,0 @@
-#Wed Mar 28 03:13:52 EDT 2007
-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.fallthroughCase=ignore
-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=ignore
-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.nullReference=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.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.css.core/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 301c7adde6..0000000000
--- a/bundles/org.eclipse.wst.css.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.css.core/.settings/org.eclipse.ltk.core.refactoring.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.ltk.core.refactoring.prefs
deleted file mode 100644
index c59368c5e1..0000000000
--- a/bundles/org.eclipse.wst.css.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.css.core/.settings/org.eclipse.pde.prefs b/bundles/org.eclipse.wst.css.core/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index fc522bba76..0000000000
--- a/bundles/org.eclipse.wst.css.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.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
deleted file mode 100644
index da6bf28302..0000000000
--- a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,45 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.css.core; singleton:=true
-Bundle-Version: 1.1.210.qualifier
-Bundle-Activator: org.eclipse.wst.css.core.internal.CSSCorePlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.css.core.internal;x-friends:="org.eclipse.wst.css.ui",
- org.eclipse.wst.css.core.internal.cleanup;x-internal:=true,
- org.eclipse.wst.css.core.internal.contentmodel;x-internal:=true,
- org.eclipse.wst.css.core.internal.contentproperties;x-internal:=true,
- org.eclipse.wst.css.core.internal.contenttype;x-internal:=true,
- org.eclipse.wst.css.core.internal.document;x-internal:=true,
- org.eclipse.wst.css.core.internal.encoding;x-internal:=true,
- org.eclipse.wst.css.core.internal.event;x-internal:=true,
- org.eclipse.wst.css.core.internal.eventimpl;x-internal:=true,
- org.eclipse.wst.css.core.internal.format;x-friends:="org.eclipse.wst.css.ui",
- org.eclipse.wst.css.core.internal.formatter;x-internal:=true,
- org.eclipse.wst.css.core.internal.metamodel;x-internal:=true,
- org.eclipse.wst.css.core.internal.metamodel.util;x-friends:="org.eclipse.wst.css.ui",
- org.eclipse.wst.css.core.internal.metamodelimpl;x-internal:=true,
- org.eclipse.wst.css.core.internal.modelhandler;x-internal:=true,
- org.eclipse.wst.css.core.internal.parser;x-internal:=true,
- org.eclipse.wst.css.core.internal.parser.regions;x-internal:=true,
- org.eclipse.wst.css.core.internal.parserz;x-friends:="org.eclipse.wst.css.ui",
- org.eclipse.wst.css.core.internal.preferences;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.adapters;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.contenttype;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.document;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.preferences;x-internal:=true,
- org.eclipse.wst.css.core.internal.provisional.text;x-internal:=true,
- org.eclipse.wst.css.core.internal.tasks;x-internal:=true,
- org.eclipse.wst.css.core.internal.text;x-internal:=true,
- org.eclipse.wst.css.core.internal.util;x-friends:="org.eclipse.wst.css.ui",
- org.eclipse.wst.css.core.internal.util.declaration;x-internal:=true,
- org.eclipse.wst.css.core.text
-Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)";visibility:=reexport,
- org.eclipse.wst.xml.core;bundle-version="[1.1.308,1.2.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.304,1.2.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)"
-Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.wst.css.core.internal.contenttype"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.wst.css.core/about.html b/bundles/org.eclipse.wst.css.core/about.html
deleted file mode 100644
index 2199df3f05..0000000000
--- a/bundles/org.eclipse.wst.css.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>June, 2008</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.css.core/build.properties b/bundles/org.eclipse.wst.css.core/build.properties
deleted file mode 100644
index fba2831fb0..0000000000
--- a/bundles/org.eclipse.wst.css.core/build.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-bin.includes = plugin.xml,\
- cssprofile/,\
- .options,\
- 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.css.core/component.xml b/bundles/org.eclipse.wst.css.core/component.xml
deleted file mode 100644
index 476033a362..0000000000
--- a/bundles/org.eclipse.wst.css.core/component.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.wst.css">
- <description url="http://eclipse.org/webtools/wst/components/css/overview.html"></description>
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.wst.css.core" fragment="false" />
- <plugin id="org.eclipse.wst.css.ui" fragment="false" />
- <package name="org.eclipse.wst.css.ui.views.properties" api="false">
- <type name="CSSPropertySheetConfiguration" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.css.ui" api="false">
- <type name="StructuredTextViewerConfigurationCSS" subclass="true" instantiate="true" />
- </package>
- <package name="org.eclipse.wst.css.ui.views.contentoutline" api="false">
- <type name="CSSContentOutlineConfiguration" subclass="true" instantiate="true" />
- </package>
-</component> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd b/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd
deleted file mode 100644
index feb3ef8d8d..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/css-profile.dtd
+++ /dev/null
@@ -1,143 +0,0 @@
-<!-- DTD for CSS Meta Model Profile -->
-<!--
-/*******************************************************************************
- * 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
- *******************************************************************************/
- -->
-<!-- Entities -->
-
-<!-- name-definition : In defining meta model object, object name -->
-<!-- is given by using this attribute. -->
-
-<!ENTITY % name-definition 'name CDATA #REQUIRED' >
-
-<!-- name-reference : used to refer meta model object that defined -->
-<!-- by name-definition -->
-
-<!ENTITY % name-reference 'name CDATA #REQUIRED' >
-
-<!-- availability : CSS Meta Model Profile permit importing -->
-<!-- other profile and describe difference for it. -->
-
-<!ENTITY % availability 'enabled (true | false) "true"' >
-<!ENTITY % overwrite 'overwrite (true | false) "false"' >
-
-<!-- ******************** -->
-<!-- elments/attributes -->
-<!-- ******************** -->
-
-<!ELEMENT css-profile (profile-import? , (stylesheet-def | charset-rule-def | import-rule-def | page-rule-def | media-rule-def | fontface-rule-def | style-rule-def | property-def | descriptor-def | container-def | function-def | number-def | unit-def | keyword-def | category-def | pseudo-element-def | pseudo-class-def)*) >
-
-<!-- a profile can include other profile -->
-
-<!ELEMENT profile-import EMPTY >
-<!ATTLIST profile-import name CDATA #REQUIRED >
-
-<!-- which type of rule can be used? -->
-
-<!ELEMENT stylesheet-def (description? , (charset-rule | import-rule | page-rule | media-rule | fontface-rule | style-rule)*) >
-<!ATTLIST stylesheet-def %overwrite; >
-
-<!ELEMENT charset-rule EMPTY >
-<!ATTLIST charset-rule %availability; >
-<!ELEMENT import-rule EMPTY >
-<!ATTLIST import-rule %availability; >
-<!ELEMENT page-rule EMPTY >
-<!ATTLIST page-rule %availability; >
-<!ELEMENT media-rule EMPTY >
-<!ATTLIST media-rule %availability; >
-<!ELEMENT fontface-rule EMPTY >
-<!ATTLIST fontface-rule %availability; >
-<!ELEMENT style-rule EMPTY >
-<!ATTLIST style-rule %availability; >
-
-<!ELEMENT charset-rule-def (description?) >
-<!ATTLIST charset-rule-def %overwrite; >
-
-<!ELEMENT import-rule-def (description?) >
-<!ATTLIST import-rule-def %overwrite; >
-
-<!ELEMENT page-rule-def (description? , (property | pseudo-class)*) >
-<!ATTLIST page-rule-def %overwrite; >
-
-<!ELEMENT media-rule-def (description?) >
-<!ATTLIST media-rule-def %overwrite; >
-
-<!ELEMENT fontface-rule-def (description? , descriptor*) >
-<!ATTLIST fontface-rule-def %overwrite; >
-
-<!ELEMENT style-rule-def (description? , (property | selector-expression | pseudo-class | pseudo-element)*) >
-<!ATTLIST style-rule-def %overwrite; >
-
-<!ELEMENT selector-expression EMPTY >
-<!ATTLIST selector-expression name (descendant | child | adjacent | universal | attribute) #REQUIRED %availability; >
-
-<!ELEMENT pseudo-class EMPTY >
-<!ATTLIST pseudo-class %name-reference; %availability; >
-
-<!ELEMENT pseudo-element EMPTY >
-<!ATTLIST pseudo-element %name-reference; %availability; >
-
-<!ELEMENT pseudo-class-def (description?, selector-value) >
-<!ATTLIST pseudo-class-def %name-definition; %overwrite; >
-<!ELEMENT selector-value (#PCDATA) >
-
-<!ELEMENT pseudo-element-def (description?, selector-value) >
-<!ATTLIST pseudo-element-def %name-definition; %overwrite; >
-
-<!ELEMENT keyword-def (description? , keyword-value) >
-<!ATTLIST keyword-def %name-definition; %overwrite; >
-<!ELEMENT keyword-value (#PCDATA) >
-<!ELEMENT description (#PCDATA) >
-
-<!ELEMENT function-def (description? , function-value) >
-<!ATTLIST function-def %name-definition; %overwrite; >
-<!ELEMENT function-value (#PCDATA) >
-
-<!ELEMENT number-def (description? , unit*) >
-<!ATTLIST number-def %name-definition; %overwrite; >
-<!ELEMENT unit EMPTY >
-<!ATTLIST unit %name-reference; %availability; >
-
-<!ELEMENT unit-def (description? , unit-value) >
-<!ATTLIST unit-def %name-definition; %overwrite; >
-<!ELEMENT unit-value (#PCDATA) >
-
-<!ELEMENT container-def (description? , (number | keyword | function | container)*) >
-<!ATTLIST container-def %name-definition; %overwrite; >
-
-<!ELEMENT category-def (description?, caption) >
-<!ATTLIST category-def %name-definition; %overwrite; >
-<!ELEMENT caption (#PCDATA) >
-
-<!ELEMENT property-def (description? , (number | keyword | function | container | string | separator | property)*) >
-<!ATTLIST property-def %name-definition; %overwrite;
- inherited (yes | no | na) "na"
- mediagroup CDATA #IMPLIED
- category CDATA #IMPLIED >
-<!ELEMENT descriptor-def (description?, (number | keyword | function | container | string | separator | property)*) >
-<!ATTLIST descriptor-def %name-definition; %overwrite; >
-
-<!ELEMENT number EMPTY >
-<!ATTLIST number %name-reference; %availability; >
-<!ELEMENT keyword EMPTY >
-<!ATTLIST keyword %name-reference; %availability; >
-<!ELEMENT function EMPTY >
-<!ATTLIST function %name-reference; %availability; >
-<!ELEMENT container EMPTY >
-<!ATTLIST container %name-reference; %availability; >
-<!ELEMENT string EMPTY >
-<!ATTLIST string %name-reference; %availability; >
-<!ELEMENT separator EMPTY >
-<!ATTLIST separator name (comma | slash) #REQUIRED %availability; >
-<!ELEMENT property EMPTY >
-<!ATTLIST property %name-reference; %availability; >
-<!ELEMENT descriptor EMPTY >
-<!ATTLIST descriptor %name-reference; %availability; >
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml
deleted file mode 100644
index 20a0ee5287..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css1.xml
+++ /dev/null
@@ -1,838 +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
- *******************************************************************************/
- -->
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <stylesheet-def>
- <description>%css1.stylesheet-def.description</description>
- <import-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <import-rule-def>
- </import-rule-def>
-
- <style-rule-def>
- <selector-expression name="descendant"/>
- <pseudo-element name="first-line"/>
- <pseudo-element name="first-letter"/>
- <pseudo-class name="link"/>
- <pseudo-class name="visited"/>
- <pseudo-class name="active"/>
- <property name="background"/>
- <property name="background-attachment"/>
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-position"/>
- <property name="background-repeat"/>
- <property name="border"/>
- <property name="border-bottom"/>
- <property name="border-bottom-width"/>
- <property name="border-color"/>
- <property name="border-left"/>
- <property name="border-left-width"/>
- <property name="border-right"/>
- <property name="border-right-width"/>
- <property name="border-style"/>
- <property name="border-top"/>
- <property name="border-top-width"/>
- <property name="border-width"/>
- <property name="clear"/>
- <property name="color"/>
- <property name="display"/>
- <property name="float"/>
- <property name="font"/>
- <property name="font-family"/>
- <property name="font-size"/>
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="height"/>
- <property name="letter-spacing"/>
- <property name="line-height"/>
- <property name="list-style"/>
- <property name="list-style-image"/>
- <property name="list-style-position"/>
- <property name="list-style-type"/>
- <property name="margin"/>
- <property name="margin-bottom"/>
- <property name="margin-left"/>
- <property name="margin-right"/>
- <property name="margin-top"/>
- <property name="padding"/>
- <property name="padding-bottom"/>
- <property name="padding-left"/>
- <property name="padding-right"/>
- <property name="padding-top"/>
- <property name="text-align"/>
- <property name="text-decoration"/>
- <property name="text-indent"/>
- <property name="text-transform"/>
- <property name="vertical-align"/>
- <property name="white-space"/>
- <property name="width"/>
- <property name="word-spacing"/>
- </style-rule-def>
-
- <pseudo-class-def name="link">
- <selector-value>link</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="visited">
- <selector-value>visited</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="active">
- <selector-value>active</selector-value>
- </pseudo-class-def>
-
- <pseudo-element-def name="first-line">
- <selector-value>first-line</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="first-letter">
- <selector-value>first-letter</selector-value>
- </pseudo-element-def>
-
- <!-- property definition -->
-
- <property-def name="background" inherited="no" category="colorandbackground">
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-repeat"/>
- <property name="background-attachment"/>
- <property name="background-position"/>
- </property-def>
- <property-def name="background-attachment" inherited="no" category="colorandbackground">
- <keyword name="scroll"/>
- <keyword name="fixed"/>
- </property-def>
- <property-def name="background-color" inherited="no" category="colorandbackground">
- <container name="color"/>
- <keyword name="transparent"/>
- </property-def>
- <property-def name="background-image" inherited="no" category="colorandbackground">
- <function name="uri"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="background-position" inherited="no" category="colorandbackground">
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="top"/>
- <keyword name="center"/>
- <keyword name="bottom"/>
- <keyword name="left"/>
- <keyword name="right"/>
- </property-def>
- <property-def name="background-repeat" inherited="no" category="colorandbackground">
- <keyword name="repeat"/>
- <keyword name="repeat-x"/>
- <keyword name="repeat-y"/>
- <keyword name="no-repeat"/>
- </property-def>
- <property-def name="border" inherited="no" category="box">
- <property name="border-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-color" inherited="no" category="box">
- <container name="color"/>
- </property-def>
- <property-def name="border-style" inherited="no" category="box">
- <keyword name="none"/>
- <keyword name="dotted"/>
- <keyword name="dashed"/>
- <keyword name="solid"/>
- <keyword name="double"/>
- <keyword name="groove"/>
- <keyword name="ridge"/>
- <keyword name="inset"/>
- <keyword name="outset"/>
- </property-def>
- <property-def name="border-top" inherited="no" category="box">
- <property name="border-top-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-right" inherited="no" category="box">
- <property name="border-right-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-bottom" inherited="no" category="box">
- <property name="border-bottom-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-left" inherited="no" category="box">
- <property name="border-left-width"/>
- <property name="border-style"/>
- <container name="color"/>
- </property-def>
- <property-def name="border-top-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-right-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-bottom-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-left-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="border-width" inherited="no" category="box">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </property-def>
- <property-def name="clear" inherited="no" category="box">
- <keyword name="none"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="both"/>
- </property-def>
- <property-def name="color" inherited="yes" category="colorandbackground">
- <container name="color"/>
- </property-def>
- <property-def name="display" inherited="no" category="classification">
- <keyword name="block"/>
- <keyword name="inline"/>
- <keyword name="list-item"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="float" inherited="no" category="box">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="font"
- inherited="yes" category="font">
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="font-size"/>
- <property name="line-height"/>
- <property name="font-family"/>
- <separator name="slash"/>
- </property-def>
- <property-def name="font-family" inherited="yes" category="font">
- <string name="family-name"/>
- <container name="generic-family"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="font-size" inherited="yes" category="font">
- <container name="absolute-size"/>
- <container name="relative-size"/>
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="font-style" inherited="yes" category="font">
- <keyword name="normal"/>
- <keyword name="italic"/>
- <keyword name="oblique"/>
- </property-def>
- <property-def name="font-variant" inherited="yes" category="font">
- <keyword name="normal"/>
- <keyword name="small-caps"/>
- </property-def>
- <property-def name="font-weight" inherited="yes" category="font">
- <keyword name="normal"/>
- <keyword name="bold"/>
- <keyword name="bolder"/>
- <keyword name="lighter"/>
- <keyword name="100"/>
- <keyword name="200"/>
- <keyword name="300"/>
- <keyword name="400"/>
- <keyword name="500"/>
- <keyword name="600"/>
- <keyword name="700"/>
- <keyword name="800"/>
- <keyword name="900"/>
- </property-def>
- <property-def name="height" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="letter-spacing" inherited="yes" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- </property-def>
- <property-def name="line-height" inherited="yes" category="text">
- <keyword name="normal"/>
- <number name="number"/>
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="list-style" inherited="yes" category="classification">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- <keyword name="inside"/>
- <keyword name="outside"/>
- <function name="uri"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-image" inherited="yes" category="classification">
- <function name="uri"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-position" inherited="yes" category="classification">
- <keyword name="inside"/>
- <keyword name="outside"/>
- </property-def>
- <property-def name="list-style-type" inherited="yes" category="classification">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="margin" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-top" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-right" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-bottom" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="margin-left" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="padding" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-top" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-right" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-bottom" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="padding-left" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="text-align" inherited="yes" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- </property-def>
- <property-def name="text-decoration" inherited="no" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="overline"/>
- <keyword name="line-through"/>
- <keyword name="blink"/>
- </property-def>
- <property-def name="text-indent" inherited="yes" category="text">
- <number name="length"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="text-transform" inherited="yes" category="text">
- <keyword name="capitalize"/>
- <keyword name="uppercase"/>
- <keyword name="lowercase"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="vertical-align" inherited="no" category="text">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="top"/>
- <keyword name="text-top"/>
- <keyword name="middle"/>
- <keyword name="bottom"/>
- <keyword name="text-bottom"/>
- <number name="percentage"/>
- </property-def>
- <property-def name="white-space" inherited="yes" category="classification">
- <keyword name="normal"/>
- <keyword name="pre"/>
- <keyword name="nowrap"/>
- </property-def>
- <property-def name="width" inherited="no" category="box">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="word-spacing" inherited="yes" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- </property-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="absolute-size">
- <keyword name="xx-small"/>
- <keyword name="x-small"/>
- <keyword name="small"/>
- <keyword name="medium"/>
- <keyword name="large"/>
- <keyword name="x-large"/>
- <keyword name="xx-large"/>
- </container-def>
- <container-def name="color">
- <keyword name="aqua"/>
- <keyword name="black"/>
- <keyword name="blue"/>
- <keyword name="fuchsia"/>
- <keyword name="gray"/>
- <keyword name="green"/>
- <keyword name="lime"/>
- <keyword name="maroon"/>
- <keyword name="navy"/>
- <keyword name="olive"/>
- <keyword name="purple"/>
- <keyword name="red"/>
- <keyword name="silver"/>
- <keyword name="teal"/>
- <keyword name="white"/>
- <keyword name="yellow"/>
- <function name="rgb"/>
- <number name="hash"/>
- </container-def>
- <container-def name="generic-family">
- <keyword name="serif"/>
- <keyword name="sans-serif"/>
- <keyword name="cursive"/>
- <keyword name="fantasy"/>
- <keyword name="monospace"/>
- </container-def>
- <container-def name="relative-size">
- <keyword name="smaller"/>
- <keyword name="larger"/>
- </container-def>
-
- <!-- category definition : This is used to categorize properties
- in Properties View. -->
- <category-def name="box">
- <caption>%css1.category-def.box.caption</caption>
- </category-def>
- <category-def name="colorandbackground">
- <caption>%css1.category-def.colorandbackground.caption</caption>
- </category-def>
- <category-def name="classification">
- <caption>%css1.category-def.classification.caption</caption>
- </category-def>
- <category-def name="font">
- <caption>%css1.category-def.font.caption</caption>
- </category-def>
- <category-def name="text">
- <caption>%css1.category-def.text.caption</caption>
- </category-def>
-
- <function-def name="rgb">
- <function-value>rgb</function-value>
- </function-def>
- <function-def name="uri">
- <function-value>url</function-value>
- </function-def>
-
- <!-- number definition : What unit types be acceptable for each
- number type? -->
- <number-def name="hash">
- <unit name="hash"/>
- </number-def>
- <number-def name="length">
- <unit name="em"/>
- <unit name="ex"/>
- <unit name="px"/>
- <unit name="in"/>
- <unit name="cm"/>
- <unit name="mm"/>
- <unit name="pt"/>
- <unit name="pc"/>
- </number-def>
- <number-def name="number">
- </number-def>
- <number-def name="percentage">
- <unit name="percentage"/>
- </number-def>
-
- <unit-def name="cm">
- <unit-value>cm</unit-value>
- </unit-def>
- <unit-def name="em">
- <unit-value>em</unit-value>
- </unit-def>
- <unit-def name="ex">
- <unit-value>ex</unit-value>
- </unit-def>
- <unit-def name="hash">
- <unit-value>#</unit-value>
- </unit-def>
- <unit-def name="in">
- <unit-value>in</unit-value>
- </unit-def>
- <unit-def name="mm">
- <unit-value>mm</unit-value>
- </unit-def>
- <unit-def name="pc">
- <unit-value>pc</unit-value>
- </unit-def>
- <unit-def name="percentage">
- <unit-value>%</unit-value>
- </unit-def>
- <unit-def name="pt">
- <unit-value>pt</unit-value>
- </unit-def>
- <unit-def name="px">
- <unit-value>px</unit-value>
- </unit-def>
-
- <!-- keywords : string constants (this is last part..) -->
- <keyword-def name="100">
- <keyword-value>100</keyword-value>
- </keyword-def>
- <keyword-def name="200">
- <keyword-value>200</keyword-value>
- </keyword-def>
- <keyword-def name="300">
- <keyword-value>300</keyword-value>
- </keyword-def>
- <keyword-def name="400">
- <keyword-value>400</keyword-value>
- </keyword-def>
- <keyword-def name="500">
- <keyword-value>500</keyword-value>
- </keyword-def>
- <keyword-def name="600">
- <keyword-value>600</keyword-value>
- </keyword-def>
- <keyword-def name="700">
- <keyword-value>700</keyword-value>
- </keyword-def>
- <keyword-def name="800">
- <keyword-value>800</keyword-value>
- </keyword-def>
- <keyword-def name="900">
- <keyword-value>900</keyword-value>
- </keyword-def>
- <keyword-def name="aqua">
- <keyword-value>aqua</keyword-value>
- </keyword-def>
- <keyword-def name="auto">
- <keyword-value>auto</keyword-value>
- </keyword-def>
- <keyword-def name="baseline">
- <keyword-value>baseline</keyword-value>
- </keyword-def>
- <keyword-def name="black">
- <keyword-value>black</keyword-value>
- </keyword-def>
- <keyword-def name="blink">
- <keyword-value>blink</keyword-value>
- </keyword-def>
- <keyword-def name="block">
- <keyword-value>block</keyword-value>
- </keyword-def>
- <keyword-def name="blue">
- <keyword-value>blue</keyword-value>
- </keyword-def>
- <keyword-def name="bold">
- <keyword-value>bold</keyword-value>
- </keyword-def>
- <keyword-def name="bolder">
- <keyword-value>bolder</keyword-value>
- </keyword-def>
- <keyword-def name="both">
- <keyword-value>both</keyword-value>
- </keyword-def>
- <keyword-def name="bottom">
- <keyword-value>bottom</keyword-value>
- </keyword-def>
- <keyword-def name="capitalize">
- <keyword-value>capitalize</keyword-value>
- </keyword-def>
- <keyword-def name="center">
- <keyword-value>center</keyword-value>
- </keyword-def>
- <keyword-def name="circle">
- <keyword-value>circle</keyword-value>
- </keyword-def>
- <keyword-def name="cursive">
- <keyword-value>cursive</keyword-value>
- </keyword-def>
- <keyword-def name="dashed">
- <keyword-value>dashed</keyword-value>
- </keyword-def>
- <keyword-def name="decimal">
- <keyword-value>decimal</keyword-value>
- </keyword-def>
- <keyword-def name="disc">
- <keyword-value>disc</keyword-value>
- </keyword-def>
- <keyword-def name="dotted">
- <keyword-value>dotted</keyword-value>
- </keyword-def>
- <keyword-def name="double">
- <keyword-value>double</keyword-value>
- </keyword-def>
- <keyword-def name="fantasy">
- <keyword-value>fantasy</keyword-value>
- </keyword-def>
- <keyword-def name="fixed">
- <keyword-value>fixed</keyword-value>
- </keyword-def>
- <keyword-def name="fuchsia">
- <keyword-value>fuchsia</keyword-value>
- </keyword-def>
- <keyword-def name="gray">
- <keyword-value>gray</keyword-value>
- </keyword-def>
- <keyword-def name="green">
- <keyword-value>green</keyword-value>
- </keyword-def>
- <keyword-def name="groove">
- <keyword-value>groove</keyword-value>
- </keyword-def>
- <keyword-def name="inline">
- <keyword-value>inline</keyword-value>
- </keyword-def>
- <keyword-def name="inset">
- <keyword-value>inset</keyword-value>
- </keyword-def>
- <keyword-def name="inside">
- <keyword-value>inside</keyword-value>
- </keyword-def>
- <keyword-def name="italic">
- <keyword-value>italic</keyword-value>
- </keyword-def>
- <keyword-def name="justify">
- <keyword-value>justify</keyword-value>
- </keyword-def>
- <keyword-def name="large">
- <keyword-value>large</keyword-value>
- </keyword-def>
- <keyword-def name="larger">
- <keyword-value>larger</keyword-value>
- </keyword-def>
- <keyword-def name="left">
- <keyword-value>left</keyword-value>
- </keyword-def>
- <keyword-def name="lighter">
- <keyword-value>lighter</keyword-value>
- </keyword-def>
- <keyword-def name="lime">
- <keyword-value>lime</keyword-value>
- </keyword-def>
- <keyword-def name="line-through">
- <keyword-value>line-through</keyword-value>
- </keyword-def>
- <keyword-def name="list-item">
- <keyword-value>list-item</keyword-value>
- </keyword-def>
- <keyword-def name="lower-alpha">
- <keyword-value>lower-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="lower-roman">
- <keyword-value>lower-roman</keyword-value>
- </keyword-def>
- <keyword-def name="lowercase">
- <keyword-value>lowercase</keyword-value>
- </keyword-def>
- <keyword-def name="maroon">
- <keyword-value>maroon</keyword-value>
- </keyword-def>
- <keyword-def name="medium">
- <keyword-value>medium</keyword-value>
- </keyword-def>
- <keyword-def name="middle">
- <keyword-value>middle</keyword-value>
- </keyword-def>
- <keyword-def name="monospace">
- <keyword-value>monospace</keyword-value>
- </keyword-def>
- <keyword-def name="navy">
- <keyword-value>navy</keyword-value>
- </keyword-def>
- <keyword-def name="no-repeat">
- <keyword-value>no-repeat</keyword-value>
- </keyword-def>
- <keyword-def name="none">
- <keyword-value>none</keyword-value>
- </keyword-def>
- <keyword-def name="normal">
- <keyword-value>normal</keyword-value>
- </keyword-def>
- <keyword-def name="nowrap">
- <keyword-value>nowrap</keyword-value>
- </keyword-def>
- <keyword-def name="oblique">
- <keyword-value>oblique</keyword-value>
- </keyword-def>
- <keyword-def name="olive">
- <keyword-value>olive</keyword-value>
- </keyword-def>
- <keyword-def name="outset">
- <keyword-value>outset</keyword-value>
- </keyword-def>
- <keyword-def name="outside">
- <keyword-value>outside</keyword-value>
- </keyword-def>
- <keyword-def name="overline">
- <keyword-value>overline</keyword-value>
- </keyword-def>
- <keyword-def name="pre">
- <keyword-value>pre</keyword-value>
- </keyword-def>
- <keyword-def name="purple">
- <keyword-value>purple</keyword-value>
- </keyword-def>
- <keyword-def name="red">
- <keyword-value>red</keyword-value>
- </keyword-def>
- <keyword-def name="repeat">
- <keyword-value>repeat</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-x">
- <keyword-value>repeat-x</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-y">
- <keyword-value>repeat-y</keyword-value>
- </keyword-def>
- <keyword-def name="ridge">
- <keyword-value>ridge</keyword-value>
- </keyword-def>
- <keyword-def name="right">
- <keyword-value>right</keyword-value>
- </keyword-def>
- <keyword-def name="sans-serif">
- <keyword-value>sans-serif</keyword-value>
- </keyword-def>
- <keyword-def name="scroll">
- <keyword-value>scroll</keyword-value>
- </keyword-def>
- <keyword-def name="serif">
- <keyword-value>serif</keyword-value>
- </keyword-def>
- <keyword-def name="silver">
- <keyword-value>silver</keyword-value>
- </keyword-def>
- <keyword-def name="small">
- <keyword-value>small</keyword-value>
- </keyword-def>
- <keyword-def name="small-caps">
- <keyword-value>small-caps</keyword-value>
- </keyword-def>
- <keyword-def name="smaller">
- <keyword-value>smaller</keyword-value>
- </keyword-def>
- <keyword-def name="solid">
- <keyword-value>solid</keyword-value>
- </keyword-def>
- <keyword-def name="square">
- <keyword-value>square</keyword-value>
- </keyword-def>
- <keyword-def name="sub">
- <keyword-value>sub</keyword-value>
- </keyword-def>
- <keyword-def name="super">
- <keyword-value>super</keyword-value>
- </keyword-def>
- <keyword-def name="teal">
- <keyword-value>teal</keyword-value>
- </keyword-def>
- <keyword-def name="text-top">
- <keyword-value>text-top</keyword-value>
- </keyword-def>
- <keyword-def name="text-bottom">
- <keyword-value>text-bottom</keyword-value>
- </keyword-def>
- <keyword-def name="thick">
- <keyword-value>thick</keyword-value>
- </keyword-def>
- <keyword-def name="thin">
- <keyword-value>thin</keyword-value>
- </keyword-def>
- <keyword-def name="top">
- <keyword-value>top</keyword-value>
- </keyword-def>
- <keyword-def name="transparent">
- <keyword-value>transparent</keyword-value>
- </keyword-def>
- <keyword-def name="underline">
- <keyword-value>underline</keyword-value>
- </keyword-def>
- <keyword-def name="upper-alpha">
- <keyword-value>upper-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="upper-roman">
- <keyword-value>upper-roman</keyword-value>
- </keyword-def>
- <keyword-def name="uppercase">
- <keyword-value>uppercase</keyword-value>
- </keyword-def>
- <keyword-def name="white">
- <keyword-value>white</keyword-value>
- </keyword-def>
- <keyword-def name="x-large">
- <keyword-value>x-large</keyword-value>
- </keyword-def>
- <keyword-def name="x-small">
- <keyword-value>x-small</keyword-value>
- </keyword-def>
- <keyword-def name="xx-small">
- <keyword-value>xx-small</keyword-value>
- </keyword-def>
- <keyword-def name="xx-large">
- <keyword-value>xx-large</keyword-value>
- </keyword-def>
- <keyword-def name="yellow">
- <keyword-value>yellow</keyword-value>
- </keyword-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
deleted file mode 100644
index a81acbec11..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-css2.xml
+++ /dev/null
@@ -1,2270 +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
- *******************************************************************************/
- -->
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <stylesheet-def>
- <description>%css2.stylesheet-def.description</description>
- <charset-rule/>
- <import-rule/>
- <page-rule/>
- <media-rule/>
- <fontface-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <charset-rule-def>
- </charset-rule-def>
- <import-rule-def>
- </import-rule-def>
- <media-rule-def>
- </media-rule-def>
-
- <page-rule-def>
- <pseudo-class name="left"/>
- <pseudo-class name="right"/>
- <pseudo-class name="first"/>
- <property name="size"/>
- <property name="marks"/>
- <property name="page-break-after"/>
- <property name="page-break-before"/>
- <property name="page-break-inside"/>
- <property name="orphans"/>
- <property name="widows"/>
- </page-rule-def>
-
- <fontface-rule-def>
- <descriptor name="ascent"/>
- <descriptor name="baseline"/>
- <descriptor name="bbox"/>
- <descriptor name="cap-height"/>
- <descriptor name="centerline"/>
- <descriptor name="definition-src"/>
- <descriptor name="descent"/>
- <descriptor name="font-family"/>
- <descriptor name="font-size"/>
- <descriptor name="font-stretch"/>
- <descriptor name="font-style"/>
- <descriptor name="font-variant"/>
- <descriptor name="font-weight"/>
- <descriptor name="mathline"/>
- <descriptor name="panose-1"/>
- <descriptor name="slope"/>
- <descriptor name="slope"/>
- <descriptor name="src"/>
- <descriptor name="stemh"/>
- <descriptor name="stemv"/>
- <descriptor name="topline"/>
- <descriptor name="unicode-range"/>
- <descriptor name="units-per-em"/>
- <descriptor name="widths"/>
- <descriptor name="x-height"/>
- </fontface-rule-def>
-
- <!-- Which properties can style rule include ? -->
-
- <style-rule-def>
- <selector-expression name="descendant"/>
- <selector-expression name="child"/>
- <selector-expression name="adjacent"/>
- <selector-expression name="universal"/>
- <selector-expression name="attribute"/>
- <pseudo-element name="first-line"/>
- <pseudo-element name="first-letter"/>
- <pseudo-element name="before"/>
- <pseudo-element name="after"/>
- <pseudo-class name="first-child"/>
- <pseudo-class name="link"/>
- <pseudo-class name="visited"/>
- <pseudo-class name="hover"/>
- <pseudo-class name="active"/>
- <pseudo-class name="focus"/>
- <pseudo-class name="lang"/>
- <property name="azimuth"/>
- <property name="background"/>
- <property name="background-attachment"/>
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-position"/>
- <property name="background-repeat"/>
- <property name="border"/>
- <property name="border-collapse"/>
- <property name="border-color"/>
- <property name="border-spacing"/>
- <property name="border-style"/>
- <property name="border-top"/>
- <property name="border-right"/>
- <property name="border-bottom"/>
- <property name="border-left"/>
- <property name="border-top-color"/>
- <property name="border-right-color"/>
- <property name="border-bottom-color"/>
- <property name="border-left-color"/>
- <property name="border-top-style"/>
- <property name="border-right-style"/>
- <property name="border-bottom-style"/>
- <property name="border-left-style"/>
- <property name="border-top-width"/>
- <property name="border-right-width"/>
- <property name="border-bottom-width"/>
- <property name="border-left-width"/>
- <property name="border-width"/>
- <property name="bottom"/>
- <property name="caption-side"/>
- <property name="clear"/>
- <property name="clip"/>
- <property name="color"/>
- <property name="content"/>
- <property name="counter-increment"/>
- <property name="counter-reset"/>
- <property name="cue"/>
- <property name="cue-after"/>
- <property name="cue-before"/>
- <property name="cursor"/>
- <property name="direction"/>
- <property name="display"/>
- <property name="elevation"/>
- <property name="empty-cells"/>
- <property name="float"/>
- <property name="font"/>
- <property name="font-family"/>
- <property name="font-size"/>
- <property name="font-size-adjust"/>
- <property name="font-stretch"/>
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="height"/>
- <property name="left"/>
- <property name="letter-spacing"/>
- <property name="line-height"/>
- <property name="list-style"/>
- <property name="list-style-image"/>
- <property name="list-style-position"/>
- <property name="list-style-type"/>
- <property name="margin"/>
- <property name="margin-top"/>
- <property name="margin-right"/>
- <property name="margin-bottom"/>
- <property name="margin-left"/>
- <property name="marker-offset"/>
- <property name="marks"/>
- <property name="max-height"/>
- <property name="max-width"/>
- <property name="min-height"/>
- <property name="min-width"/>
- <property name="orphans"/>
- <property name="outline"/>
- <property name="outline-color"/>
- <property name="outline-style"/>
- <property name="outline-width"/>
- <property name="overflow"/>
- <property name="padding"/>
- <property name="padding-top"/>
- <property name="padding-right"/>
- <property name="padding-bottom"/>
- <property name="padding-left"/>
- <property name="page"/>
- <property name="page-break-after"/>
- <property name="page-break-before"/>
- <property name="page-break-inside"/>
- <property name="pause"/>
- <property name="pause-after"/>
- <property name="pause-before"/>
- <property name="pitch"/>
- <property name="pitch-range"/>
- <property name="play-during"/>
- <property name="position"/>
- <property name="quotes"/>
- <property name="richness"/>
- <property name="right"/>
- <property name="size"/>
- <property name="speak"/>
- <property name="speak-header"/>
- <property name="speak-numeral"/>
- <property name="speak-punctuation"/>
- <property name="speech-rate"/>
- <property name="stress"/>
- <property name="table-layout"/>
- <property name="text-align"/>
- <property name="text-decoration"/>
- <property name="text-indent"/>
- <property name="text-shadow"/>
- <property name="text-transform"/>
- <property name="top"/>
- <property name="unicode-bidi"/>
- <property name="vertical-align"/>
- <property name="visibility"/>
- <property name="voice-family"/>
- <property name="volume"/>
- <property name="white-space"/>
- <property name="widows"/>
- <property name="width"/>
- <property name="word-spacing"/>
- <property name="z-index"/>
- </style-rule-def>
-
- <pseudo-class-def name="first-child">
- <selector-value>first-child</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="link">
- <selector-value>link</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="visited">
- <selector-value>visited</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="hover">
- <selector-value>hover</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="active">
- <selector-value>active</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="focus">
- <selector-value>focus</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="lang">
- <selector-value>lang</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="left">
- <selector-value>left</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="right">
- <selector-value>right</selector-value>
- </pseudo-class-def>
- <pseudo-class-def name="first">
- <selector-value>first</selector-value>
- </pseudo-class-def>
-
- <pseudo-element-def name="first-line">
- <selector-value>first-line</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="first-letter">
- <selector-value>first-letter</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="before">
- <selector-value>before</selector-value>
- </pseudo-element-def>
- <pseudo-element-def name="after">
- <selector-value>after</selector-value>
- </pseudo-element-def>
-
- <!-- property definition -->
-
- <property-def name="azimuth"
- inherited="yes" mediagroup="aural" category="aural">
- <description>This provides spatial audio property for aural
- presentation</description>
- <number name="angle"/>
- <keyword name="left-side"/>
- <keyword name="far-left"/>
- <keyword name="left"/>
- <keyword name="center-left"/>
- <keyword name="center"/>
- <keyword name="center-right"/>
- <keyword name="right"/>
- <keyword name="far-right"/>
- <keyword name="right-side"/>
- <keyword name="behind"/>
- <keyword name="leftwards"/>
- <keyword name="rightwards"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <property name="background-color"/>
- <property name="background-image"/>
- <property name="background-repeat"/>
- <property name="background-attachment"/>
- <property name="background-position"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-attachment"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <keyword name="scroll"/>
- <keyword name="fixed"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-color"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <container name="color"/>
- <keyword name="transparent"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-image"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-position"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="top"/>
- <keyword name="center"/>
- <keyword name="bottom"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="background-repeat"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <keyword name="repeat"/>
- <keyword name="repeat-x"/>
- <keyword name="repeat-y"/>
- <keyword name="no-repeat"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-collapse"
- inherited="yes" mediagroup="visual" category="tables">
- <keyword name="collapse"/>
- <keyword name="separate"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="transparent"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-spacing"
- inherited="yes" mediagroup="visual" category="tables">
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-top-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-right-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-bottom-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left"
- inherited="no" mediagroup="visual" category="box">
- <property name="border-left-width"/>
- <property name="border-style"/>
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left-color"
- inherited="no" mediagroup="visual" category="box">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left-style"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-top-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-right-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-bottom-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-left-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="border-width"
- inherited="no" mediagroup="visual" category="box">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="bottom"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="caption-side"
- inherited="yes" mediagroup="visual" category="tables">
- <keyword name="top"/>
- <keyword name="bottom"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="clear"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="none"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="both"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="clip"
- inherited="no" mediagroup="visual" category="visual">
- <container name="shape"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="color"
- inherited="yes" mediagroup="visual" category="colorandbackground">
- <container name="color"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="content"
- inherited="no" mediagroup="all" category="content">
- <string name="any"/>
- <function name="uri"/>
- <function name="counter"/>
- <function name="attr"/>
- <keyword name="open-quote"/>
- <keyword name="close-quote"/>
- <keyword name="no-open-quote"/>
- <keyword name="no-close-quote"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="counter-increment"
- inherited="no" mediagroup="all" category="content">
- <string name="counter-identifier"/>
- <number name="integer"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="counter-reset"
- inherited="no" mediagroup="all" category="content">
- <string name="counter-identifier"/>
- <number name="integer"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cue"
- inherited="no" mediagroup="aural" category="aural">
- <property name="cue-before"/>
- <property name="cue-after"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cue-after"
- inherited="no" mediagroup="aural" category="aural">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cue-before"
- inherited="no" mediagroup="aural" category="aural">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="cursor"
- inherited="yes" mediagroup="visual,interactive" category="ui">
- <function name="uri"/>
- <keyword name="auto"/>
- <keyword name="crosshair"/>
- <keyword name="default"/>
- <keyword name="pointer"/>
- <keyword name="move"/>
- <keyword name="e-resize"/>
- <keyword name="ne-resize"/>
- <keyword name="nw-resize"/>
- <keyword name="n-resize"/>
- <keyword name="se-resize"/>
- <keyword name="sw-resize"/>
- <keyword name="s-resize"/>
- <keyword name="w-resize"/>
- <keyword name="text"/>
- <keyword name="wait"/>
- <keyword name="help"/>
- <keyword name="inherit"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="direction"
- inherited="yes" mediagroup="visual" category="visual">
- <keyword name="ltr"/>
- <keyword name="rtl"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="display"
- inherited="no" mediagroup="all" category="visual">
- <keyword name="inline"/>
- <keyword name="block"/>
- <keyword name="list-item"/>
- <keyword name="run-in"/>
- <keyword name="compact"/>
- <keyword name="marker"/>
- <keyword name="table"/>
- <keyword name="inline-table"/>
- <keyword name="table-row-group"/>
- <keyword name="table-header-group"/>
- <keyword name="table-footer-group"/>
- <keyword name="table-row"/>
- <keyword name="table-column-group"/>
- <keyword name="table-column"/>
- <keyword name="table-cell"/>
- <keyword name="table-caption"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="elevation"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="angle"/>
- <keyword name="below"/>
- <keyword name="level"/>
- <keyword name="above"/>
- <keyword name="higher"/>
- <keyword name="lower"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="empty-cells"
- inherited="yes" mediagroup="visual" category="tables">
- <keyword name="show"/>
- <keyword name="hide"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="float"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font"
- inherited="yes" mediagroup="visual" category="font">
- <property name="font-style"/>
- <property name="font-variant"/>
- <property name="font-weight"/>
- <property name="font-size"/>
- <property name="line-height"/>
- <property name="font-family"/>
- <keyword name="caption"/>
- <keyword name="icon"/>
- <keyword name="menu"/>
- <keyword name="message-box"/>
- <keyword name="small-caption"/>
- <keyword name="status-bar"/>
- <keyword name="inherit"/>
- <separator name="slash"/>
- </property-def>
- <property-def name="font-family"
- inherited="yes" mediagroup="visual" category="font">
- <string name="family-name"/>
- <container name="generic-family"/>
- <keyword name="inherit"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="font-size"
- inherited="yes" mediagroup="visual" category="font">
- <container name="absolute-size"/>
- <container name="relative-size"/>
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-size-adjust"
- inherited="yes" mediagroup="visual" category="font">
- <number name="number"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-stretch"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="wider"/>
- <keyword name="narrower"/>
- <keyword name="ultra-condensed"/>
- <keyword name="extra-condensed"/>
- <keyword name="condensed"/>
- <keyword name="semi-condensed"/>
- <keyword name="semi-expanded"/>
- <keyword name="expanded"/>
- <keyword name="extra-expanded"/>
- <keyword name="ultra-expanded"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-style"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="italic"/>
- <keyword name="oblique"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-variant"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="small-caps"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="font-weight"
- inherited="yes" mediagroup="visual" category="font">
- <keyword name="normal"/>
- <keyword name="bold"/>
- <keyword name="bolder"/>
- <keyword name="lighter"/>
- <keyword name="100"/>
- <keyword name="200"/>
- <keyword name="300"/>
- <keyword name="400"/>
- <keyword name="500"/>
- <keyword name="600"/>
- <keyword name="700"/>
- <keyword name="800"/>
- <keyword name="900"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="height"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="left"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="letter-spacing"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="line-height"
- inherited="yes" mediagroup="visual" category="visual">
- <keyword name="normal"/>
- <number name="number"/>
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style"
- inherited="yes" mediagroup="visual" category="content">
- <property name="list-style-type"/>
- <property name="list-style-position"/>
- <property name="list-style-image"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style-image"
- inherited="yes" mediagroup="visual" category="content">
- <function name="uri"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style-position"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="inside"/>
- <keyword name="outside"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="list-style-type"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="decimal-leading-zero"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-greek"/>
- <keyword name="lower-alpha"/>
- <keyword name="lower-latin"/>
- <keyword name="upper-alpha"/>
- <keyword name="upper-latin"/>
- <keyword name="hebrew"/>
- <keyword name="armenian"/>
- <keyword name="georgian"/>
- <keyword name="cjk-ideographic"/>
- <keyword name="hiragana"/>
- <keyword name="katakana"/>
- <keyword name="hiragana-iroha"/>
- <keyword name="katakana-iroha"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-top"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-right"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-bottom"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="margin-left"
- inherited="no" mediagroup="visual" category="box">
- <container name="margin-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="marker-offset"
- inherited="no" mediagroup="visual" category="content">
- <number name="length"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="marks"
- inherited="na" mediagroup="visual,paged" category="page">
- <keyword name="crop"/>
- <keyword name="cross"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="max-height"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="max-width"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="min-height"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="min-width"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="orphans"
- inherited="yes" mediagroup="visual,paged" category="page">
- <number name="integer"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <property name="outline-color"/>
- <property name="outline-style"/>
- <property name="outline-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline-color"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <container name="color"/>
- <keyword name="invert"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline-style"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <container name="border-style"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="outline-width"
- inherited="no" mediagroup="visual,interactive" category="ui">
- <container name="border-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="overflow"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="visible"/>
- <keyword name="hidden"/>
- <keyword name="scroll"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-top"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-right"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-bottom"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="padding-left"
- inherited="no" mediagroup="visual" category="box">
- <container name="padding-width"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="page"
- inherited="yes" mediagroup="visual,paged" category="page">
- <string name="page-identifier"/>
- <keyword name="auto"/>
- </property-def>
- <property-def name="page-break-after"
- inherited="no" mediagroup="visual,paged" category="page">
- <keyword name="auto"/>
- <keyword name="always"/>
- <keyword name="avoid"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="page-break-before"
- inherited="no" mediagroup="visual,paged" category="page">
- <keyword name="auto"/>
- <keyword name="always"/>
- <keyword name="avoid"/>
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="page-break-inside"
- inherited="yes" mediagroup="visual,paged" category="page">
- <keyword name="avoid"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pause"
- inherited="no" mediagroup="aural" category="aural">
- <number name="time"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pause-after"
- inherited="no" mediagroup="aural" category="aural">
- <number name="time"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pause-before"
- inherited="no" mediagroup="aural" category="aural">
- <number name="time"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pitch"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="frequency"/>
- <keyword name="x-low"/>
- <keyword name="low"/>
- <keyword name="medium"/>
- <keyword name="high"/>
- <keyword name="x-high"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="pitch-range"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="play-during"
- inherited="no" mediagroup="aural" category="aural">
- <function name="uri"/>
- <keyword name="mix"/>
- <keyword name="repeat"/>
- <keyword name="auto"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="position"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="static"/>
- <keyword name="relative"/>
- <keyword name="absolute"/>
- <keyword name="fixed"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="quotes"
- inherited="yes" mediagroup="visual" category="content">
- <string name="any"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="richness"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="right"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="size"
- inherited="na" mediagroup="visual,paged" category="page">
- <number name="length"/>
- <keyword name="auto"/>
- <keyword name="portrait"/>
- <keyword name="landscape"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak"
- inherited="yes" mediagroup="aural" category="aural">
- <keyword name="normal"/>
- <keyword name="none"/>
- <keyword name="spell-out"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak-header"
- inherited="yes" mediagroup="aural" category="tables">
- <keyword name="once"/>
- <keyword name="always"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak-numeral"
- inherited="yes" mediagroup="aural" category="aural">
- <keyword name="digits"/>
- <keyword name="continuous"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speak-punctuation"
- inherited="yes" mediagroup="aural" category="aural">
- <keyword name="code"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="speech-rate"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="x-slow"/>
- <keyword name="slow"/>
- <keyword name="medium"/>
- <keyword name="fast"/>
- <keyword name="x-fast"/>
- <keyword name="faster"/>
- <keyword name="slower"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="stress"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="table-layout"
- inherited="no" mediagroup="visual" category="tables">
- <keyword name="auto"/>
- <keyword name="fixed"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-align"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- <string name="any"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-decoration"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="overline"/>
- <keyword name="line-through"/>
- <keyword name="blink"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-indent"
- inherited="yes" mediagroup="visual" category="text">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-shadow"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <container name="color"/>
- <number name="length"/>
- <keyword name="inherit"/>
- <separator name="comma"/>
- </property-def>
- <property-def name="text-transform"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="capitalize"/>
- <keyword name="uppercase"/>
- <keyword name="lowercase"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="top"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="unicode-bidi"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="normal"/>
- <keyword name="embed"/>
- <keyword name="bidi-override"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="vertical-align"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="top"/>
- <keyword name="text-top"/>
- <keyword name="middle"/>
- <keyword name="bottom"/>
- <keyword name="text-bottom"/>
- <number name="percentage"/>
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="visibility"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="visible"/>
- <keyword name="hidden"/>
- <keyword name="collapse"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="voice-family"
- inherited="yes" mediagroup="aural" category="aural">
- <string name="specific-voice"/>
- <container name="generic-voice"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="volume"
- inherited="yes" mediagroup="aural" category="aural">
- <number name="number"/>
- <number name="percentage"/>
- <keyword name="silent"/>
- <keyword name="x-soft"/>
- <keyword name="soft"/>
- <keyword name="medium"/>
- <keyword name="loud"/>
- <keyword name="x-loud"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="white-space"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="normal"/>
- <keyword name="pre"/>
- <keyword name="nowrap"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="widows"
- inherited="yes" mediagroup="visual,paged" category="page">
- <number name="integer"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="width"
- inherited="no" mediagroup="visual" category="visual">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="word-spacing"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="normal"/>
- <number name="length"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="z-index"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="auto"/>
- <number name="integer"/>
- <keyword name="inherit"/>
- </property-def>
-
- <!-- descriptor definition : These are for @font-face -->
-
- <descriptor-def name="ascent">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="baseline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="bbox">
- <number name="number"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="cap-height">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="centerline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="definition-src">
- <function name="uri"/>
- </descriptor-def>
- <descriptor-def name="descent">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="font-family">
- <string name="family-name"/>
- <container name="generic-family"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-size">
- <keyword name="all"/>
- <number name="length"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-stretch">
- <keyword name="all"/>
- <keyword name="normal"/>
- <keyword name="ultra-condensed"/>
- <keyword name="extra-condensed"/>
- <keyword name="condensed"/>
- <keyword name="semi-condensed"/>
- <keyword name="semi-expanded"/>
- <keyword name="expanded"/>
- <keyword name="extra-expanded"/>
- <keyword name="ultra-expanded"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-style">
- <keyword name="all"/>
- <keyword name="normal"/>
- <keyword name="italic"/>
- <keyword name="oblique"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-variant">
- <keyword name="normal"/>
- <keyword name="small-caps"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="font-weight">
- <keyword name="all"/>
- <keyword name="normal"/>
- <keyword name="bold"/>
- <keyword name="100"/>
- <keyword name="200"/>
- <keyword name="300"/>
- <keyword name="400"/>
- <keyword name="500"/>
- <keyword name="600"/>
- <keyword name="700"/>
- <keyword name="800"/>
- <keyword name="900"/>
- <separator name="comma"/>
- </descriptor-def>
- <descriptor-def name="mathline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="panose-1">
- <number name="integer"/>
- </descriptor-def>
- <descriptor-def name="slope">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="src">
- <function name="uri"/>
- <function name="format"/>
- <container name="font-face-name"/>
- </descriptor-def>
- <descriptor-def name="stemh">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="stemv">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="topline">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="unicode-range">
- <string name="urange"/>
- </descriptor-def>
- <descriptor-def name="units-per-em">
- <number name="number"/>
- </descriptor-def>
- <descriptor-def name="widths">
- <string name="urange"/>
- <number name="length"/>
- </descriptor-def>
- <descriptor-def name="x-height">
- <number name="number"/>
- </descriptor-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="absolute-size">
- <keyword name="xx-small"/>
- <keyword name="x-small"/>
- <keyword name="small"/>
- <keyword name="medium"/>
- <keyword name="large"/>
- <keyword name="x-large"/>
- <keyword name="xx-large"/>
- </container-def>
- <container-def name="border-style">
- <keyword name="none"/>
- <keyword name="hidden"/>
- <keyword name="dotted"/>
- <keyword name="dashed"/>
- <keyword name="solid"/>
- <keyword name="double"/>
- <keyword name="groove"/>
- <keyword name="ridge"/>
- <keyword name="inset"/>
- <keyword name="outset"/>
- </container-def>
- <container-def name="border-width">
- <keyword name="thin"/>
- <keyword name="medium"/>
- <keyword name="thick"/>
- <number name="length"/>
- </container-def>
- <container-def name="color">
- <keyword name="aqua"/>
- <keyword name="black"/>
- <keyword name="blue"/>
- <keyword name="fuchsia"/>
- <keyword name="gray"/>
- <keyword name="green"/>
- <keyword name="lime"/>
- <keyword name="maroon"/>
- <keyword name="navy"/>
- <keyword name="olive"/>
- <keyword name="purple"/>
- <keyword name="red"/>
- <keyword name="silver"/>
- <keyword name="teal"/>
- <keyword name="white"/>
- <keyword name="yellow"/>
- <container name="system-color"/>
- <function name="rgb"/>
- <number name="hash"/>
- </container-def>
- <container-def name="generic-family">
- <keyword name="serif"/>
- <keyword name="sans-serif"/>
- <keyword name="cursive"/>
- <keyword name="fantasy"/>
- <keyword name="monospace"/>
- </container-def>
- <container-def name="font-face-name">
- <function name="local"/>
- </container-def>
- <container-def name="generic-voice">
- <keyword name="male"/>
- <keyword name="female"/>
- <keyword name="child"/>
- </container-def>
- <container-def name="margin-width">
- <number name="length"/>
- <number name="percentage"/>
- <keyword name="auto"/>
- </container-def>
- <container-def name="padding-width">
- <number name="length"/>
- <number name="percentage"/>
- </container-def>
- <container-def name="relative-size">
- <keyword name="smaller"/>
- <keyword name="larger"/>
- </container-def>
- <container-def name="shape">
- <function name="rect"/>
- </container-def>
- <container-def name="system-color">
- <keyword name="ActiveBorder"/>
- <keyword name="ActiveCaption"/>
- <keyword name="AppWorkspace"/>
- <keyword name="Background"/>
- <keyword name="ButtonFace"/>
- <keyword name="ButtonHighlight"/>
- <keyword name="ButtonShadow"/>
- <keyword name="ButtonText"/>
- <keyword name="CaptionText"/>
- <keyword name="GrayText"/>
- <keyword name="Highlight"/>
- <keyword name="HighlightText"/>
- <keyword name="InactiveBorder"/>
- <keyword name="InactiveCaption"/>
- <keyword name="InactiveCaptionText"/>
- <keyword name="InfoBackground"/>
- <keyword name="InfoText"/>
- <keyword name="Menu"/>
- <keyword name="MenuText"/>
- <keyword name="Scrollbar"/>
- <keyword name="ThreeDDarkShadow"/>
- <keyword name="ThreeDFace"/>
- <keyword name="ThreeDHighlight"/>
- <keyword name="ThreeDLightShadow"/>
- <keyword name="ThreeDShadow"/>
- <keyword name="Window"/>
- <keyword name="WindowFrame"/>
- <keyword name="WindowText"/>
- </container-def>
-
- <!-- category definition : This is used to categorize properties
- in Properties View. -->
- <category-def name="aural">
- <caption>%css2.category-def.aural.caption</caption>
- </category-def>
- <category-def name="box">
- <caption>%css2.category-def.box.caption</caption>
- </category-def>
- <category-def name="colorandbackground">
- <caption>%css2.category-def.colorandbackground.caption</caption>
- </category-def>
- <category-def name="content">
- <caption>%css2.category-def.content.caption</caption>
- </category-def>
- <category-def name="font">
- <caption>%css2.category-def.font.caption</caption>
- </category-def>
- <category-def name="page">
- <caption>%css2.category-def.page.caption</caption>
- </category-def>
- <category-def name="tables">
- <caption>%css2.category-def.tables.caption</caption>
- </category-def>
- <category-def name="text">
- <caption>%css2.category-def.text.caption</caption>
- </category-def>
- <category-def name="ui">
- <caption>%css2.category-def.ui.caption</caption>
- </category-def>
- <category-def name="visual">
-<!-- <caption>%css2.category-def.visual.caption</caption>-->
- <caption>%css2.category-def.visual.caption</caption>
- </category-def>
-
- <!-- function definition -->
- <function-def name="attr">
- <function-value>attr</function-value>
- </function-def>
- <function-def name="counter">
- <function-value>counter</function-value>
- </function-def>
- <function-def name="rect">
- <function-value>rect</function-value>
- </function-def>
- <function-def name="rgb">
- <function-value>rgb</function-value>
- </function-def>
- <function-def name="uri">
- <function-value>url</function-value>
- </function-def>
- <function-def name="format">
- <function-value>format</function-value>
- </function-def>
- <function-def name="local">
- <function-value>local</function-value>
- </function-def>
-
- <!-- number definition : What unit types be acceptable for each
- number type? -->
- <number-def name="angle">
- <unit name="deg"/>
- <unit name="grad"/>
- <unit name="rad"/>
- </number-def>
- <number-def name="frequency">
- <unit name="hz"/>
- <unit name="khz"/>
- </number-def>
- <number-def name="hash">
- <unit name="hash"/>
- </number-def>
- <number-def name="integer">
- </number-def>
- <number-def name="length">
- <unit name="em"/>
- <unit name="ex"/>
- <unit name="px"/>
- <unit name="in"/>
- <unit name="cm"/>
- <unit name="mm"/>
- <unit name="pt"/>
- <unit name="pc"/>
- </number-def>
- <number-def name="number">
- </number-def>
- <number-def name="percentage">
- <unit name="percentage"/>
- </number-def>
- <number-def name="time">
- <unit name="ms"/>
- <unit name="s"/>
- </number-def>
-
- <unit-def name="cm">
- <unit-value>cm</unit-value>
- </unit-def>
- <unit-def name="deg">
- <unit-value>deg</unit-value>
- </unit-def>
- <unit-def name="em">
- <unit-value>em</unit-value>
- </unit-def>
- <unit-def name="ex">
- <unit-value>ex</unit-value>
- </unit-def>
- <unit-def name="grad">
- <unit-value>grad</unit-value>
- </unit-def>
- <unit-def name="hash">
- <unit-value>#</unit-value>
- </unit-def>
- <unit-def name="hz">
- <unit-value>Hz</unit-value>
- </unit-def>
- <unit-def name="in">
- <unit-value>in</unit-value>
- </unit-def>
- <unit-def name="khz">
- <unit-value>kHz</unit-value>
- </unit-def>
- <unit-def name="mm">
- <unit-value>mm</unit-value>
- </unit-def>
- <unit-def name="ms">
- <unit-value>ms</unit-value>
- </unit-def>
- <unit-def name="pc">
- <unit-value>pc</unit-value>
- </unit-def>
- <unit-def name="percentage">
- <unit-value>%</unit-value>
- </unit-def>
- <unit-def name="pt">
- <unit-value>pt</unit-value>
- </unit-def>
- <unit-def name="px">
- <unit-value>px</unit-value>
- </unit-def>
- <unit-def name="rad">
- <unit-value>rad</unit-value>
- </unit-def>
- <unit-def name="s">
- <unit-value>s</unit-value>
- </unit-def>
-
- <!-- keywords : string constants (this is last part..) -->
- <keyword-def name="100">
- <keyword-value>100</keyword-value>
- </keyword-def>
- <keyword-def name="200">
- <keyword-value>200</keyword-value>
- </keyword-def>
- <keyword-def name="300">
- <keyword-value>300</keyword-value>
- </keyword-def>
- <keyword-def name="400">
- <keyword-value>400</keyword-value>
- </keyword-def>
- <keyword-def name="500">
- <keyword-value>500</keyword-value>
- </keyword-def>
- <keyword-def name="600">
- <keyword-value>600</keyword-value>
- </keyword-def>
- <keyword-def name="700">
- <keyword-value>700</keyword-value>
- </keyword-def>
- <keyword-def name="800">
- <keyword-value>800</keyword-value>
- </keyword-def>
- <keyword-def name="900">
- <keyword-value>900</keyword-value>
- </keyword-def>
- <keyword-def name="above">
- <keyword-value>above</keyword-value>
- </keyword-def>
- <keyword-def name="absolute">
- <keyword-value>absolute</keyword-value>
- </keyword-def>
- <keyword-def name="ActiveBorder">
- <keyword-value>ActiveBorder</keyword-value>
- </keyword-def>
- <keyword-def name="ActiveCaption">
- <keyword-value>ActiveCaption</keyword-value>
- </keyword-def>
- <keyword-def name="all">
- <keyword-value>all</keyword-value>
- </keyword-def>
- <keyword-def name="always">
- <keyword-value>always</keyword-value>
- </keyword-def>
- <keyword-def name="AppWorkspace">
- <keyword-value>AppWorkspace</keyword-value>
- </keyword-def>
- <keyword-def name="aqua">
- <keyword-value>aqua</keyword-value>
- </keyword-def>
- <keyword-def name="armenian">
- <keyword-value>armenian</keyword-value>
- </keyword-def>
- <keyword-def name="auto">
- <keyword-value>auto</keyword-value>
- </keyword-def>
- <keyword-def name="avoid">
- <keyword-value>avoid</keyword-value>
- </keyword-def>
- <keyword-def name="Background">
- <keyword-value>Background</keyword-value>
- </keyword-def>
- <keyword-def name="baseline">
- <keyword-value>baseline</keyword-value>
- </keyword-def>
- <keyword-def name="behind">
- <keyword-value>behind</keyword-value>
- </keyword-def>
- <keyword-def name="below">
- <keyword-value>below</keyword-value>
- </keyword-def>
- <keyword-def name="bidi-override">
- <keyword-value>bidi-override</keyword-value>
- </keyword-def>
- <keyword-def name="black">
- <keyword-value>black</keyword-value>
- </keyword-def>
- <keyword-def name="blink">
- <keyword-value>blink</keyword-value>
- </keyword-def>
- <keyword-def name="block">
- <keyword-value>block</keyword-value>
- </keyword-def>
- <keyword-def name="blue">
- <keyword-value>blue</keyword-value>
- </keyword-def>
- <keyword-def name="bold">
- <keyword-value>bold</keyword-value>
- </keyword-def>
- <keyword-def name="bolder">
- <keyword-value>bolder</keyword-value>
- </keyword-def>
- <keyword-def name="both">
- <keyword-value>both</keyword-value>
- </keyword-def>
- <keyword-def name="bottom">
- <keyword-value>bottom</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonFace">
- <keyword-value>ButtonFace</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonHighlight">
- <keyword-value>ButtonHighlight</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonShadow">
- <keyword-value>ButtonShadow</keyword-value>
- </keyword-def>
- <keyword-def name="ButtonText">
- <keyword-value>ButtonText</keyword-value>
- </keyword-def>
- <keyword-def name="capitalize">
- <keyword-value>capitalize</keyword-value>
- </keyword-def>
- <keyword-def name="caption">
- <keyword-value>caption</keyword-value>
- </keyword-def>
- <keyword-def name="CaptionText">
- <keyword-value>CaptionText</keyword-value>
- </keyword-def>
- <keyword-def name="center">
- <keyword-value>center</keyword-value>
- </keyword-def>
- <keyword-def name="center-left">
- <keyword-value>center-left</keyword-value>
- </keyword-def>
- <keyword-def name="center-right">
- <keyword-value>center-right</keyword-value>
- </keyword-def>
- <keyword-def name="child">
- <keyword-value>child</keyword-value>
- </keyword-def>
- <keyword-def name="circle">
- <keyword-value>circle</keyword-value>
- </keyword-def>
- <keyword-def name="cjk-ideographic">
- <keyword-value>cjk-ideographic</keyword-value>
- </keyword-def>
- <keyword-def name="close-quote">
- <keyword-value>close-quote</keyword-value>
- </keyword-def>
- <keyword-def name="code">
- <keyword-value>code</keyword-value>
- </keyword-def>
- <keyword-def name="condensed">
- <keyword-value>condensed</keyword-value>
- </keyword-def>
- <keyword-def name="collapse">
- <keyword-value>collapse</keyword-value>
- </keyword-def>
- <keyword-def name="compact">
- <keyword-value>compact</keyword-value>
- </keyword-def>
- <keyword-def name="continuous">
- <keyword-value>continuous</keyword-value>
- </keyword-def>
- <keyword-def name="crop">
- <keyword-value>crop</keyword-value>
- </keyword-def>
- <keyword-def name="cross">
- <keyword-value>cross</keyword-value>
- </keyword-def>
- <keyword-def name="crosshair">
- <keyword-value>crosshair</keyword-value>
- </keyword-def>
- <keyword-def name="cursive">
- <keyword-value>cursive</keyword-value>
- </keyword-def>
- <keyword-def name="dashed">
- <keyword-value>dashed</keyword-value>
- </keyword-def>
- <keyword-def name="decimal">
- <keyword-value>decimal</keyword-value>
- </keyword-def>
- <keyword-def name="decimal-leading-zero">
- <keyword-value>decimal-leading-zero</keyword-value>
- </keyword-def>
- <keyword-def name="default">
- <keyword-value>default</keyword-value>
- </keyword-def>
- <keyword-def name="digits">
- <keyword-value>digits</keyword-value>
- </keyword-def>
- <keyword-def name="disc">
- <keyword-value>disc</keyword-value>
- </keyword-def>
- <keyword-def name="dotted">
- <keyword-value>dotted</keyword-value>
- </keyword-def>
- <keyword-def name="double">
- <keyword-value>double</keyword-value>
- </keyword-def>
- <keyword-def name="e-resize">
- <keyword-value>e-resize</keyword-value>
- </keyword-def>
- <keyword-def name="embed">
- <keyword-value>embed</keyword-value>
- </keyword-def>
- <keyword-def name="expanded">
- <keyword-value>expanded</keyword-value>
- </keyword-def>
- <keyword-def name="extra-condensed">
- <keyword-value>extra-condensed</keyword-value>
- </keyword-def>
- <keyword-def name="extra-expanded">
- <keyword-value>extra-expanded</keyword-value>
- </keyword-def>
- <keyword-def name="fantasy">
- <keyword-value>fantasy</keyword-value>
- </keyword-def>
- <keyword-def name="far-left">
- <keyword-value>far-left</keyword-value>
- </keyword-def>
- <keyword-def name="far-right">
- <keyword-value>far-right</keyword-value>
- </keyword-def>
- <keyword-def name="fast">
- <keyword-value>fast</keyword-value>
- </keyword-def>
- <keyword-def name="faster">
- <keyword-value>faster</keyword-value>
- </keyword-def>
- <keyword-def name="female">
- <keyword-value>female</keyword-value>
- </keyword-def>
- <keyword-def name="fixed">
- <keyword-value>fixed</keyword-value>
- </keyword-def>
- <keyword-def name="fuchsia">
- <keyword-value>fuchsia</keyword-value>
- </keyword-def>
- <keyword-def name="georgian">
- <keyword-value>georgian</keyword-value>
- </keyword-def>
- <keyword-def name="gray">
- <keyword-value>gray</keyword-value>
- </keyword-def>
- <keyword-def name="GrayText">
- <keyword-value>GrayText</keyword-value>
- </keyword-def>
- <keyword-def name="green">
- <keyword-value>green</keyword-value>
- </keyword-def>
- <keyword-def name="groove">
- <keyword-value>groove</keyword-value>
- </keyword-def>
- <keyword-def name="hebrew">
- <keyword-value>hebrew</keyword-value>
- </keyword-def>
- <keyword-def name="help">
- <keyword-value>help</keyword-value>
- </keyword-def>
- <keyword-def name="hidden">
- <keyword-value>hidden</keyword-value>
- </keyword-def>
- <keyword-def name="hide">
- <keyword-value>hide</keyword-value>
- </keyword-def>
- <keyword-def name="high">
- <keyword-value>high</keyword-value>
- </keyword-def>
- <keyword-def name="Highlight">
- <keyword-value>Highlight</keyword-value>
- </keyword-def>
- <keyword-def name="HighlightText">
- <keyword-value>HighlightText</keyword-value>
- </keyword-def>
- <keyword-def name="higher">
- <keyword-value>higher</keyword-value>
- </keyword-def>
- <keyword-def name="hiragana">
- <keyword-value>hiragana</keyword-value>
- </keyword-def>
- <keyword-def name="hiragana-iroha">
- <keyword-value>hiragana-iroha</keyword-value>
- </keyword-def>
- <keyword-def name="icon">
- <keyword-value>icon</keyword-value>
- </keyword-def>
- <keyword-def name="InactiveBorder">
- <keyword-value>InactiveBorder</keyword-value>
- </keyword-def>
- <keyword-def name="InactiveCaption">
- <keyword-value>InactiveCaption</keyword-value>
- </keyword-def>
- <keyword-def name="InactiveCaptionText">
- <keyword-value>InactiveCaptionText</keyword-value>
- </keyword-def>
- <keyword-def name="InfoBackground">
- <keyword-value>InfoBackground</keyword-value>
- </keyword-def>
- <keyword-def name="InfoText">
- <keyword-value>InfoText</keyword-value>
- </keyword-def>
- <keyword-def name="inherit">
- <keyword-value>inherit</keyword-value>
- </keyword-def>
- <keyword-def name="inline">
- <keyword-value>inline</keyword-value>
- </keyword-def>
- <keyword-def name="inline-table">
- <keyword-value>inline-table</keyword-value>
- </keyword-def>
- <keyword-def name="inset">
- <keyword-value>inset</keyword-value>
- </keyword-def>
- <keyword-def name="inside">
- <keyword-value>inside</keyword-value>
- </keyword-def>
- <keyword-def name="invert">
- <keyword-value>invert</keyword-value>
- </keyword-def>
- <keyword-def name="italic">
- <keyword-value>italic</keyword-value>
- </keyword-def>
- <keyword-def name="justify">
- <keyword-value>justify</keyword-value>
- </keyword-def>
- <keyword-def name="katakana">
- <keyword-value>katakana</keyword-value>
- </keyword-def>
- <keyword-def name="katakana-iroha">
- <keyword-value>katakana-iroha</keyword-value>
- </keyword-def>
- <keyword-def name="landscape">
- <keyword-value>landscape</keyword-value>
- </keyword-def>
- <keyword-def name="large">
- <keyword-value>large</keyword-value>
- </keyword-def>
- <keyword-def name="larger">
- <keyword-value>larger</keyword-value>
- </keyword-def>
- <keyword-def name="left">
- <keyword-value>left</keyword-value>
- </keyword-def>
- <keyword-def name="left-side">
- <keyword-value>left-side</keyword-value>
- </keyword-def>
- <keyword-def name="leftwards">
- <keyword-value>leftwards</keyword-value>
- </keyword-def>
- <keyword-def name="level">
- <keyword-value>level</keyword-value>
- </keyword-def>
- <keyword-def name="lighter">
- <keyword-value>lighter</keyword-value>
- </keyword-def>
- <keyword-def name="lime">
- <keyword-value>lime</keyword-value>
- </keyword-def>
- <keyword-def name="line-through">
- <keyword-value>line-through</keyword-value>
- </keyword-def>
- <keyword-def name="list-item">
- <keyword-value>list-item</keyword-value>
- </keyword-def>
- <keyword-def name="loud">
- <keyword-value>loud</keyword-value>
- </keyword-def>
- <keyword-def name="low">
- <keyword-value>low</keyword-value>
- </keyword-def>
- <keyword-def name="lower">
- <keyword-value>lower</keyword-value>
- </keyword-def>
- <keyword-def name="lower-alpha">
- <keyword-value>lower-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="lower-greek">
- <keyword-value>lower-greek</keyword-value>
- </keyword-def>
- <keyword-def name="lower-latin">
- <keyword-value>lower-latin</keyword-value>
- </keyword-def>
- <keyword-def name="lower-roman">
- <keyword-value>lower-roman</keyword-value>
- </keyword-def>
- <keyword-def name="lowercase">
- <keyword-value>lowercase</keyword-value>
- </keyword-def>
- <keyword-def name="ltr">
- <keyword-value>ltr</keyword-value>
- </keyword-def>
- <keyword-def name="male">
- <keyword-value>male</keyword-value>
- </keyword-def>
- <keyword-def name="marker">
- <keyword-value>marker</keyword-value>
- </keyword-def>
- <keyword-def name="maroon">
- <keyword-value>maroon</keyword-value>
- </keyword-def>
- <keyword-def name="medium">
- <keyword-value>medium</keyword-value>
- </keyword-def>
- <keyword-def name="Menu">
- <keyword-value>Menu</keyword-value>
- </keyword-def>
- <keyword-def name="MenuText">
- <keyword-value>MenuText</keyword-value>
- </keyword-def>
- <keyword-def name="message-box">
- <keyword-value>message-box</keyword-value>
- </keyword-def>
- <keyword-def name="middle">
- <keyword-value>middle</keyword-value>
- </keyword-def>
- <keyword-def name="mix">
- <keyword-value>mix</keyword-value>
- </keyword-def>
- <keyword-def name="monospace">
- <keyword-value>monospace</keyword-value>
- </keyword-def>
- <keyword-def name="move">
- <keyword-value>move</keyword-value>
- </keyword-def>
- <keyword-def name="n-resize">
- <keyword-value>n-resize</keyword-value>
- </keyword-def>
- <keyword-def name="narrower">
- <keyword-value>narrower</keyword-value>
- </keyword-def>
- <keyword-def name="navy">
- <keyword-value>navy</keyword-value>
- </keyword-def>
- <keyword-def name="ne-resize">
- <keyword-value>ne-resize</keyword-value>
- </keyword-def>
- <keyword-def name="no-close-quote">
- <keyword-value>no-close-quote</keyword-value>
- </keyword-def>
- <keyword-def name="no-open-quote">
- <keyword-value>no-open-quote</keyword-value>
- </keyword-def>
- <keyword-def name="no-repeat">
- <keyword-value>no-repeat</keyword-value>
- </keyword-def>
- <keyword-def name="none">
- <keyword-value>none</keyword-value>
- </keyword-def>
- <keyword-def name="normal">
- <keyword-value>normal</keyword-value>
- </keyword-def>
- <keyword-def name="nowrap">
- <keyword-value>nowrap</keyword-value>
- </keyword-def>
- <keyword-def name="nw-resize">
- <keyword-value>nw-resize</keyword-value>
- </keyword-def>
- <keyword-def name="oblique">
- <keyword-value>oblique</keyword-value>
- </keyword-def>
- <keyword-def name="olive">
- <keyword-value>olive</keyword-value>
- </keyword-def>
- <keyword-def name="once">
- <keyword-value>once</keyword-value>
- </keyword-def>
- <keyword-def name="open-quote">
- <keyword-value>open-quote</keyword-value>
- </keyword-def>
- <keyword-def name="outset">
- <keyword-value>outset</keyword-value>
- </keyword-def>
- <keyword-def name="outside">
- <keyword-value>outside</keyword-value>
- </keyword-def>
- <keyword-def name="overline">
- <keyword-value>overline</keyword-value>
- </keyword-def>
- <keyword-def name="pointer">
- <keyword-value>pointer</keyword-value>
- </keyword-def>
- <keyword-def name="portrait">
- <keyword-value>portrait</keyword-value>
- </keyword-def>
- <keyword-def name="pre">
- <keyword-value>pre</keyword-value>
- </keyword-def>
- <keyword-def name="purple">
- <keyword-value>purple</keyword-value>
- </keyword-def>
- <keyword-def name="red">
- <keyword-value>red</keyword-value>
- </keyword-def>
- <keyword-def name="relative">
- <keyword-value>relative</keyword-value>
- </keyword-def>
- <keyword-def name="repeat">
- <keyword-value>repeat</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-x">
- <keyword-value>repeat-x</keyword-value>
- </keyword-def>
- <keyword-def name="repeat-y">
- <keyword-value>repeat-y</keyword-value>
- </keyword-def>
- <keyword-def name="ridge">
- <keyword-value>ridge</keyword-value>
- </keyword-def>
- <keyword-def name="right">
- <keyword-value>right</keyword-value>
- </keyword-def>
- <keyword-def name="right-side">
- <keyword-value>right-side</keyword-value>
- </keyword-def>
- <keyword-def name="rightwards">
- <keyword-value>rightwards</keyword-value>
- </keyword-def>
- <keyword-def name="rtl">
- <keyword-value>rtl</keyword-value>
- </keyword-def>
- <keyword-def name="run-in">
- <keyword-value>run-in</keyword-value>
- </keyword-def>
- <keyword-def name="s-resize">
- <keyword-value>s-resize</keyword-value>
- </keyword-def>
- <keyword-def name="sans-serif">
- <keyword-value>sans-serif</keyword-value>
- </keyword-def>
- <keyword-def name="scroll">
- <keyword-value>scroll</keyword-value>
- </keyword-def>
- <keyword-def name="Scrollbar">
- <keyword-value>Scrollbar</keyword-value>
- </keyword-def>
- <keyword-def name="se-resize">
- <keyword-value>se-resize</keyword-value>
- </keyword-def>
- <keyword-def name="semi-condensed">
- <keyword-value>semi-condensed</keyword-value>
- </keyword-def>
- <keyword-def name="semi-expanded">
- <keyword-value>semi-expanded</keyword-value>
- </keyword-def>
- <keyword-def name="separate">
- <keyword-value>separate</keyword-value>
- </keyword-def>
- <keyword-def name="serif">
- <keyword-value>serif</keyword-value>
- </keyword-def>
- <keyword-def name="show">
- <keyword-value>show</keyword-value>
- </keyword-def>
- <keyword-def name="silent">
- <keyword-value>silent</keyword-value>
- </keyword-def>
- <keyword-def name="silver">
- <keyword-value>silver</keyword-value>
- </keyword-def>
- <keyword-def name="slow">
- <keyword-value>slow</keyword-value>
- </keyword-def>
- <keyword-def name="slower">
- <keyword-value>slower</keyword-value>
- </keyword-def>
- <keyword-def name="small">
- <keyword-value>small</keyword-value>
- </keyword-def>
- <keyword-def name="small-caps">
- <keyword-value>small-caps</keyword-value>
- </keyword-def>
- <keyword-def name="small-caption">
- <keyword-value>small-caption</keyword-value>
- </keyword-def>
- <keyword-def name="smaller">
- <keyword-value>smaller</keyword-value>
- </keyword-def>
- <keyword-def name="soft">
- <keyword-value>soft</keyword-value>
- </keyword-def>
- <keyword-def name="solid">
- <keyword-value>solid</keyword-value>
- </keyword-def>
- <keyword-def name="spell-out">
- <keyword-value>spell-out</keyword-value>
- </keyword-def>
- <keyword-def name="square">
- <keyword-value>square</keyword-value>
- </keyword-def>
- <keyword-def name="static">
- <keyword-value>static</keyword-value>
- </keyword-def>
- <keyword-def name="status-bar">
- <keyword-value>status-bar</keyword-value>
- </keyword-def>
- <keyword-def name="sub">
- <keyword-value>sub</keyword-value>
- </keyword-def>
- <keyword-def name="super">
- <keyword-value>super</keyword-value>
- </keyword-def>
- <keyword-def name="sw-resize">
- <keyword-value>sw-resize</keyword-value>
- </keyword-def>
- <keyword-def name="table">
- <keyword-value>table</keyword-value>
- </keyword-def>
- <keyword-def name="table-caption">
- <keyword-value>table-caption</keyword-value>
- </keyword-def>
- <keyword-def name="table-cell">
- <keyword-value>table-cell</keyword-value>
- </keyword-def>
- <keyword-def name="table-column">
- <keyword-value>table-column</keyword-value>
- </keyword-def>
- <keyword-def name="table-column-group">
- <keyword-value>table-column-group</keyword-value>
- </keyword-def>
- <keyword-def name="table-footer-group">
- <keyword-value>table-footer-group</keyword-value>
- </keyword-def>
- <keyword-def name="table-header-group">
- <keyword-value>table-header-group</keyword-value>
- </keyword-def>
- <keyword-def name="table-row">
- <keyword-value>table-row</keyword-value>
- </keyword-def>
- <keyword-def name="table-row-group">
- <keyword-value>table-row-group</keyword-value>
- </keyword-def>
- <keyword-def name="teal">
- <keyword-value>teal</keyword-value>
- </keyword-def>
- <keyword-def name="text">
- <keyword-value>text</keyword-value>
- </keyword-def>
- <keyword-def name="text-top">
- <keyword-value>text-top</keyword-value>
- </keyword-def>
- <keyword-def name="text-bottom">
- <keyword-value>text-bottom</keyword-value>
- </keyword-def>
- <keyword-def name="thick">
- <keyword-value>thick</keyword-value>
- </keyword-def>
- <keyword-def name="thin">
- <keyword-value>thin</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDDarkShadow">
- <keyword-value>ThreeDDarkShadow</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDFace">
- <keyword-value>ThreeDFace</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDHighlight">
- <keyword-value>ThreeDHighlight</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDLightShadow">
- <keyword-value>ThreeDLightShadow</keyword-value>
- </keyword-def>
- <keyword-def name="ThreeDShadow">
- <keyword-value>ThreeDShadow</keyword-value>
- </keyword-def>
- <keyword-def name="top">
- <keyword-value>top</keyword-value>
- </keyword-def>
- <keyword-def name="transparent">
- <keyword-value>transparent</keyword-value>
- </keyword-def>
- <keyword-def name="ultra-condensed">
- <keyword-value>ultra-condensed</keyword-value>
- </keyword-def>
- <keyword-def name="ultra-expanded">
- <keyword-value>ultra-expanded</keyword-value>
- </keyword-def>
- <keyword-def name="underline">
- <keyword-value>underline</keyword-value>
- </keyword-def>
- <keyword-def name="upper-alpha">
- <keyword-value>upper-alpha</keyword-value>
- </keyword-def>
- <keyword-def name="upper-latin">
- <keyword-value>upper-latin</keyword-value>
- </keyword-def>
- <keyword-def name="upper-roman">
- <keyword-value>upper-roman</keyword-value>
- </keyword-def>
- <keyword-def name="uppercase">
- <keyword-value>uppercase</keyword-value>
- </keyword-def>
- <keyword-def name="visible">
- <keyword-value>visible</keyword-value>
- </keyword-def>
- <keyword-def name="w-resize">
- <keyword-value>w-resize</keyword-value>
- </keyword-def>
- <keyword-def name="wait">
- <keyword-value>wait</keyword-value>
- </keyword-def>
- <keyword-def name="white">
- <keyword-value>white</keyword-value>
- </keyword-def>
- <keyword-def name="wider">
- <keyword-value>wider</keyword-value>
- </keyword-def>
- <keyword-def name="Window">
- <keyword-value>Window</keyword-value>
- </keyword-def>
- <keyword-def name="WindowFrame">
- <keyword-value>WindowFrame</keyword-value>
- </keyword-def>
- <keyword-def name="WindowText">
- <keyword-value>WindowText</keyword-value>
- </keyword-def>
- <keyword-def name="x-fast">
- <keyword-value>x-fast</keyword-value>
- </keyword-def>
- <keyword-def name="x-high">
- <keyword-value>x-high</keyword-value>
- </keyword-def>
- <keyword-def name="x-large">
- <keyword-value>x-large</keyword-value>
- </keyword-def>
- <keyword-def name="x-loud">
- <keyword-value>x-loud</keyword-value>
- </keyword-def>
- <keyword-def name="x-low">
- <keyword-value>x-low</keyword-value>
- </keyword-def>
- <keyword-def name="x-slow">
- <keyword-value>x-slow</keyword-value>
- </keyword-def>
- <keyword-def name="x-small">
- <keyword-value>x-small</keyword-value>
- </keyword-def>
- <keyword-def name="x-soft">
- <keyword-value>x-soft</keyword-value>
- </keyword-def>
- <keyword-def name="xx-small">
- <keyword-value>xx-small</keyword-value>
- </keyword-def>
- <keyword-def name="xx-large">
- <keyword-value>xx-large</keyword-value>
- </keyword-def>
- <keyword-def name="yellow">
- <keyword-value>yellow</keyword-value>
- </keyword-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml
deleted file mode 100644
index 2d5d761b9a..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-mobile1_0.xml
+++ /dev/null
@@ -1,158 +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
- *******************************************************************************/
- -->
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <profile-import name="cssprofile-css2.xml"/>
- <stylesheet-def>
- <description>%mobile1_0.stylesheet-def.description</description>
- <charset-rule/>
- <import-rule/>
- <media-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <!-- Which properties can style rule include ? -->
- <!-- using "overwrite" method: only disabled properties are written. -->
-
- <style-rule-def overwrite="true">
- <selector-expression name="child" enabled="false"/>
- <selector-expression name="adjacent" enabled="false"/>
- <selector-expression name="attribute" enabled="false"/>
- <pseudo-class name="first-child" enabled="false"/>
- <pseudo-class name="link" enabled="false"/>
- <pseudo-class name="active" enabled="false"/>
- <pseudo-class name="lang" enabled="false"/>
- <property name="azimuth" enabled="false"/>
- <property name="border-collapse" enabled="false"/>
- <property name="border-spacing" enabled="false"/>
- <property name="bottom" enabled="false"/>
- <property name="caption-side" enabled="false"/>
- <property name="clip" enabled="false"/>
- <property name="content" enabled="false"/>
- <property name="counter-increment" enabled="false"/>
- <property name="counter-reset" enabled="false"/>
- <property name="cue" enabled="false"/>
- <property name="cue-after" enabled="false"/>
- <property name="cue-before" enabled="false"/>
- <property name="cursor" enabled="false"/>
- <property name="direction" enabled="false"/>
- <property name="elevation" enabled="false"/>
- <property name="empty-cells" enabled="false"/>
- <property name="font-size-adjust" enabled="false"/>
- <property name="font-stretch" enabled="false"/>
- <property name="left" enabled="false"/>
- <property name="letter-spacing" enabled="false"/>
- <property name="line-height" enabled="false"/>
- <property name="marker-offset" enabled="false"/>
- <property name="marks" enabled="false"/>
- <property name="max-height" enabled="false"/>
- <property name="max-width" enabled="false"/>
- <property name="min-height" enabled="false"/>
- <property name="min-width" enabled="false"/>
- <property name="orphans" enabled="false"/>
- <property name="outline" enabled="false"/>
- <property name="outline-color" enabled="false"/>
- <property name="outline-style" enabled="false"/>
- <property name="outline-width" enabled="false"/>
- <property name="overflow" enabled="false"/>
- <property name="page" enabled="false"/>
- <property name="page-break-after" enabled="false"/>
- <property name="page-break-before" enabled="false"/>
- <property name="page-break-inside" enabled="false"/>
- <property name="pause" enabled="false"/>
- <property name="pause-after" enabled="false"/>
- <property name="pause-before" enabled="false"/>
- <property name="pitch" enabled="false"/>
- <property name="pitch-range" enabled="false"/>
- <property name="play-during" enabled="false"/>
- <property name="position" enabled="false"/>
- <property name="quotes" enabled="false"/>
- <property name="richness" enabled="false"/>
- <property name="right" enabled="false"/>
- <property name="size" enabled="false"/>
- <property name="speak" enabled="false"/>
- <property name="speak-header" enabled="false"/>
- <property name="speak-numeral" enabled="false"/>
- <property name="speak-punctuation" enabled="false"/>
- <property name="speech-rate" enabled="false"/>
- <property name="stress" enabled="false"/>
- <property name="table-layout" enabled="false"/>
- <property name="text-shadow" enabled="false"/>
- <property name="top" enabled="false"/>
- <property name="unicode-bidi" enabled="false"/>
- <property name="voice-family" enabled="false"/>
- <property name="volume" enabled="false"/>
- <property name="widows" enabled="false"/>
- <property name="word-spacing" enabled="false"/>
- <property name="z-index" enabled="false"/>
- </style-rule-def>
-
- <!-- property definition -->
- <!-- using "redifine" method: if "overwrite" attribute is set to
- "false" or not set, it means the node is cleanly redifined -->
-
- <property-def name="background-attachment"
- inherited="no" mediagroup="visual" category="colorandbackground">
- <keyword name="scroll"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="display"
- inherited="no" mediagroup="all" category="visual">
- <keyword name="inline"/>
- <keyword name="block"/>
- <keyword name="list-item"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-type"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-greek"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-align"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-decoration"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="vertical-align"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="inherit"/>
- </property-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="color" overwrite="true">
- <container name="system-color" enabled="false"/>
- </container-def>
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml
deleted file mode 100644
index ad401c1c9d..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile-wap.xml
+++ /dev/null
@@ -1,630 +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
- *******************************************************************************/
- -->
-<!--<!DOCTYPE css-profile SYSTEM "css-profile.dtd" >-->
-<css-profile>
- <profile-import name="cssprofile-css2.xml"/>
- <stylesheet-def>
- <description>%wap.stylesheet-def.description</description>
- <charset-rule/>
- <import-rule/>
- <media-rule/>
- <style-rule/>
- </stylesheet-def>
-
- <!-- Which properties can style rule include ? -->
- <!-- using "overwrite" method: only disabled properties are written. -->
-
- <style-rule-def overwrite="true">
- <property name="azimuth" enabled="false"/>
- <property name="border-collapse" enabled="false"/>
- <property name="border-spacing" enabled="false"/>
- <property name="bottom" enabled="false"/>
- <property name="caption-side" enabled="false"/>
- <property name="clip" enabled="false"/>
- <property name="content" enabled="false"/>
- <property name="cue" enabled="false"/>
- <property name="cue-after" enabled="false"/>
- <property name="cue-before" enabled="false"/>
- <property name="cursor" enabled="false"/>
- <property name="direction" enabled="false"/>
- <property name="elevation" enabled="false"/>
- <property name="empty-cells" enabled="false"/>
- <property name="font-size-adjust" enabled="false"/>
- <property name="font-stretch" enabled="false"/>
- <property name="left" enabled="false"/>
- <property name="letter-spacing" enabled="false"/>
- <property name="line-height" enabled="false"/>
- <property name="marker-offset" enabled="false"/>
- <property name="marks" enabled="false"/>
- <property name="max-height" enabled="false"/>
- <property name="max-width" enabled="false"/>
- <property name="min-height" enabled="false"/>
- <property name="min-width" enabled="false"/>
- <property name="orphans" enabled="false"/>
- <property name="outline" enabled="false"/>
- <property name="outline-color" enabled="false"/>
- <property name="outline-style" enabled="false"/>
- <property name="outline-width" enabled="false"/>
- <property name="overflow" enabled="false"/>
- <property name="page" enabled="false"/>
- <property name="page-break-after" enabled="false"/>
- <property name="page-break-before" enabled="false"/>
- <property name="page-break-inside" enabled="false"/>
- <property name="pause" enabled="false"/>
- <property name="pause-after" enabled="false"/>
- <property name="pause-before" enabled="false"/>
- <property name="pitch" enabled="false"/>
- <property name="pitch-range" enabled="false"/>
- <property name="play-during" enabled="false"/>
- <property name="position" enabled="false"/>
- <property name="quotes" enabled="false"/>
- <property name="richness" enabled="false"/>
- <property name="right" enabled="false"/>
- <property name="size" enabled="false"/>
- <property name="speak" enabled="false"/>
- <property name="speak-header" enabled="false"/>
- <property name="speak-numeral" enabled="false"/>
- <property name="speak-punctuation" enabled="false"/>
- <property name="speech-rate" enabled="false"/>
- <property name="stress" enabled="false"/>
- <property name="table-layout" enabled="false"/>
- <property name="text-shadow" enabled="false"/>
- <property name="top" enabled="false"/>
- <property name="unicode-bidi" enabled="false"/>
- <property name="voice-family" enabled="false"/>
- <property name="volume" enabled="false"/>
- <property name="widows" enabled="false"/>
- <property name="word-spacing" enabled="false"/>
- <property name="z-index" enabled="false"/>
- <property name="-wap-marquee-style"/>
- <property name="-wap-marquee-loop"/>
- <property name="-wap-marquee-dir"/>
- <property name="-wap-marquee-speed"/>
- <property name="-wap-accesskey"/>
- <property name="-wap-input-format"/>
- <property name="-wap-input-required"/>
- </style-rule-def>
-
- <!-- property definition -->
- <!-- using "redifine" method: if "overwrite" attribute is set to
- "false" or not set, it means the node is cleanly redifined -->
-
- <property-def name="display"
- inherited="no" mediagroup="all" category="visual">
- <keyword name="inline"/>
- <keyword name="block"/>
- <keyword name="list-item"/>
- <keyword name="-wap-marquee"/>
- <keyword name="none"/>
- </property-def>
- <property-def name="list-style-type"
- inherited="yes" mediagroup="visual" category="content">
- <keyword name="disc"/>
- <keyword name="circle"/>
- <keyword name="square"/>
- <keyword name="decimal"/>
- <keyword name="lower-roman"/>
- <keyword name="upper-roman"/>
- <keyword name="lower-alpha"/>
- <keyword name="upper-alpha"/>
- <keyword name="none"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-align"
- inherited="yes" mediagroup="visual" category="text">
- <keyword name="left"/>
- <keyword name="right"/>
- <keyword name="center"/>
- <keyword name="justify"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="text-decoration"
- inherited="no" mediagroup="visual" category="text">
- <keyword name="none"/>
- <keyword name="underline"/>
- <keyword name="blink"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="vertical-align"
- inherited="no" mediagroup="visual" category="visual">
- <keyword name="baseline"/>
- <keyword name="sub"/>
- <keyword name="super"/>
- <keyword name="top"/>
- <keyword name="middle"/>
- <keyword name="bottom"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-style"
- inherited="no" mediagroup="visual" category="wap">
- <keyword name="scroll"/>
- <keyword name="slide"/>
- <keyword name="alternate"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-loop"
- inherited="no" mediagroup="visual" category="wap">
- <number name="integer"/>
- <keyword name="infinite"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-dir"
- inherited="no" mediagroup="visual" category="wap">
- <keyword name="ltr"/>
- <keyword name="rtl"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-marquee-speed"
- inherited="no" mediagroup="visual" category="wap">
- <keyword name="slow"/>
- <keyword name="normal"/>
- <keyword name="fast"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-accesskey"
- inherited="no" mediagroup="interactive" category="wap">
- <container name="keycombination"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-input-format"
- inherited="no" mediagroup="interactive" category="wap">
- <container name="format"/>
- <keyword name="inherit"/>
- </property-def>
- <property-def name="-wap-input-required"
- inherited="no" mediagroup="interactive" category="wap">
- <keyword name="true"/>
- <keyword name="false"/>
- <keyword name="inherit"/>
- </property-def>
-
- <!-- container definition : Container is the lump of values.
- It can be used like macros. -->
- <container-def name="color" overwrite="true">
- <container name="system-color" enabled="false"/>
- </container-def>
- <container-def name="format">
- <string name="any"/>
- </container-def>
- <container-def name="keycombination">
- <container name="key"/>
- <keyword name="-"/>
- </container-def>
- <container-def name="key">
- <keyword name="space"/>
- <container name="specialkey"/>
- </container-def>
- <container-def name="specialkey">
- <container name="modifierkey"/>
- <container name="functionkey"/>
- <container name="navigationkey"/>
- <container name="editkey"/>
- <container name="misckey"/>
- <container name="volumecontrolkey"/>
- <container name="applicationkey"/>
- <container name="phonekey"/>
- <container name="vendorkey"/>
- </container-def>
- <container-def name="modifierkey">
- <keyword name="accesskey"/>
- <container name="cmdkey"/>
- <container name="optkey"/>
- <container name="ctrlkey"/>
- <container name="shiftkey"/>
- <container name="altkey"/>
- <container name="winkey"/>
- <container name="metakey"/>
- <keyword name="fn"/>
- <keyword name="fcn"/>
- <keyword name="caps"/>
- </container-def>
- <container-def name="cmdkey">
- <keyword name="cmd"/>
- <keyword name="rcmd"/>
- <keyword name="lcmd"/>
- </container-def>
- <container-def name="optkey">
- <keyword name="opt"/>
- <keyword name="ropt"/>
- <keyword name="lopt"/>
- </container-def>
- <container-def name="ctrlkey">
- <keyword name="ctrl"/>
- <keyword name="rctrl"/>
- <keyword name="lctrl"/>
- </container-def>
- <container-def name="shiftkey">
- <keyword name="shift"/>
- <keyword name="rshift"/>
- <keyword name="lshift"/>
- </container-def>
- <container-def name="altkey">
- <keyword name="alt"/>
- <keyword name="ralt"/>
- <keyword name="lalt"/>
- </container-def>
- <container-def name="winkey">
- <keyword name="win"/>
- <keyword name="rwin"/>
- <keyword name="lwin"/>
- </container-def>
- <container-def name="metakey">
- <keyword name="meta"/>
- <keyword name="rmeta"/>
- <keyword name="lmeta"/>
- </container-def>
- <container-def name="functionkey">
- <keyword name="f1"/>
- <keyword name="f2"/>
- <keyword name="f3"/>
- <keyword name="f4"/>
- <keyword name="f5"/>
- <keyword name="f6"/>
- <keyword name="f7"/>
- <keyword name="f8"/>
- <keyword name="f9"/>
- <keyword name="f10"/>
- <keyword name="f11"/>
- <keyword name="f12"/>
- <keyword name="f13"/>
- <keyword name="f14"/>
- <keyword name="f15"/>
- </container-def>
- <container-def name="navigationkey">
- <keyword name="tab"/>
- <keyword name="esc"/>
- <keyword name="enter"/>
- <keyword name="return"/>
- <keyword name="menu"/>
- <keyword name="help"/>
- <keyword name="namemenu"/>
- <keyword name="rcl"/>
- <keyword name="snd"/>
- <keyword name="arrowkey"/>
- <keyword name="pagekey"/>
- </container-def>
- <container-def name="arrowkey">
- <keyword name="up"/>
- <keyword name="down"/>
- <keyword name="left"/>
- <keyword name="right"/>
- </container-def>
- <container-def name="pagekey">
- <keyword name="home"/>
- <keyword name="end"/>
- <keyword name="pgup"/>
- <keyword name="pgdn"/>
- </container-def>
- <container-def name="editkey">
- <keyword name="bs"/>
- <keyword name="del"/>
- <keyword name="ins"/>
- <keyword name="undo"/>
- <keyword name="cut"/>
- <keyword name="copy"/>
- <keyword name="paste"/>
- <keyword name="clr"/>
- <keyword name="sto"/>
- </container-def>
- <container-def name="misckey">
- <keyword name="prtsc"/>
- <keyword name="sysrq"/>
- <keyword name="scrlock"/>
- <keyword name="pause"/>
- <keyword name="brk"/>
- <keyword name="numlock"/>
- <keyword name="pwr"/>
- </container-def>
- <container-def name="volumecontrolkey">
- <keyword name="volumeup"/>
- <keyword name="volumedown"/>
- </container-def>
- <container-def name="applicationkey">
- <keyword name="memo"/>
- <keyword name="todo"/>
- <keyword name="calendar"/>
- <keyword name="mail"/>
- <keyword name="address"/>
- </container-def>
- <container-def name="phonekey">
- <keyword name="phone-send"/>
- <keyword name="phone-end"/>
- <keyword name="phone-accept"/>
- </container-def>
- <container-def name="vendorkey">
- <keyword name="vnd."/>
- </container-def>
-
- <category-def name="wap">
- <caption>%wap.category-def.wap.caption</caption>
- </category-def>
-
- <number-def name="length">
- <unit name="em"/>
- <unit name="ex"/>
- <unit name="px"/>
- </number-def>
-
- <keyword-def name="-wap-marquee">
- <keyword-value>-wap-marquee</keyword-value>
- </keyword-def>
- <keyword-def name="slide">
- <keyword-value>slide</keyword-value>
- </keyword-def>
- <keyword-def name="alternate">
- <keyword-value>alternate</keyword-value>
- </keyword-def>
- <keyword-def name="infinite">
- <keyword-value>infinite</keyword-value>
- </keyword-def>
- <keyword-def name="-">
- <keyword-value>-</keyword-value>
- </keyword-def>
- <keyword-def name="space">
- <keyword-value>space</keyword-value>
- </keyword-def>
- <keyword-def name="accesskey">
- <keyword-value>accesskey</keyword-value>
- </keyword-def>
- <keyword-def name="fn">
- <keyword-value>fn</keyword-value>
- </keyword-def>
- <keyword-def name="fcn">
- <keyword-value>fcn</keyword-value>
- </keyword-def>
- <keyword-def name="caps">
- <keyword-value>caps</keyword-value>
- </keyword-def>
- <keyword-def name="cmd">
- <keyword-value>cmd</keyword-value>
- </keyword-def>
- <keyword-def name="rcmd">
- <keyword-value>rcmd</keyword-value>
- </keyword-def>
- <keyword-def name="lcmd">
- <keyword-value>lcmd</keyword-value>
- </keyword-def>
- <keyword-def name="opt">
- <keyword-value>opt</keyword-value>
- </keyword-def>
- <keyword-def name="ropt">
- <keyword-value>ropt</keyword-value>
- </keyword-def>
- <keyword-def name="lopt">
- <keyword-value>lopt</keyword-value>
- </keyword-def>
- <keyword-def name="ctrl">
- <keyword-value>ctrl</keyword-value>
- </keyword-def>
- <keyword-def name="rctrl">
- <keyword-value>rctrl</keyword-value>
- </keyword-def>
- <keyword-def name="lctrl">
- <keyword-value>lctrl</keyword-value>
- </keyword-def>
- <keyword-def name="shift">
- <keyword-value>shift</keyword-value>
- </keyword-def>
- <keyword-def name="rshift">
- <keyword-value>rshift</keyword-value>
- </keyword-def>
- <keyword-def name="lshift">
- <keyword-value>lshift</keyword-value>
- </keyword-def>
- <keyword-def name="alt">
- <keyword-value>alt</keyword-value>
- </keyword-def>
- <keyword-def name="ralt">
- <keyword-value>ralt</keyword-value>
- </keyword-def>
- <keyword-def name="lalt">
- <keyword-value>lalt</keyword-value>
- </keyword-def>
- <keyword-def name="win">
- <keyword-value>win</keyword-value>
- </keyword-def>
- <keyword-def name="rwin">
- <keyword-value>rwin</keyword-value>
- </keyword-def>
- <keyword-def name="lwin">
- <keyword-value>lwin</keyword-value>
- </keyword-def>
- <keyword-def name="meta">
- <keyword-value>meta</keyword-value>
- </keyword-def>
- <keyword-def name="rmeta">
- <keyword-value>rmeta</keyword-value>
- </keyword-def>
- <keyword-def name="lmeta">
- <keyword-value>lmeta</keyword-value>
- </keyword-def>
- <keyword-def name="f1">
- <keyword-value>f1</keyword-value>
- </keyword-def>
- <keyword-def name="f2">
- <keyword-value>f2</keyword-value>
- </keyword-def>
- <keyword-def name="f3">
- <keyword-value>f3</keyword-value>
- </keyword-def>
- <keyword-def name="f4">
- <keyword-value>f4</keyword-value>
- </keyword-def>
- <keyword-def name="f5">
- <keyword-value>f5</keyword-value>
- </keyword-def>
- <keyword-def name="f6">
- <keyword-value>f6</keyword-value>
- </keyword-def>
- <keyword-def name="f7">
- <keyword-value>f7</keyword-value>
- </keyword-def>
- <keyword-def name="f8">
- <keyword-value>f8</keyword-value>
- </keyword-def>
- <keyword-def name="f9">
- <keyword-value>f9</keyword-value>
- </keyword-def>
- <keyword-def name="f10">
- <keyword-value>f10</keyword-value>
- </keyword-def>
- <keyword-def name="f11">
- <keyword-value>f11</keyword-value>
- </keyword-def>
- <keyword-def name="f12">
- <keyword-value>f12</keyword-value>
- </keyword-def>
- <keyword-def name="f13">
- <keyword-value>f13</keyword-value>
- </keyword-def>
- <keyword-def name="f14">
- <keyword-value>f14</keyword-value>
- </keyword-def>
- <keyword-def name="f15">
- <keyword-value>f15</keyword-value>
- </keyword-def>
- <keyword-def name="tab">
- <keyword-value>tab</keyword-value>
- </keyword-def>
- <keyword-def name="esc">
- <keyword-value>esc</keyword-value>
- </keyword-def>
- <keyword-def name="enter">
- <keyword-value>enter</keyword-value>
- </keyword-def>
- <keyword-def name="return">
- <keyword-value>return</keyword-value>
- </keyword-def>
- <keyword-def name="namemenu">
- <keyword-value>namemenu</keyword-value>
- </keyword-def>
- <keyword-def name="rcl">
- <keyword-value>rcl</keyword-value>
- </keyword-def>
- <keyword-def name="snd">
- <keyword-value>snd</keyword-value>
- </keyword-def>
- <keyword-def name="arrowkey">
- <keyword-value>arrowkey</keyword-value>
- </keyword-def>
- <keyword-def name="pagekey">
- <keyword-value>pagekey</keyword-value>
- </keyword-def>
- <keyword-def name="up">
- <keyword-value>up</keyword-value>
- </keyword-def>
- <keyword-def name="down">
- <keyword-value>down</keyword-value>
- </keyword-def>
- <keyword-def name="home">
- <keyword-value>home</keyword-value>
- </keyword-def>
- <keyword-def name="end">
- <keyword-value>end</keyword-value>
- </keyword-def>
- <keyword-def name="pgup">
- <keyword-value>pgup</keyword-value>
- </keyword-def>
- <keyword-def name="pgdn">
- <keyword-value>pgdn</keyword-value>
- </keyword-def>
- <keyword-def name="bs">
- <keyword-value>bs</keyword-value>
- </keyword-def>
- <keyword-def name="del">
- <keyword-value>del</keyword-value>
- </keyword-def>
- <keyword-def name="ins">
- <keyword-value>ins</keyword-value>
- </keyword-def>
- <keyword-def name="undo">
- <keyword-value>undo</keyword-value>
- </keyword-def>
- <keyword-def name="cut">
- <keyword-value>cut</keyword-value>
- </keyword-def>
- <keyword-def name="copy">
- <keyword-value>copy</keyword-value>
- </keyword-def>
- <keyword-def name="paste">
- <keyword-value>paste</keyword-value>
- </keyword-def>
- <keyword-def name="clr">
- <keyword-value>clr</keyword-value>
- </keyword-def>
- <keyword-def name="sto">
- <keyword-value>sto</keyword-value>
- </keyword-def>
- <keyword-def name="prtsc">
- <keyword-value>prtsc</keyword-value>
- </keyword-def>
- <keyword-def name="sysrq">
- <keyword-value>sysrq</keyword-value>
- </keyword-def>
- <keyword-def name="scrlock">
- <keyword-value>scrlock</keyword-value>
- </keyword-def>
- <keyword-def name="brk">
- <keyword-value>brk</keyword-value>
- </keyword-def>
- <keyword-def name="numlock">
- <keyword-value>numlock</keyword-value>
- </keyword-def>
- <keyword-def name="pwr">
- <keyword-value>pwr</keyword-value>
- </keyword-def>
- <keyword-def name="volumeup">
- <keyword-value>volumeup</keyword-value>
- </keyword-def>
- <keyword-def name="volumedown">
- <keyword-value>volumedown</keyword-value>
- </keyword-def>
- <keyword-def name="memo">
- <keyword-value>memo</keyword-value>
- </keyword-def>
- <keyword-def name="todo">
- <keyword-value>todo</keyword-value>
- </keyword-def>
- <keyword-def name="calendar">
- <keyword-value>calendar</keyword-value>
- </keyword-def>
- <keyword-def name="mail">
- <keyword-value>mail</keyword-value>
- </keyword-def>
- <keyword-def name="address">
- <keyword-value>address</keyword-value>
- </keyword-def>
- <keyword-def name="phone-send">
- <keyword-value>phone-send</keyword-value>
- </keyword-def>
- <keyword-def name="phone-end">
- <keyword-value>phone-end</keyword-value>
- </keyword-def>
- <keyword-def name="phone-accept">
- <keyword-value>phone-accept</keyword-value>
- </keyword-def>
- <keyword-def name="vnd.">
- <keyword-value>vnd.</keyword-value>
- </keyword-def>
- <keyword-def name="true">
- <keyword-value>true</keyword-value>
- </keyword-def>
- <keyword-def name="false">
- <keyword-value>false</keyword-value>
- </keyword-def>
- <keyword-def name="pause">
- <keyword-value>pause</keyword-value>
- </keyword-def>
-
-</css-profile> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties b/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
deleted file mode 100644
index dd7e399c94..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/cssprofile.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-# cssprofile-css1.xml
-css1.stylesheet-def.description=Cascading Style Sheets, level 1
-css1.category-def.box.caption=Box model
-css1.category-def.colorandbackground.caption=Colors and Backgrounds
-css1.category-def.classification.caption=Classification
-css1.category-def.font.caption=Font
-css1.category-def.text.caption=Text
-# cssprofile-css2.xml
-css2.stylesheet-def.description=Cascading Style Sheets, level 2
-css2.category-def.aural.caption=Aural
-css2.category-def.box.caption=Box model
-css2.category-def.colorandbackground.caption=Colors and Backgrounds
-css2.category-def.content.caption=Generated content/List
-css2.category-def.font.caption=Fonts
-css2.category-def.page.caption=Paged media
-css2.category-def.tables.caption=Tables
-css2.category-def.text.caption=Text
-css2.category-def.visual.caption=Visual
-css2.category-def.ui.caption=User interface
-# cssprofile-mobile1_0.xml
-mobile1_0.stylesheet-def.description=CSS Mobile Profile 1.0
-# cssprofile-wap.xml
-wap.stylesheet-def.description=WCSS 1.0
-wap.category-def.wap.caption=WCSS Extensions
diff --git a/bundles/org.eclipse.wst.css.core/cssprofile/description.txt b/bundles/org.eclipse.wst.css.core/cssprofile/description.txt
deleted file mode 100644
index 3f31f198ec..0000000000
--- a/bundles/org.eclipse.wst.css.core/cssprofile/description.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
-
- * None of the files in this directory
- * need to be translated
- * except for cssprofile.properties
- *******************************************************************************/
- \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/plugin.properties b/bundles/org.eclipse.wst.css.core/plugin.properties
deleted file mode 100644
index 67fcec088c..0000000000
--- a/bundles/org.eclipse.wst.css.core/plugin.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-providerName=Eclipse.org
-pluginName=Structured Source CSS Model
-cssprofile_css2.name=CSS2: Cascading Style Sheets, level 2
-cssprofile_css1.name=CSS1: Cascading Style Sheets, level 1
-cssprofile_mobile1_0.name=CSS Mobile Profile 1.0
-cssprofile_wap.name=WCSS 1.0
-Structured_CSS_Document_Factory_Extension.name=Structured CSS Document Factory Extension
-CSS_Content_Type_Extension_Element.name=CSS
-_taskMarker.name=CSS Task \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/plugin.xml b/bundles/org.eclipse.wst.css.core/plugin.xml
deleted file mode 100644
index c1b7b69509..0000000000
--- a/bundles/org.eclipse.wst.css.core/plugin.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension point="org.eclipse.wst.sse.core.cssprofile">
- <profile
- name="%cssprofile_css2.name"
- default="true"
- uri="cssprofile/cssprofile-css2.xml"
- id="org.eclipse.wst.css.core.cssprofile.css2">
- </profile>
- <profile
- name="%cssprofile_css1.name"
- uri="cssprofile/cssprofile-css1.xml"
- id="org.eclipse.wst.css.core.cssprofile.css1">
- </profile>
- <profile
- name="%cssprofile_mobile1_0.name"
- uri="cssprofile/cssprofile-mobile1_0.xml"
- id="org.eclipse.wst.css.core.cssprofile.mobile1_0">
- </profile>
- <profile
- name="%cssprofile_wap.name"
- uri="cssprofile/cssprofile-wap.xml"
- id="org.eclipse.wst.css.core.cssprofile.wap">
- </profile>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.modelHandler">
- <modelHandler
- class="org.eclipse.wst.css.core.internal.modelhandler.ModelHandlerForCSS"
- associatedContentTypeId="org.eclipse.wst.css.core.csssource"
- id="org.eclipse.wst.css.core.internal.modelhandler">
- </modelHandler>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.taskscanner">
- <scanner
- id="org.eclipse.wst.css.core.internal.tasks.CSSFileTaskScanner"
- class="org.eclipse.wst.css.core.internal.tasks.CSSFileTaskScanner:org.eclipse.wst.css.core.taskMarker"
- contentTypeIds="org.eclipse.wst.css.core.csssource" />
- </extension>
- <extension
- id="taskMarker"
- name="%_taskMarker.name"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.core.resources.taskmarker"/>
- <persistent value="true"/>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.documentCreation"
- id="org.eclipse.wst.css.core.documentfactories"
- name="%Structured_CSS_Document_Factory_Extension.name">
- <factory
- contentTypeId="org.eclipse.wst.css.core.csssource"
- class="org.eclipse.wst.sse.core.internal.filebuffers.BasicStructuredDocumentFactory" />
- </extension>
-
- <extension point="org.eclipse.team.core.fileTypes">
- <fileTypes
- type="text"
- extension="css">
- </fileTypes>
- </extension>
-
- <extension point="org.eclipse.wst.sse.core.formatProcessors">
- <processor
- class="org.eclipse.wst.css.core.internal.format.FormatProcessorCSS"
- contentTypeId="org.eclipse.wst.css.core.csssource">
- </processor>
- </extension>
-
- <extension point="org.eclipse.core.runtime.contentTypes">
- <content-type
- file-extensions="css"
- priority="high"
- name="%CSS_Content_Type_Extension_Element.name"
- id="csssource"
- base-type="org.eclipse.core.runtime.text">
- <describer
- class="org.eclipse.wst.css.core.internal.contenttype.ContentDescriberForCSS" />
- </content-type>
- </extension>
-
- <!-- initialize css core preferences -->
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceInitializer" />
- </extension>
-</plugin>
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
deleted file mode 100644
index 8d79a982fc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCoreMessages.java
+++ /dev/null
@@ -1,43 +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 - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by CSS Core
- *
- * @plannedfor 1.0
- */
-public class CSSCoreMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.css.core.internal.CSSCorePluginResources";//$NON-NLS-1$
-
- public static String You_cannot_use_CSSStyleShe_UI_;
- public static String _1concat_ERROR_;
- public static String _2concat_ERROR_;
- public static String _3concat_ERROR_;
- public static String _4concat_ERROR_;
- public static String _25concat_ERROR_;
- public static String _26concat_ERROR_;
- public static String _27concat_ERROR_;
- public static String _28concat_ERROR_;
- public static String _5concat_ERROR_;
- public static String _6concat_ERROR_;
- public static String _7concat_ERROR_;
- public static String _8concat_ERROR_;
- public static String CSSContentPropertiesManager_Updating;
- public static String CSSContentPropertiesManager_Problems_Updating;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, CSSCoreMessages.class);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
deleted file mode 100644
index f992edfaca..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePlugin.java
+++ /dev/null
@@ -1,62 +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.css.core.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.wst.css.core.internal.contentproperties.CSSContentPropertiesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CSSCorePlugin extends Plugin {
- // The shared instance.
- private static CSSCorePlugin plugin;
-
- /**
- * The constructor.
- */
- public CSSCorePlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns the shared instance.
- */
- public static CSSCorePlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public void start(BundleContext context) throws Exception {
- super.start(context);
-
- // listen for resource changes to update content properties keys
- CSSContentPropertiesManager.startup();
- }
-
- public void stop(BundleContext context) throws Exception {
- // stop listenning for resource changes to update content properties
- // keys
- CSSContentPropertiesManager.shutdown();
-
- super.stop(context);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
deleted file mode 100644
index c971cd65b4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/CSSCorePluginResources.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-You_cannot_use_CSSStyleShe_UI_=You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()
-_1concat_ERROR_={0}first flat node is null.
-_2concat_ERROR_={0}first flat node is not in model.
-_3concat_ERROR_={0}last flat node is null.
-_4concat_ERROR_={0}last flat node is not in model.
-_25concat_ERROR_={0}first region is null.
-_26concat_ERROR_={0}first region is not in model.
-_27concat_ERROR_={0}last region is null.
-_28concat_ERROR_={0}last region is not in model.
-_5concat_ERROR_={0}first region is null.
-_6concat_ERROR_={0}first region is not in model.
-_7concat_ERROR_={0}last region is null.
-_8concat_ERROR_={0}last region is not in model.
-#
-CSSContentPropertiesManager_Updating=Updating CSS Content Settings
-CSSContentPropertiesManager_Problems_Updating=Problem saving CSS Content Settings for {0}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java
deleted file mode 100644
index ebffda092d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/Logger.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.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.css.core"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java
deleted file mode 100644
index eb6d86e67b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategy.java
+++ /dev/null
@@ -1,98 +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.css.core.internal.cleanup;
-
-
-
-public interface CSSCleanupStrategy {
-
- static final short ASIS = 0;
- static final short LOWER = 1;
- static final short UPPER = 2;
-
- /**
- *
- * @return short
- */
- short getIdentCase();
-
- /**
- *
- * @return short
- */
- short getPropNameCase();
-
- /**
- *
- * @return short
- */
- short getPropValueCase();
-
- /**
- *
- * @return short
- */
- short getSelectorTagCase();
-
- /**
- *
- * @return boolean
- */
- boolean isFormatSource();
-
- /**
- *
- * @return boolean
- */
- boolean isQuoteValues();
-
- /**
- *
- * @param formatSource
- * boolean
- */
- void setFormatSource(boolean formatSource);
-
- /**
- *
- * @param identCase
- * short
- */
- void setIdentCase(short identCase);
-
- /**
- *
- * @param propNameCase
- * short
- */
- void setPropNameCase(short propNameCase);
-
- /**
- *
- * @param propValueCase
- * short
- */
- void setPropValueCase(short propValueCase);
-
- /**
- *
- * @param quoteValues
- * boolean
- */
- void setQuoteValues(boolean quoteValues);
-
- /**
- *
- * @param selectorTagCase
- * short
- */
- void setSelectorTagCase(short selectorTagCase);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java
deleted file mode 100644
index 5b190f4ebc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CSSCleanupStrategyImpl.java
+++ /dev/null
@@ -1,190 +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.css.core.internal.cleanup;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-
-
-
-public class CSSCleanupStrategyImpl implements CSSCleanupStrategy {
-
- static private CSSCleanupStrategy instance = null;
- // initialize with defaults
- protected short fIdentCase = ASIS;
- protected short fPropNameCase = ASIS;
- protected short fPropValueCase = ASIS;
- protected short fSelectorTagCase = UPPER;
- protected boolean fQuoteValues = true;
- protected boolean fFormatSource = true;
-
- /**
- * CSSCleanupStrategyImpl constructor comment.
- */
- protected CSSCleanupStrategyImpl() {
- super();
- initialize();
- }
-
- /**
- *
- * @return short
- */
- public short getIdentCase() {
- return fIdentCase;
- }
-
- /**
- *
- * @return org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy
- */
- public synchronized static CSSCleanupStrategy getInstance() {
- if (instance == null)
- instance = new CSSCleanupStrategyImpl();
- return instance;
- }
-
- /**
- *
- * @return short
- */
- public short getPropNameCase() {
- return fPropNameCase;
- }
-
- /**
- *
- * @return short
- */
- public short getPropValueCase() {
- return fPropValueCase;
- }
-
- /**
- *
- * @return short
- */
- public short getSelectorTagCase() {
- return fSelectorTagCase;
- }
-
- /**
- *
- */
- private void initialize() {
- Preferences prefs = CSSCorePlugin.getDefault().getPluginPreferences();
- fIdentCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_IDENTIFIER));
- fPropNameCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME));
- fPropValueCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE));
- fSelectorTagCase = getCleanupCaseValue(prefs.getInt(CSSCorePreferenceNames.CLEANUP_CASE_SELECTOR));
- fQuoteValues = prefs.getBoolean(CSSCorePreferenceNames.QUOTE_ATTR_VALUES);
- fFormatSource = prefs.getBoolean(CSSCorePreferenceNames.FORMAT_SOURCE);
- }
-
- /**
- * Return the CSSCleanupStrategy equivalent case short value when given an
- * int
- *
- * @param value
- * @return equivalent case short or ASIS if cannot be determined
- */
- private short getCleanupCaseValue(int value) {
- switch (value) {
- case CSSCorePreferenceNames.LOWER :
- return LOWER;
- case CSSCorePreferenceNames.UPPER :
- return UPPER;
- }
- return ASIS;
- }
-
- /**
- *
- * @return boolean
- */
- public boolean isFormatSource() {
- return fFormatSource;
- }
-
- /**
- *
- * @return boolean
- */
- public boolean isQuoteValues() {
- return fQuoteValues;
- }
-
- /**
- *
- * @param formatSource
- * boolean
- */
- public void setFormatSource(boolean formatSource) {
- fFormatSource = formatSource;
- }
-
- /**
- *
- * @param identCase
- * short
- */
- public void setIdentCase(short identCase) {
- fIdentCase = identCase;
- }
-
- /**
- *
- * @param propNameCase
- * short
- */
- public void setPropNameCase(short propNameCase) {
- fPropNameCase = propNameCase;
- }
-
- /**
- *
- * @param propValueCase
- * short
- */
- public void setPropValueCase(short propValueCase) {
- fPropValueCase = propValueCase;
- }
-
- /**
- *
- * @param quoteValues
- * boolean
- */
- public void setQuoteValues(boolean quoteValues) {
- fQuoteValues = quoteValues;
- }
-
- /**
- *
- * @param selectorTagCase
- * short
- */
- public void setSelectorTagCase(short selectorTagCase) {
- fSelectorTagCase = selectorTagCase;
- }
-
- // TODO: a saveOptions should be added to CSSCleanupStrategy interface
- public void saveOptions() {
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_IDENTIFIER, fIdentCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME, fPropNameCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE, fPropValueCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.CLEANUP_CASE_SELECTOR, fSelectorTagCase);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.QUOTE_ATTR_VALUES, fQuoteValues);
- CSSCorePlugin.getDefault().getPluginPreferences().setValue(CSSCorePreferenceNames.FORMAT_SOURCE, fFormatSource);
- CSSCorePlugin.getDefault().savePluginPreferences();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java
deleted file mode 100644
index 1fadf348c8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/cleanup/CleanupProcessorCSS.java
+++ /dev/null
@@ -1,101 +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.css.core.internal.cleanup;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-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.cleanup.AbstractStructuredCleanupProcessor;
-import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupHandler;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-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.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-
-public class CleanupProcessorCSS extends AbstractStructuredCleanupProcessor {
-
- public void cleanupModel(IStructuredModel structuredModel, int start, int length) {
- CSSFormatUtil formatUtil = CSSFormatUtil.getInstance();
- if (structuredModel instanceof ICSSModel) {
- ICSSDocument doc = ((ICSSModel) structuredModel).getDocument();
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
- StringBuffer buf = formatter.cleanup(doc);
- if (buf != null) {
- int startOffset = ((IndexedRegion) doc).getStartOffset();
- int endOffset = ((IndexedRegion) doc).getEndOffset();
- formatUtil.replaceSource(doc.getModel(), startOffset, endOffset - startOffset, buf.toString());
- }
- }
- else if (structuredModel instanceof IDOMModel) {
- List cssnodes = formatUtil.collectCSSNodes(structuredModel, start, length);
- if (cssnodes != null && !cssnodes.isEmpty()) {
- ICSSModel model = null;
- for (int i = 0; i < cssnodes.size(); i++) {
- ICSSNode node = (ICSSNode) cssnodes.get(i);
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) node);
- StringBuffer buf = formatter.cleanup(node);
- if (buf != null) {
- int startOffset = ((IndexedRegion) node).getStartOffset();
- int endOffset = ((IndexedRegion) node).getEndOffset();
- if (model == null) {
- model = node.getOwnerDocument().getModel();
- }
- formatUtil.replaceSource(model, startOffset, endOffset - startOffset, buf.toString());
- }
- }
- }
- }
- }
-
- protected String getContentType() {
- return ContentTypeIdForCSS.ContentTypeID_CSS;
- }
-
- public void cleanupModel(IStructuredModel structuredModel) {
- int start = 0;
- int length = structuredModel.getStructuredDocument().getLength();
-
- cleanupModel(structuredModel, start, length);
- }
-
- public void cleanupDocument(IDocument document) throws IOException, CoreException {
- // TODO should implement, or delete?
-
- }
-
- public void cleanupDocument(IDocument document, int start, int length) throws IOException, CoreException {
- // TODO should implement, or delete?
-
- }
-
- protected IStructuredCleanupHandler getCleanupHandler(Node node) {
- return null;
- }
-
- protected IStructuredFormatProcessor getFormatProcessor() {
- return null;
- }
-
- protected void refreshCleanupPreferences() {
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java
deleted file mode 100644
index 8d02ac886b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IMediaGroupID.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-/**
- *
- */
-public interface IMediaGroupID {
-
- public final static String M_CONTINUOUS = "continuous"; //$NON-NLS-1$
- public final static String M_PAGED = "paged"; //$NON-NLS-1$
-
- public final static String M_VISUAL = "visual"; //$NON-NLS-1$
- public final static String M_AURAL = "aural"; //$NON-NLS-1$
- public final static String M_TACTILE = "tactile"; //$NON-NLS-1$
-
- public final static String M_GRID = "grid"; //$NON-NLS-1$
- public final static String M_BITMAP = "bitmap"; //$NON-NLS-1$
-
- public final static String M_INTERACTIVE = "interactive"; //$NON-NLS-1$
- public final static String M_STATIC = "static"; //$NON-NLS-1$
-
- public final static String M_ALL = "all"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
deleted file mode 100644
index f49c1a113e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/IValID.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-/**
- *
- */
-public interface IValID {
-
- public final static String V_100 = "100"; //$NON-NLS-1$
- public final static String V_200 = "200"; //$NON-NLS-1$
- public final static String V_300 = "300"; //$NON-NLS-1$
- public final static String V_400 = "400"; //$NON-NLS-1$
- public final static String V_500 = "500"; //$NON-NLS-1$
- public final static String V_600 = "600"; //$NON-NLS-1$
- public final static String V_700 = "700"; //$NON-NLS-1$
- public final static String V_800 = "800"; //$NON-NLS-1$
- public final static String V_900 = "900"; //$NON-NLS-1$
- public final static String V_ABOVE = "above"; //$NON-NLS-1$
- public final static String V_ABSOLUTE = "absolute"; //$NON-NLS-1$
- public final static String V_ACTIVEBORDER = "ActiveBorder"; //$NON-NLS-1$
- public final static String V_ACTIVECAPTION = "ActiveCaption"; //$NON-NLS-1$
- public final static String V_ALL = "all"; //$NON-NLS-1$
- public final static String V_ALWAYS = "always"; //$NON-NLS-1$
- public final static String V_APPWORKSPACE = "AppWorkspace"; //$NON-NLS-1$
- public final static String V_AQUA = "aqua"; //$NON-NLS-1$
- public final static String V_ARMENIAN = "armenian"; //$NON-NLS-1$
- public final static String V_AUTO = "auto"; //$NON-NLS-1$
- public final static String V_AVOID = "avoid"; //$NON-NLS-1$
- public final static String V_BACKGROUND = "Background"; //$NON-NLS-1$
- public final static String V_BASELINE = "baseline"; //$NON-NLS-1$
- public final static String V_BEHIND = "behind"; //$NON-NLS-1$
- public final static String V_BELOW = "below"; //$NON-NLS-1$
- public final static String V_BIDI_OVERRIDE = "bidi-override"; //$NON-NLS-1$
- public final static String V_BLACK = "black"; //$NON-NLS-1$
- public final static String V_BLINK = "blink"; //$NON-NLS-1$
- public final static String V_BLOCK = "block"; //$NON-NLS-1$
- public final static String V_BLUE = "blue"; //$NON-NLS-1$
- public final static String V_BOLD = "bold"; //$NON-NLS-1$
- public final static String V_BOLDER = "bolder"; //$NON-NLS-1$
- public final static String V_BOTH = "both"; //$NON-NLS-1$
- public final static String V_BOTTOM = "bottom"; //$NON-NLS-1$
- public final static String V_BUTTONFACE = "ButtonFace"; //$NON-NLS-1$
- public final static String V_BUTTONHIGHLIGHT = "ButtonHighlight"; //$NON-NLS-1$
- public final static String V_BUTTONSHADOW = "ButtonShadow"; //$NON-NLS-1$
- public final static String V_BUTTONTEXT = "ButtonText"; //$NON-NLS-1$
- public final static String V_CAPITALIZE = "capitalize"; //$NON-NLS-1$
- public final static String V_CAPTION = "caption"; //$NON-NLS-1$
- public final static String V_CAPTIONTEXT = "CaptionText"; //$NON-NLS-1$
- public final static String V_CENTER = "center"; //$NON-NLS-1$
- public final static String V_CENTER_LEFT = "center-left"; //$NON-NLS-1$
- public final static String V_CENTER_RIGHT = "center-right"; //$NON-NLS-1$
- public final static String V_CHILD = "child"; //$NON-NLS-1$
- public final static String V_CIRCLE = "circle"; //$NON-NLS-1$
- public final static String V_CJK_IDEOGRAPHIC = "cjk-ideographic"; //$NON-NLS-1$
- public final static String V_CLOSE_QUOTE = "close-quote"; //$NON-NLS-1$
- public final static String V_CODE = "code"; //$NON-NLS-1$
- public final static String V_CONDENSED = "condensed"; //$NON-NLS-1$
- public final static String V_COLLAPSE = "collapse"; //$NON-NLS-1$
- public final static String V_COMPACT = "compact"; //$NON-NLS-1$
- public final static String V_CONTINUOUS = "continuous"; //$NON-NLS-1$
- public final static String V_CROP = "crop"; //$NON-NLS-1$
- public final static String V_CROSS = "cross"; //$NON-NLS-1$
- public final static String V_CROSSHAIR = "crosshair"; //$NON-NLS-1$
- public final static String V_CURSIVE = "cursive"; //$NON-NLS-1$
- public final static String V_DASHED = "dashed"; //$NON-NLS-1$
- public final static String V_DECIMAL = "decimal"; //$NON-NLS-1$
- public final static String V_DECIMAL_LEADING_ZERO = "decimal-leading-zero"; //$NON-NLS-1$
- public final static String V_DEFAULT = "default"; //$NON-NLS-1$
- public final static String V_DIGITS = "digits"; //$NON-NLS-1$
- public final static String V_DISC = "disc"; //$NON-NLS-1$
- public final static String V_DOTTED = "dotted"; //$NON-NLS-1$
- public final static String V_DOUBLE = "double"; //$NON-NLS-1$
- public final static String V_E_RESIZE = "e-resize"; //$NON-NLS-1$
- public final static String V_EMBED = "embed"; //$NON-NLS-1$
- public final static String V_EXPANDED = "expanded"; //$NON-NLS-1$
- public final static String V_EXTRA_CONDENSED = "extra-condensed"; //$NON-NLS-1$
- public final static String V_EXTRA_EXPANDED = "extra-expanded"; //$NON-NLS-1$
- public final static String V_FANTASY = "fantasy"; //$NON-NLS-1$
- public final static String V_FAR_LEFT = "far-left"; //$NON-NLS-1$
- public final static String V_FAR_RIGHT = "far-right"; //$NON-NLS-1$
- public final static String V_FAST = "fast"; //$NON-NLS-1$
- public final static String V_FASTER = "faster"; //$NON-NLS-1$
- public final static String V_FEMALE = "female"; //$NON-NLS-1$
- public final static String V_FIXED = "fixed"; //$NON-NLS-1$
- public final static String V_FUCHSIA = "fuchsia"; //$NON-NLS-1$
- public final static String V_GEORGIAN = "georgian"; //$NON-NLS-1$
- public final static String V_GRAY = "gray"; //$NON-NLS-1$
- public final static String V_GRAYTEXT = "GrayText"; //$NON-NLS-1$
- public final static String V_GREEN = "green"; //$NON-NLS-1$
- public final static String V_GROOVE = "groove"; //$NON-NLS-1$
- public final static String V_HEBREW = "hebrew"; //$NON-NLS-1$
- public final static String V_HELP = "help"; //$NON-NLS-1$
- public final static String V_HIDDEN = "hidden"; //$NON-NLS-1$
- public final static String V_HIDE = "hide"; //$NON-NLS-1$
- public final static String V_HIGH = "high"; //$NON-NLS-1$
- public final static String V_HIGHLIGHT = "Highlight"; //$NON-NLS-1$
- public final static String V_HIGHLIGHTTEXT = "HighlightText"; //$NON-NLS-1$
- public final static String V_HIGHER = "higher"; //$NON-NLS-1$
- public final static String V_HIRAGANA = "hiragana"; //$NON-NLS-1$
- public final static String V_HIRAGANA_IROHA = "hiragana-iroha"; //$NON-NLS-1$
- public final static String V_ICON = "icon"; //$NON-NLS-1$
- public final static String V_INACTIVEBORDER = "InactiveBorder"; //$NON-NLS-1$
- public final static String V_INACTIVECAPTION = "InactiveCaption"; //$NON-NLS-1$
- public final static String V_INACTIVECAPTIONTEXT = "InactiveCaptionText"; //$NON-NLS-1$
- public final static String V_INFOBACKGROUND = "InfoBackground"; //$NON-NLS-1$
- public final static String V_INFOTEXT = "InfoText"; //$NON-NLS-1$
- public final static String V_INLINE = "inline"; //$NON-NLS-1$
- public final static String V_INLINE_TABLE = "inline-table"; //$NON-NLS-1$
- public final static String V_INSET = "inset"; //$NON-NLS-1$
- public final static String V_INSIDE = "inside"; //$NON-NLS-1$
- public final static String V_INVERT = "invert"; //$NON-NLS-1$
- public final static String V_ITALIC = "italic"; //$NON-NLS-1$
- public final static String V_JUSTIFY = "justify"; //$NON-NLS-1$
- public final static String V_KATAKANA = "katakana"; //$NON-NLS-1$
- public final static String V_KATAKANA_IROHA = "katakana-iroha"; //$NON-NLS-1$
- public final static String V_LANDSCAPE = "landscape"; //$NON-NLS-1$
- public final static String V_LARGE = "large"; //$NON-NLS-1$
- public final static String V_LARGER = "larger"; //$NON-NLS-1$
- public final static String V_LEFT = "left"; //$NON-NLS-1$
- public final static String V_LEFT_SIDE = "left-side"; //$NON-NLS-1$
- public final static String V_LEFTWARDS = "leftwards"; //$NON-NLS-1$
- public final static String V_LEVEL = "level"; //$NON-NLS-1$
- public final static String V_LIGHTER = "lighter"; //$NON-NLS-1$
- public final static String V_LIME = "lime"; //$NON-NLS-1$
- public final static String V_LINE_THROUGH = "line-through"; //$NON-NLS-1$
- public final static String V_LIST_ITEM = "list-item"; //$NON-NLS-1$
- public final static String V_LOUD = "loud"; //$NON-NLS-1$
- public final static String V_LOW = "low"; //$NON-NLS-1$
- public final static String V_LOWER = "lower"; //$NON-NLS-1$
- public final static String V_LOWER_ALPHA = "lower-alpha"; //$NON-NLS-1$
- public final static String V_LOWER_GREEK = "lower-greek"; //$NON-NLS-1$
- public final static String V_LOWER_LATIN = "lower-latin"; //$NON-NLS-1$
- public final static String V_LOWER_ROMAN = "lower-roman"; //$NON-NLS-1$
- public final static String V_LOWERCASE = "lowercase"; //$NON-NLS-1$
- public final static String V_LTR = "ltr"; //$NON-NLS-1$
- public final static String V_MALE = "male"; //$NON-NLS-1$
- public final static String V_MARKER = "marker"; //$NON-NLS-1$
- public final static String V_MAROON = "maroon"; //$NON-NLS-1$
- public final static String V_MEDIUM = "medium"; //$NON-NLS-1$
- public final static String V_MENU = "menu"; //$NON-NLS-1$
- public final static String V_MENUTEXT = "MenuText"; //$NON-NLS-1$
- public final static String V_MESSAGE_BOX = "message-box"; //$NON-NLS-1$
- public final static String V_MIDDLE = "middle"; //$NON-NLS-1$
- public final static String V_MIX = "mix"; //$NON-NLS-1$
- public final static String V_MONOSPACE = "monospace"; //$NON-NLS-1$
- public final static String V_MOVE = "move"; //$NON-NLS-1$
- public final static String V_N_RESIZE = "n-resize"; //$NON-NLS-1$
- public final static String V_NARROWER = "narrower"; //$NON-NLS-1$
- public final static String V_NAVY = "navy"; //$NON-NLS-1$
- public final static String V_NE_RESIZE = "ne-resize"; //$NON-NLS-1$
- public final static String V_NO_CLOSE_QUOTE = "no-close-quote"; //$NON-NLS-1$
- public final static String V_NO_OPEN_QUOTE = "no-open-quote"; //$NON-NLS-1$
- public final static String V_NO_REPEAT = "no-repeat"; //$NON-NLS-1$
- public final static String V_NONE = "none"; //$NON-NLS-1$
- public final static String V_NORMAL = "normal"; //$NON-NLS-1$
- public final static String V_NOWRAP = "nowrap"; //$NON-NLS-1$
- public final static String V_NW_RESIZE = "nw-resize"; //$NON-NLS-1$
- public final static String V_OBLIQUE = "oblique"; //$NON-NLS-1$
- public final static String V_OLIVE = "olive"; //$NON-NLS-1$
- public final static String V_ONCE = "once"; //$NON-NLS-1$
- public final static String V_OPEN_QUOTE = "open-quote"; //$NON-NLS-1$
- public final static String V_OUTSET = "outset"; //$NON-NLS-1$
- public final static String V_OUTSIDE = "outside"; //$NON-NLS-1$
- public final static String V_OVERLINE = "overline"; //$NON-NLS-1$
- public final static String V_POINTER = "pointer"; //$NON-NLS-1$
- public final static String V_PORTRAIT = "portrait"; //$NON-NLS-1$
- public final static String V_PRE = "pre"; //$NON-NLS-1$
- public final static String V_PURPLE = "purple"; //$NON-NLS-1$
- public final static String V_RED = "red"; //$NON-NLS-1$
- public final static String V_RELATIVE = "relative"; //$NON-NLS-1$
- public final static String V_REPEAT = "repeat"; //$NON-NLS-1$
- public final static String V_REPEAT_X = "repeat-x"; //$NON-NLS-1$
- public final static String V_REPEAT_Y = "repeat-y"; //$NON-NLS-1$
- public final static String V_RIDGE = "ridge"; //$NON-NLS-1$
- public final static String V_RIGHT = "right"; //$NON-NLS-1$
- public final static String V_RIGHT_SIDE = "right-side"; //$NON-NLS-1$
- public final static String V_RIGHTWARDS = "rightwards"; //$NON-NLS-1$
- public final static String V_RTL = "rtl"; //$NON-NLS-1$
- public final static String V_RUN_IN = "run-in"; //$NON-NLS-1$
- public final static String V_S_RESIZE = "s-resize"; //$NON-NLS-1$
- public final static String V_SANS_SERIF = "sans-serif"; //$NON-NLS-1$
- public final static String V_SCROLL = "scroll"; //$NON-NLS-1$
- public final static String V_SCROLLBAR = "Scrollbar"; //$NON-NLS-1$
- public final static String V_SE_RESIZE = "se-resize"; //$NON-NLS-1$
- public final static String V_SEMI_CONDENSED = "semi-condensed"; //$NON-NLS-1$
- public final static String V_SEMI_EXPANDED = "semi-expanded"; //$NON-NLS-1$
- public final static String V_SEPARATE = "separate"; //$NON-NLS-1$
- public final static String V_SERIF = "serif"; //$NON-NLS-1$
- public final static String V_SHOW = "show"; //$NON-NLS-1$
- public final static String V_SILENT = "silent"; //$NON-NLS-1$
- public final static String V_SILVER = "silver"; //$NON-NLS-1$
- public final static String V_SLOW = "slow"; //$NON-NLS-1$
- public final static String V_SLOWER = "slower"; //$NON-NLS-1$
- public final static String V_SMALL = "small"; //$NON-NLS-1$
- public final static String V_SMALL_CAPS = "small-caps"; //$NON-NLS-1$
- public final static String V_SMALL_CAPTION = "small-caption"; //$NON-NLS-1$
- public final static String V_SMALLER = "smaller"; //$NON-NLS-1$
- public final static String V_SOFT = "soft"; //$NON-NLS-1$
- public final static String V_SOLID = "solid"; //$NON-NLS-1$
- public final static String V_SPELL_OUT = "spell-out"; //$NON-NLS-1$
- public final static String V_SQUARE = "square"; //$NON-NLS-1$
- public final static String V_STATIC = "static"; //$NON-NLS-1$
- public final static String V_STATUS_BAR = "status-bar"; //$NON-NLS-1$
- public final static String V_SUB = "sub"; //$NON-NLS-1$
- public final static String V_SUPER = "super"; //$NON-NLS-1$
- public final static String V_SW_RESIZE = "sw-resize"; //$NON-NLS-1$
- public final static String V_TABLE = "table"; //$NON-NLS-1$
- public final static String V_TABLE_CAPTION = "table-caption"; //$NON-NLS-1$
- public final static String V_TABLE_CELL = "table-cell"; //$NON-NLS-1$
- public final static String V_TABLE_COLUMN = "table-column"; //$NON-NLS-1$
- public final static String V_TABLE_COLUMN_GROUP = "table-column-group"; //$NON-NLS-1$
- public final static String V_TABLE_FOOTER_GROUP = "table-footer-group"; //$NON-NLS-1$
- public final static String V_TABLE_HEADER_GROUP = "table-header-group"; //$NON-NLS-1$
- public final static String V_TABLE_ROW = "table-row"; //$NON-NLS-1$
- public final static String V_TABLE_ROW_GROUP = "table-row-group"; //$NON-NLS-1$
- public final static String V_TEAL = "teal"; //$NON-NLS-1$
- public final static String V_TEXT = "text"; //$NON-NLS-1$
- public final static String V_TEXT_TOP = "text-top"; //$NON-NLS-1$
- public final static String V_TEXT_BOTTOM = "text-bottom"; //$NON-NLS-1$
- public final static String V_THICK = "thick"; //$NON-NLS-1$
- public final static String V_THIN = "thin"; //$NON-NLS-1$
- public final static String V_THREEDDARKSHADOW = "ThreeDDarkShadow"; //$NON-NLS-1$
- public final static String V_THREEDFACE = "ThreeDFace"; //$NON-NLS-1$
- public final static String V_THREEDHIGHLIGHT = "ThreeDHighlight"; //$NON-NLS-1$
- public final static String V_THREEDLIGHTSHADOW = "ThreeDLightShadow"; //$NON-NLS-1$
- public final static String V_THREEDSHADOW = "ThreeDShadow"; //$NON-NLS-1$
- public final static String V_TOP = "top"; //$NON-NLS-1$
- public final static String V_TRANSPARENT = "transparent"; //$NON-NLS-1$
- public final static String V_ULTRA_CONDENSED = "ultra-condensed"; //$NON-NLS-1$
- public final static String V_ULTRA_EXPANDED = "ultra-expanded"; //$NON-NLS-1$
- public final static String V_UNDERLINE = "underline"; //$NON-NLS-1$
- public final static String V_UPPER_ALPHA = "upper-alpha"; //$NON-NLS-1$
- public final static String V_UPPER_LATIN = "upper-latin"; //$NON-NLS-1$
- public final static String V_UPPER_ROMAN = "upper-roman"; //$NON-NLS-1$
- public final static String V_UPPERCASE = "uppercase"; //$NON-NLS-1$
- public final static String V_VISIBLE = "visible"; //$NON-NLS-1$
- public final static String V_W_RESIZE = "w-resize"; //$NON-NLS-1$
- public final static String V_WAIT = "wait"; //$NON-NLS-1$
- public final static String V_WHITE = "white"; //$NON-NLS-1$
- public final static String V_WIDER = "wider"; //$NON-NLS-1$
- public final static String V_WINDOW = "Window"; //$NON-NLS-1$
- public final static String V_WINDOWFRAME = "WindowFrame"; //$NON-NLS-1$
- public final static String V_WINDOWTEXT = "WindowText"; //$NON-NLS-1$
- public final static String V_X_FAST = "x-fast"; //$NON-NLS-1$
- public final static String V_X_HIGH = "x-high"; //$NON-NLS-1$
- public final static String V_X_LARGE = "x-large"; //$NON-NLS-1$
- public final static String V_X_LOUD = "x-loud"; //$NON-NLS-1$
- public final static String V_X_LOW = "x-low"; //$NON-NLS-1$
- public final static String V_X_SLOW = "x-slow"; //$NON-NLS-1$
- public final static String V_X_SMALL = "x-small"; //$NON-NLS-1$
- public final static String V_X_SOFT = "x-soft"; //$NON-NLS-1$
- public final static String V_XX_SMALL = "xx-small"; //$NON-NLS-1$
- public final static String V_XX_LARGE = "xx-large"; //$NON-NLS-1$
- public final static String V_YELLOW = "yellow"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java
deleted file mode 100644
index d013f7ca6e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMContainer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMContainer extends PropCMNode {
-
- private java.util.Vector nodes = new Vector();
- private static java.util.Hashtable instances = null;
- public final static String VAL_ABSOLUTE_SIZE = "absolute-size";//$NON-NLS-1$
- public final static String VAL_BORDER_STYLE = "border-style";//$NON-NLS-1$
- public final static String VAL_BORDER_WIDTH = "border-width";//$NON-NLS-1$
- public final static String VAL_COLOR = "color";//$NON-NLS-1$
- public final static String VAL_SYSTEM_COLOR = "system-color";//$NON-NLS-1$
- public final static String VAL_GENERIC_FAMILY = "generic-family";//$NON-NLS-1$
- public final static String VAL_GENERIC_VOICE = "generic-voice";//$NON-NLS-1$
- public final static String VAL_MARGIN_WIDTH = "margin-width";//$NON-NLS-1$
- public final static String VAL_PADDING_WIDTH = "padding-width";//$NON-NLS-1$
- public final static String VAL_RELATIVE_SIZE = "relative-size";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMContainer(String name) {
- super(name);
- }
-
- /**
- *
- */
- Object appendChild(Object node) {
- if (!nodes.contains(node))
- nodes.add(node);
- return node;
- }
-
- /**
- *
- */
- public boolean canHave(String identifier) {
- int nChild = getNumChild();
- for (int i = 0; i < nChild; i++) {
- Object child = getChildAt(i);
- if (child instanceof String && identifier.equalsIgnoreCase((String) child))
- return true;
- if (child instanceof PropCMContainer && ((PropCMContainer) child).canHave(identifier))
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- public Object getChildAt(int index) {
- if (nodes == null || index < 0 || nodes.size() <= index)
- return null;
- return nodes.elementAt(index);
- }
-
- /**
- *
- */
- static PropCMContainer getContInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(20);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMContainer) node;
-
- if (PropCMNode.isLoading()) {
- // register
- node = new PropCMContainer(name);
- instances.put(name, node);
- }
-
- return (PropCMContainer) node;
- }
-
- /**
- *
- */
- void getIdentifiers(Set idents) {
- if (idents == null)
- return;
- int nChildren = nodes.size();
- for (int i = 0; i < nChildren; i++) {
- Object node = nodes.elementAt(i);
- if (node instanceof PropCMNode)
- ((PropCMNode) node).getIdentifiers(idents);
- else if (node instanceof String)
- idents.add(node);
- }
- }
-
- /**
- *
- */
- public int getNumChild() {
- if (nodes == null)
- return 0;
- return nodes.size();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_CONTAINER;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values == null)
- return;
- int nChildren = nodes.size();
- for (int i = 0; i < nChildren; i++) {
- Object node = nodes.elementAt(i);
- if (node instanceof PropCMNode)
- ((PropCMNode) node).getValues(values);
- else if (node instanceof String) {
- if (!values.contains(node))
- values.add(node);
- }
- }
- }
-
- /**
- *
- */
- Object removeChild(Object node) {
- nodes.remove(node);
- return node;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java
deleted file mode 100644
index a28e21da9f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFontProperty.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMFontProperty extends PropCMProperty {
-
- // static fields
- private static java.util.Hashtable instances = null;
- private static java.util.Hashtable cachedIdMap = null;
- // selecting properties
- public final static String PF_FONT_FAMILY = "font-family";//$NON-NLS-1$
- public final static String PF_FONT_STYLE = "font-style";//$NON-NLS-1$
- public final static String PF_FONT_VARIANT = "font-variant";//$NON-NLS-1$
- public final static String PF_FONT_WEIGHT = "font-weight";//$NON-NLS-1$
- public final static String PF_FONT_STRETCH = "font-stretch";//$NON-NLS-1$
- public final static String PF_FONT_SIZE = "font-size";//$NON-NLS-1$
- // qualification properties
- public final static String PF_UNICODE_RANGE = "unicode-range";//$NON-NLS-1$
- // numeric properties
- public final static String PF_UNITS_PER_EM = "units-per-em";//$NON-NLS-1$
- // referencing properties
- public final static String PF_SRC = "src";//$NON-NLS-1$
- // matching properties
- public final static String PF_PANOSE_1 = "panose-1";//$NON-NLS-1$
- public final static String PF_STEMV = "stemv";//$NON-NLS-1$
- public final static String PF_STEMH = "stemh";//$NON-NLS-1$
- public final static String PF_SLOPE = "slope";//$NON-NLS-1$
- public final static String PF_CAP_HEIGHT = "cap-height";//$NON-NLS-1$
- public final static String PF_X_HEIGHT = "x-height";//$NON-NLS-1$
- public final static String PF_ASCENT = "ascent";//$NON-NLS-1$
- public final static String PF_DESCENT = "descent";//$NON-NLS-1$
- // synthesis properties
- public final static String PF_WIDTHS = "widths";//$NON-NLS-1$
- public final static String PF_BBOX = "bbox";//$NON-NLS-1$
- public final static String PF_DEFINITION_SRC = "definition-src";//$NON-NLS-1$
- // alignment properties
- public final static String PF_BASELINE = "baseline";//$NON-NLS-1$
- public final static String PF_CENTERLINE = "centerline";//$NON-NLS-1$
- public final static String PF_MATHLINE = "mathline";//$NON-NLS-1$
- public final static String PF_TOPLINE = "topline";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMFontProperty(String name) {
- super(name);
- }
-
- /**
- *
- */
- public static PropCMProperty getInstanceOf(String name) {
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMProperty) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMFontProperty(name);
- instances.put(name, node);
- }
-
- return (PropCMProperty) node;
- }
-
- /**
- *
- */
- public static Enumeration getNameEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.keys();
- }
-
- /**
- *
- */
- public static Enumeration getPropertyEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.elements();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_FONTPROPERTY;
- }
-
- /**
- *
- */
- public static Vector names() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return new Vector(instances.keySet());
- }
-
- /**
- *
- */
- public static List names(Object mediaGroup) {
- if (mediaGroup == null)
- return names();
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- Vector properties = new Vector();
-
- Iterator it = instances.values().iterator();
- while (it.hasNext()) {
- PropCMProperty prop = (PropCMProperty) it.next();
- if (prop.getMediaGroups().contains(mediaGroup))
- properties.add(prop.getName());
- }
-
- return properties;
- }
-
- /**
- * If itentifier is null, get all properties
- */
- public static Vector propertiesFor(String identifier, boolean shorthands) {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // if identifier is null, get all properties
- if (identifier == null)
- return new Vector(instances.values());
-
- if (cachedIdMap == null) {
- // start cacheing
- cachedIdMap = new Hashtable();
- }
- else {
- // search cached
- Object ret = cachedIdMap.get(identifier + String.valueOf(shorthands));
- if (ret != null)
- return new Vector((Collection) ret);
- }
-
- // create
- Enumeration properties = getPropertyEnum();
- HashSet set = new HashSet();
- while (properties.hasMoreElements()) {
- PropCMProperty prop = (PropCMProperty) properties.nextElement();
- if (!shorthands && prop.isShorthand())
- continue;
- if (prop.canHave(identifier))
- set.add(prop);
- }
-
- // cache
- cachedIdMap.put(identifier + String.valueOf(shorthands), set);
-
- return new Vector(set);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java
deleted file mode 100644
index 03efc91c06..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMFunction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- *
- */
-public class PropCMFunction extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static String VAL_ATTR = "attr";//$NON-NLS-1$
- public final static String VAL_COUNTER = "counter";//$NON-NLS-1$
- public final static String VAL_RGB = "rgb";//$NON-NLS-1$
- public final static String VAL_SHAPE = "rect";//$NON-NLS-1$
- public final static String VAL_URI = "url";//$NON-NLS-1$
- public final static String VAL_FORMAT = "format";//$NON-NLS-1$
- public final static String VAL_LOCAL = "local";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMFunction(String name) {
- super(name);
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- static public PropCMFunction getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMFunction) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMFunction(name);
- instances.put(name, node);
- }
-
- return (PropCMFunction) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_FUNC;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
deleted file mode 100644
index 52a84df134..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNode.java
+++ /dev/null
@@ -1,1369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- *
- */
-public abstract class PropCMNode {
-
- public final static short VAL_IDENTIFIER = 0;
- public final static short VAL_PROPERTY = 1;
- public final static short VAL_NUMBER = 2;
- public final static short VAL_STRING = 3;
- public final static short VAL_FUNC = 4;
- public final static short VAL_CONTAINER = 5;
- public final static short VAL_SUBPROPERTY = 6;
- public final static short VAL_FONTPROPERTY = 7;
- public final static short VAL_UNICODE_RANGE = 8;
- protected java.lang.String name = null;
- private static short LOADING = 0; // 0 : not initialized, 1 : under
- // initializing, 2 : initialize-done
- // and fix DB
-
- /**
- *
- */
- public PropCMNode(String name) {
- super();
- this.name = name;
- }
-
- /**
- *
- */
- public Set getIdentifiers() {
- HashSet ids = new HashSet();
- getIdentifiers(ids);
- return ids;
- }
-
- /**
- *
- */
- abstract void getIdentifiers(Set indents);
-
- /**
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- */
- public abstract short getType();
-
- /**
- *
- */
- public Collection getValues() {
- Vector vals = new Vector();
- getValues(vals);
- return vals;
- }
-
- /**
- *
- */
- abstract void getValues(Collection values);
-
- /**
- *
- */
- protected static void initPropertyCM() {
- if (!isNeedInitialize())
- return;
- LOADING = 1;
-
- PropCMNumber.initNumberCMDim();
-
- // azimuth
- PropCMProperty prop = PropCMProperty.getInstanceOf(PropCMProperty.P_AZIMUTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_ANGLE));
- prop.appendChild(IValID.V_LEFT_SIDE);
- prop.appendChild(IValID.V_FAR_LEFT);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_CENTER_LEFT);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_CENTER_RIGHT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_FAR_RIGHT);
- prop.appendChild(IValID.V_RIGHT_SIDE);
- prop.appendChild(IValID.V_BEHIND);
- prop.appendChild(IValID.V_LEFTWARDS);
- prop.appendChild(IValID.V_RIGHTWARDS);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
- prop.setMaxValueCount(2);
-
- // background
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.setMaxValueCount(6);
-
- // background-attachment
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
- prop.appendChild(IValID.V_SCROLL);
- prop.appendChild(IValID.V_FIXED);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(IValID.V_TRANSPARENT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-image
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-position ---- sub-properties horizontal
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-position ---- sub-properties vertical
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_TOP);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_BOTTOM);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-position
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
- prop.appendChild(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X));
- prop.appendChild(PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // background-repeat
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
- prop.appendChild(IValID.V_REPEAT);
- prop.appendChild(IValID.V_REPEAT_X);
- prop.appendChild(IValID.V_REPEAT_Y);
- prop.appendChild(IValID.V_NO_REPEAT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR));
- prop.setMaxValueCount(9);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-collapse
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLLAPSE);
- prop.appendChild(IValID.V_COLLAPSE);
- prop.appendChild(IValID.V_SEPARATE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(IValID.V_TRANSPARENT);
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-spacing
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_SPACING);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-top-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-right-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-bottom-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-left-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // border-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_BOTTOM);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // caption-side
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CAPTION_SIDE);
- prop.appendChild(IValID.V_TOP);
- prop.appendChild(IValID.V_BOTTOM);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clear
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CLEAR);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_BOTH);
- prop.appendChild(IValID.V_STATIC);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties top
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_TOP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties right
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_RIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties bottom
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_BOTTOM);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip ---- sub-properties left
- prop = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_CLIP_LEFT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- ((PropCMSubProperty) prop).setContainer(PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // clip
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CLIP);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_SHAPE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // content
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CONTENT);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_COUNTER));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_ATTR));
- prop.appendChild(IValID.V_OPEN_QUOTE);
- prop.appendChild(IValID.V_CLOSE_QUOTE);
- prop.appendChild(IValID.V_NO_OPEN_QUOTE);
- prop.appendChild(IValID.V_NO_CLOSE_QUOTE);
- prop.setMaxValueCount(-1); // infinite
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // counter-increment
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_INCREMENT);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_COUNTER_ID));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // counter-reset
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_COUNTER_RESET);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_COUNTER_ID));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // cue
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // cue-after
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_AFTER);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // cue-before
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CUE_BEFORE);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // cursor
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_CURSOR);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_CROSSHAIR);
- prop.appendChild(IValID.V_DEFAULT);
- prop.appendChild(IValID.V_POINTER);
- prop.appendChild(IValID.V_MOVE);
- prop.appendChild(IValID.V_E_RESIZE);
- prop.appendChild(IValID.V_NE_RESIZE);
- prop.appendChild(IValID.V_NW_RESIZE);
- prop.appendChild(IValID.V_N_RESIZE);
- prop.appendChild(IValID.V_SE_RESIZE);
- prop.appendChild(IValID.V_SW_RESIZE);
- prop.appendChild(IValID.V_S_RESIZE);
- prop.appendChild(IValID.V_W_RESIZE);
- prop.appendChild(IValID.V_TEXT);
- prop.appendChild(IValID.V_WAIT);
- prop.appendChild(IValID.V_HELP);
- prop.setMaxValueCount(-1); // infinite
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // direction
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_DIRECTION);
- prop.appendChild(IValID.V_LTR);
- prop.appendChild(IValID.V_RTL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // display
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_DISPLAY);
- prop.appendChild(IValID.V_INLINE);
- prop.appendChild(IValID.V_BLOCK);
- prop.appendChild(IValID.V_LIST_ITEM);
- prop.appendChild(IValID.V_RUN_IN);
- prop.appendChild(IValID.V_COMPACT);
- prop.appendChild(IValID.V_MARKER);
- prop.appendChild(IValID.V_TABLE);
- prop.appendChild(IValID.V_INLINE_TABLE);
- prop.appendChild(IValID.V_TABLE_ROW_GROUP);
- prop.appendChild(IValID.V_TABLE_HEADER_GROUP);
- prop.appendChild(IValID.V_TABLE_FOOTER_GROUP);
- prop.appendChild(IValID.V_TABLE_ROW);
- prop.appendChild(IValID.V_TABLE_COLUMN_GROUP);
- prop.appendChild(IValID.V_TABLE_COLUMN);
- prop.appendChild(IValID.V_TABLE_CELL);
- prop.appendChild(IValID.V_TABLE_CAPTION);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_ALL);
-
- // elevation
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_ELEVATION);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_ANGLE));
- prop.appendChild(IValID.V_BELOW);
- prop.appendChild(IValID.V_LEVEL);
- prop.appendChild(IValID.V_ABOVE);
- prop.appendChild(IValID.V_HIGHER);
- prop.appendChild(IValID.V_LOWER);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // empty-cells
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_EMPTY_CELLS);
- prop.appendChild(IValID.V_SHOW);
- prop.appendChild(IValID.V_HIDE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // float
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FLOAT);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY));
- prop.appendChild(IValID.V_CAPTION);
- prop.appendChild(IValID.V_ICON);
- prop.appendChild(IValID.V_MENU);
- prop.appendChild(IValID.V_MESSAGE_BOX);
- prop.appendChild(IValID.V_SMALL_CAPTION);
- prop.appendChild(IValID.V_STATUS_BAR);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-family
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_FAMILY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_FONT));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY));
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-size
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-size-adjust
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_SIZE_ADJUST);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-stretch
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STRETCH);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_WIDER);
- prop.appendChild(IValID.V_NARROWER);
- prop.appendChild(IValID.V_ULTRA_CONDENSED);
- prop.appendChild(IValID.V_EXTRA_CONDENSED);
- prop.appendChild(IValID.V_CONDENSED);
- prop.appendChild(IValID.V_SEMI_CONDENSED);
- prop.appendChild(IValID.V_SEMI_EXPANDED);
- prop.appendChild(IValID.V_EXPANDED);
- prop.appendChild(IValID.V_EXTRA_EXPANDED);
- prop.appendChild(IValID.V_ULTRA_EXPANDED);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_STYLE);
- prop.appendChild(IValID.V_ITALIC);
- prop.appendChild(IValID.V_OBLIQUE);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-variant
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_VARIANT);
- prop.appendChild(IValID.V_SMALL_CAPS);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // font-weight
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_FONT_WEIGHT);
- prop.appendChild(IValID.V_BOLD);
- prop.appendChild(IValID.V_100);
- prop.appendChild(IValID.V_200);
- prop.appendChild(IValID.V_300);
- prop.appendChild(IValID.V_400);
- prop.appendChild(IValID.V_500);
- prop.appendChild(IValID.V_600);
- prop.appendChild(IValID.V_700);
- prop.appendChild(IValID.V_800);
- prop.appendChild(IValID.V_900);
- prop.appendChild(IValID.V_LIGHTER);
- prop.appendChild(IValID.V_BOLDER);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // leftt
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LEFT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // letter-spacing
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LETTER_SPACING);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // line-height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LINE_HEIGHT);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style-image
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_IMAGE);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style-position
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_POSITION);
- prop.appendChild(IValID.V_INSIDE);
- prop.appendChild(IValID.V_OUTSIDE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // list-style-type
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_LIST_STYLE_TYPE);
- prop.appendChild(IValID.V_DISC);
- prop.appendChild(IValID.V_CIRCLE);
- prop.appendChild(IValID.V_SQUARE);
- prop.appendChild(IValID.V_DECIMAL);
- prop.appendChild(IValID.V_DECIMAL_LEADING_ZERO);
- prop.appendChild(IValID.V_LOWER_ROMAN);
- prop.appendChild(IValID.V_UPPER_ROMAN);
- prop.appendChild(IValID.V_LOWER_GREEK);
- prop.appendChild(IValID.V_LOWER_ALPHA);
- prop.appendChild(IValID.V_LOWER_LATIN);
- prop.appendChild(IValID.V_UPPER_ALPHA);
- prop.appendChild(IValID.V_UPPER_LATIN);
- prop.appendChild(IValID.V_HEBREW);
- prop.appendChild(IValID.V_ARMENIAN);
- prop.appendChild(IValID.V_GEORGIAN);
- prop.appendChild(IValID.V_CJK_IDEOGRAPHIC);
- prop.appendChild(IValID.V_HIRAGANA);
- prop.appendChild(IValID.V_KATAKANA);
- prop.appendChild(IValID.V_HIRAGANA_IROHA);
- prop.appendChild(IValID.V_KATAKANA_IROHA);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN);
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_TOP);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_RIGHT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_BOTTOM);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // margin-left
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARGIN_LEFT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // marker-offset
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARKER_OFFSET);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // marks
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MARKS);
- prop.appendChild(IValID.V_CROP);
- prop.appendChild(IValID.V_CROSS);
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // max-height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // max-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MAX_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // min-height
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // min-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_MIN_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // orphans
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_ORPHANS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // outline
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE);
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH));
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // outline-color
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_COLOR);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(IValID.V_INVERT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // outline-style
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_STYLE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // outline-width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OUTLINE_WIDTH);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_INTERACTIVE);
-
- // overflow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_OVERFLOW);
- prop.appendChild(IValID.V_VISIBLE);
- prop.appendChild(IValID.V_HIDDEN);
- prop.appendChild(IValID.V_SCROLL);
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING);
- // prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM));
- prop.appendChild(PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT));
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_TOP);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_RIGHT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-bottom
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_BOTTOM);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // padding-left
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PADDING_LEFT);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // page
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_PAGE_ID));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // page-break-after
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_AFTER);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_ALWAYS);
- prop.appendChild(IValID.V_AVOID);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // page-break-before
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_BEFORE);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_ALWAYS);
- prop.appendChild(IValID.V_AVOID);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // page-break-inside
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAGE_BREAK_INSIDE);
- prop.appendChild(IValID.V_AVOID);
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // pause
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pause-after
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_AFTER);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pause-before
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PAUSE_BEFORE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_TIME));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pitch
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_FREQUENCY));
- prop.appendChild(IValID.V_X_LOW);
- prop.appendChild(IValID.V_LOW);
- prop.appendChild(IValID.V_MEDIUM);
- prop.appendChild(IValID.V_HIGH);
- prop.appendChild(IValID.V_X_HIGH);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // pitch-range
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PITCH_RANGE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // play-during
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_PLAY_DURING);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(IValID.V_MIX);
- prop.appendChild(IValID.V_REPEAT);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(3);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // position
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_POSITION);
- prop.appendChild(IValID.V_ABSOLUTE);
- prop.appendChild(IValID.V_RELATIVE);
- prop.appendChild(IValID.V_FIXED);
- prop.appendChild(IValID.V_STATIC);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // quotes
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_QUOTES);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // richness
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RICHNESS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // right
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_RIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // size
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SIZE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_PORTRAIT);
- prop.appendChild(IValID.V_LANDSCAPE);
- prop.setMaxValueCount(2);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // speak
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_NONE);
- prop.appendChild(IValID.V_SPELL_OUT);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speak-header
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_HEADER);
- prop.appendChild(IValID.V_ONCE);
- prop.appendChild(IValID.V_ALWAYS);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speak-numeral
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_NUMERAL);
- prop.appendChild(IValID.V_DIGITS);
- prop.appendChild(IValID.V_CONTINUOUS);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speak-punctuation
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEAK_PUNCTUATION);
- prop.appendChild(IValID.V_CODE);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // speech-rate
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_SPEECH_RATE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(IValID.V_X_SLOW);
- prop.appendChild(IValID.V_SLOW);
- prop.appendChild(IValID.V_MEDIUM);
- prop.appendChild(IValID.V_FAST);
- prop.appendChild(IValID.V_X_FAST);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // stress
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_STRESS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // table-layout
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TABLE_LAYOUT);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(IValID.V_FIXED);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-align
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_ALIGN);
- prop.appendChild(IValID.V_LEFT);
- prop.appendChild(IValID.V_CENTER);
- prop.appendChild(IValID.V_RIGHT);
- prop.appendChild(IValID.V_JUSTIFY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_ANY));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-decoration
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_DECORATION);
- prop.appendChild(IValID.V_UNDERLINE);
- prop.appendChild(IValID.V_OVERLINE);
- prop.appendChild(IValID.V_LINE_THROUGH);
- prop.appendChild(IValID.V_BLINK);
- prop.appendChild(IValID.V_NONE);
- prop.setMaxValueCount(4);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-indent
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_INDENT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-shadow
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_SHADOW);
- prop.appendChild(IValID.V_NONE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // text-transform
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TEXT_TRANSFORM);
- prop.appendChild(IValID.V_CAPITALIZE);
- prop.appendChild(IValID.V_UPPERCASE);
- prop.appendChild(IValID.V_LOWERCASE);
- prop.appendChild(IValID.V_NONE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // top
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_TOP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // unicode-bidi
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_UNICODE_BIDI);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_EMBED);
- prop.appendChild(IValID.V_BIDI_OVERRIDE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // vertical-align
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VERTICAL_ALIGN);
- prop.appendChild(IValID.V_BOTTOM);
- prop.appendChild(IValID.V_TEXT_BOTTOM);
- prop.appendChild(IValID.V_SUB);
- prop.appendChild(IValID.V_BASELINE);
- prop.appendChild(IValID.V_MIDDLE);
- prop.appendChild(IValID.V_SUPER);
- prop.appendChild(IValID.V_TEXT_TOP);
- prop.appendChild(IValID.V_TOP);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // visibility
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VISIBILITY);
- prop.appendChild(IValID.V_VISIBLE);
- prop.appendChild(IValID.V_HIDDEN);
- prop.appendChild(IValID.V_COLLAPSE);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // voice-family
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VOICE_FAMILY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_VOICE));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_VOICE));
- prop.setMaxValueCount(-1);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // volume
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_VOLUME);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_SILENT);
- prop.appendChild(IValID.V_X_SOFT);
- prop.appendChild(IValID.V_SOFT);
- prop.appendChild(IValID.V_MEDIUM);
- prop.appendChild(IValID.V_LOUD);
- prop.appendChild(IValID.V_X_LOUD);
- prop.appendMediaGroup(IMediaGroupID.M_AURAL);
-
- // white-space
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WHITE_SPACE);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_PRE);
- prop.appendChild(IValID.V_NOWRAP);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // widows
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WIDOWS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
- prop.appendMediaGroup(IMediaGroupID.M_PAGED);
-
- // width
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WIDTH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_AUTO);
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // word-spacing
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_WORD_SPACING);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- // z-index
- prop = PropCMProperty.getInstanceOf(PropCMProperty.P_Z_INDEX);
- prop.appendChild(IValID.V_AUTO);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.appendMediaGroup(IMediaGroupID.M_VISUAL);
-
- /** ******** font properties ********* */
- // font-family
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_FAMILY);
- prop.appendChild(PropCMString.getInstanceOf(PropCMString.VAL_FONT));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY));
- prop.setMaxValueCount(-1);
-
- // font-style
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_STYLE);
- prop.appendChild(IValID.V_ITALIC);
- prop.appendChild(IValID.V_OBLIQUE);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // font-variant
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_VARIANT);
- prop.appendChild(IValID.V_SMALL_CAPS);
- prop.appendChild(IValID.V_NORMAL);
- prop.setMaxValueCount(-1);
-
- // font-weight
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_WEIGHT);
- prop.appendChild(IValID.V_BOLD);
- prop.appendChild(IValID.V_100);
- prop.appendChild(IValID.V_200);
- prop.appendChild(IValID.V_300);
- prop.appendChild(IValID.V_400);
- prop.appendChild(IValID.V_500);
- prop.appendChild(IValID.V_600);
- prop.appendChild(IValID.V_700);
- prop.appendChild(IValID.V_800);
- prop.appendChild(IValID.V_900);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // font-stretch
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_STRETCH);
- prop.appendChild(IValID.V_NORMAL);
- prop.appendChild(IValID.V_ULTRA_CONDENSED);
- prop.appendChild(IValID.V_EXTRA_CONDENSED);
- prop.appendChild(IValID.V_CONDENSED);
- prop.appendChild(IValID.V_SEMI_CONDENSED);
- prop.appendChild(IValID.V_SEMI_EXPANDED);
- prop.appendChild(IValID.V_EXPANDED);
- prop.appendChild(IValID.V_EXTRA_EXPANDED);
- prop.appendChild(IValID.V_ULTRA_EXPANDED);
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // font-size
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_FONT_SIZE);
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE));
- prop.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- prop.appendChild(IValID.V_ALL);
- prop.setMaxValueCount(-1);
-
- // unicode-range
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_UNICODE_RANGE);
- prop.appendChild(PropCMURange.getInstanceOf(PropCMURange.VAL_URANGE));
- prop.setMaxValueCount(-1);
-
- // units-per-em
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_UNITS_PER_EM);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // src
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_SRC);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_FORMAT));
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_LOCAL));
- prop.setMaxValueCount(-1);
-
- // panose-1
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_PANOSE_1);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_INTEGER));
- prop.setMaxValueCount(10);
-
- // stemv
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_STEMV);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // stemh
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_STEMH);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // slope
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_SLOPE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // cap-height
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_CAP_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // x-height
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_X_HEIGHT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // ascent
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_ASCENT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // descent
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_DESCENT);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // widths
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_WIDTHS);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.appendChild(PropCMURange.getInstanceOf(PropCMURange.VAL_URANGE));
- prop.setMaxValueCount(-1);
-
- // bbox
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_BBOX);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
- prop.setMaxValueCount(4);
- prop.setMaxValueCount(4);
-
- // definition-src
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_DEFINITION_SRC);
- prop.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_URI));
-
- // baseline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_BASELINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // centerline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_CENTERLINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // mathline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_MATHLINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- // topline
- prop = PropCMFontProperty.getInstanceOf(PropCMFontProperty.PF_TOPLINE);
- prop.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_NUM));
-
- /** ******** containers ********* */
-
- // absolute-size
- PropCMContainer cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_ABSOLUTE_SIZE);
- cont.appendChild(IValID.V_XX_SMALL);
- cont.appendChild(IValID.V_X_SMALL);
- cont.appendChild(IValID.V_SMALL);
- cont.appendChild(IValID.V_MEDIUM);
- cont.appendChild(IValID.V_LARGE);
- cont.appendChild(IValID.V_X_LARGE);
- cont.appendChild(IValID.V_XX_LARGE);
-
- // border-style
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_STYLE);
- cont.appendChild(IValID.V_SOLID);
- cont.appendChild(IValID.V_DASHED);
- cont.appendChild(IValID.V_DOTTED);
- cont.appendChild(IValID.V_DOUBLE);
- cont.appendChild(IValID.V_GROOVE);
- cont.appendChild(IValID.V_RIDGE);
- cont.appendChild(IValID.V_INSET);
- cont.appendChild(IValID.V_OUTSET);
- cont.appendChild(IValID.V_HIDDEN);
- cont.appendChild(IValID.V_NONE);
-
- // border-width
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_BORDER_WIDTH);
- cont.appendChild(IValID.V_THIN);
- cont.appendChild(IValID.V_MEDIUM);
- cont.appendChild(IValID.V_THICK);
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
-
- // color
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_COLOR);
- cont.appendChild(IValID.V_AQUA);
- cont.appendChild(IValID.V_BLACK);
- cont.appendChild(IValID.V_BLUE);
- cont.appendChild(IValID.V_FUCHSIA);
- cont.appendChild(IValID.V_GRAY);
- cont.appendChild(IValID.V_GREEN);
- cont.appendChild(IValID.V_LIME);
- cont.appendChild(IValID.V_MAROON);
- cont.appendChild(IValID.V_NAVY);
- cont.appendChild(IValID.V_OLIVE);
- cont.appendChild(IValID.V_PURPLE);
- cont.appendChild(IValID.V_RED);
- cont.appendChild(IValID.V_SILVER);
- cont.appendChild(IValID.V_TEAL);
- cont.appendChild(IValID.V_WHITE);
- cont.appendChild(IValID.V_YELLOW);
- cont.appendChild(PropCMContainer.getContInstanceOf(PropCMContainer.VAL_SYSTEM_COLOR));
- cont.appendChild(PropCMFunction.getInstanceOf(PropCMFunction.VAL_RGB));
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_HASH));
-
- // system color
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_SYSTEM_COLOR);
- cont.appendChild(IValID.V_ACTIVEBORDER);
- cont.appendChild(IValID.V_ACTIVECAPTION);
- cont.appendChild(IValID.V_APPWORKSPACE);
- cont.appendChild(IValID.V_BACKGROUND);
- cont.appendChild(IValID.V_BUTTONFACE);
- cont.appendChild(IValID.V_BUTTONHIGHLIGHT);
- cont.appendChild(IValID.V_BUTTONSHADOW);
- cont.appendChild(IValID.V_BUTTONTEXT);
- cont.appendChild(IValID.V_CAPTIONTEXT);
- cont.appendChild(IValID.V_GRAYTEXT);
- cont.appendChild(IValID.V_HIGHLIGHT);
- cont.appendChild(IValID.V_HIGHLIGHTTEXT);
- cont.appendChild(IValID.V_INACTIVEBORDER);
- cont.appendChild(IValID.V_INACTIVECAPTION);
- cont.appendChild(IValID.V_INACTIVECAPTIONTEXT);
- cont.appendChild(IValID.V_INFOBACKGROUND);
- cont.appendChild(IValID.V_INFOTEXT);
- cont.appendChild(IValID.V_MENU);
- cont.appendChild(IValID.V_MENUTEXT);
- cont.appendChild(IValID.V_SCROLLBAR);
- cont.appendChild(IValID.V_THREEDDARKSHADOW);
- cont.appendChild(IValID.V_THREEDFACE);
- cont.appendChild(IValID.V_THREEDHIGHLIGHT);
- cont.appendChild(IValID.V_THREEDLIGHTSHADOW);
- cont.appendChild(IValID.V_THREEDSHADOW);
- cont.appendChild(IValID.V_WINDOW);
- cont.appendChild(IValID.V_WINDOWFRAME);
- cont.appendChild(IValID.V_WINDOWTEXT);
-
- // generic-family
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_FAMILY);
- cont.appendChild(IValID.V_SERIF);
- cont.appendChild(IValID.V_SANS_SERIF);
- cont.appendChild(IValID.V_CURSIVE);
- cont.appendChild(IValID.V_FANTASY);
- cont.appendChild(IValID.V_MONOSPACE);
-
- // generic-voice
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_GENERIC_VOICE);
- cont.appendChild(IValID.V_MALE);
- cont.appendChild(IValID.V_FEMALE);
- cont.appendChild(IValID.V_CHILD);
-
- // margin-width
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_MARGIN_WIDTH);
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
- cont.appendChild(IValID.V_AUTO);
-
- // padding-width
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_PADDING_WIDTH);
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_LENGTH));
- cont.appendChild(PropCMNumber.getInstanceOf(PropCMNumber.VAL_PERCENTAGE));
-
- // relative-size
- cont = PropCMContainer.getContInstanceOf(PropCMContainer.VAL_RELATIVE_SIZE);
- cont.appendChild(IValID.V_SMALLER);
- cont.appendChild(IValID.V_LARGER);
-
- LOADING = 2;
- }
-
- /**
- *
- */
- protected static boolean isLoading() {
- return LOADING == 1;
- }
-
- /**
- *
- */
- protected static boolean isNeedInitialize() {
- return LOADING == 0;
- }
-
- /**
- *
- */
- public String toString() {
- return getName();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java
deleted file mode 100644
index 3896bb53c7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMNumber.java
+++ /dev/null
@@ -1,219 +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.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-public class PropCMNumber extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static java.lang.String VAL_ANGLE = "angle";//$NON-NLS-1$
- public final static java.lang.String VAL_FREQUENCY = "frequency";//$NON-NLS-1$
- public final static java.lang.String VAL_INTEGER = "integer";//$NON-NLS-1$
- public final static java.lang.String VAL_LENGTH = "length";//$NON-NLS-1$
- public final static java.lang.String VAL_PERCENTAGE = "percentage";//$NON-NLS-1$
- public final static java.lang.String VAL_TIME = "time";//$NON-NLS-1$
- public final static java.lang.String VAL_HASH = "hash"; //$NON-NLS-1$
- public final static java.lang.String VAL_NUM = "number";//$NON-NLS-1$
- public final static String DIM_CM = "cm";//$NON-NLS-1$
- public final static String DIM_DEG = "deg";//$NON-NLS-1$
- public final static String DIM_EMS = "em";//$NON-NLS-1$
- public final static String DIM_EXS = "ex";//$NON-NLS-1$
- public final static String DIM_GRAD = "grad";//$NON-NLS-1$
- public final static String DIM_HASH = "#";//$NON-NLS-1$
- public final static String DIM_HZ = "Hz";//$NON-NLS-1$
- public final static String DIM_IN = "in";//$NON-NLS-1$
- public final static String DIM_INTEGER = "INTEGER";//$NON-NLS-1$
- public final static String DIM_KHZ = "kHz";//$NON-NLS-1$
- public final static String DIM_MM = "mm";//$NON-NLS-1$
- public final static String DIM_MS = "ms";//$NON-NLS-1$
- public final static String DIM_NUMBER = "NUMBER";//$NON-NLS-1$
- public final static String DIM_PC = "pc";//$NON-NLS-1$
- public final static String DIM_PERCENTAGE = "%";//$NON-NLS-1$
- public final static String DIM_PT = "pt";//$NON-NLS-1$
- public final static String DIM_PX = "px";//$NON-NLS-1$
- public final static String DIM_RAD = "rad";//$NON-NLS-1$
- public final static String DIM_S = "s";//$NON-NLS-1$
- private java.util.Vector fDims = new Vector();
-
- /**
- *
- */
- protected PropCMNumber(String name) {
- super(name);
- }
-
- /**
- *
- */
- public static String getDimension(short primitiveType) {
- switch (primitiveType) {
- case CSSPrimitiveValue.CSS_CM :
- return DIM_CM;
- case CSSPrimitiveValue.CSS_DEG :
- return DIM_DEG;
- case CSSPrimitiveValue.CSS_EMS :
- return DIM_EMS;
- case CSSPrimitiveValue.CSS_EXS :
- return DIM_EXS;
- case CSSPrimitiveValue.CSS_GRAD :
- return DIM_GRAD;
- case ICSSPrimitiveValue.CSS_HASH :
- return DIM_HASH; // prefix dimension ....
- case CSSPrimitiveValue.CSS_HZ :
- return DIM_HZ;
- case CSSPrimitiveValue.CSS_IN :
- return DIM_IN;
- case ICSSPrimitiveValue.CSS_INTEGER :
- return "";//$NON-NLS-1$
- case CSSPrimitiveValue.CSS_KHZ :
- return DIM_KHZ;
- case CSSPrimitiveValue.CSS_MM :
- return DIM_MM;
- case CSSPrimitiveValue.CSS_MS :
- return DIM_MS;
- case CSSPrimitiveValue.CSS_NUMBER :
- return "";//$NON-NLS-1$
- case CSSPrimitiveValue.CSS_PC :
- return DIM_PC;
- case CSSPrimitiveValue.CSS_PERCENTAGE :
- return DIM_PERCENTAGE;
- case CSSPrimitiveValue.CSS_PT :
- return DIM_PT;
- case CSSPrimitiveValue.CSS_PX :
- return DIM_PX;
- case CSSPrimitiveValue.CSS_RAD :
- return DIM_RAD;
- case CSSPrimitiveValue.CSS_S :
- return DIM_S;
- }
-
- return null;
- }
-
- /**
- *
- */
- public Set getDimensions() {
- HashSet vals = new HashSet();
- Iterator it = fDims.iterator();
- while (it.hasNext()) {
- vals.add(it.next());
- }
-
- return vals;
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- static public PropCMNumber getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(20);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMNumber) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMNumber(name);
- instances.put(name, node);
- }
-
- return (PropCMNumber) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_NUMBER;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-
- /**
- *
- */
- static void initNumberCMDim() {
- PropCMNumber num = getInstanceOf(VAL_ANGLE);
- num.fDims.add(DIM_DEG);
- num.fDims.add(DIM_GRAD);
- num.fDims.add(DIM_RAD);
-
- num = getInstanceOf(VAL_FREQUENCY);
- num.fDims.add(DIM_HZ);
- num.fDims.add(DIM_KHZ);
-
- num = getInstanceOf(VAL_HASH);
- num.fDims.add(DIM_HASH);
-
- // num = getInstanceOf(VAL_INTEGER);
- // num.fDims.add(DIM_INTEGER);
-
- num = getInstanceOf(VAL_LENGTH);
- num.fDims.add(DIM_CM);
- num.fDims.add(DIM_EMS);
- num.fDims.add(DIM_EXS);
- num.fDims.add(DIM_IN);
- num.fDims.add(DIM_MM);
- num.fDims.add(DIM_PC);
- num.fDims.add(DIM_PT);
- num.fDims.add(DIM_PX);
-
- // num = getInstanceOf(VAL_NUMBER);
- // num.fDims.add(DIM_NUMBER);
-
- num = getInstanceOf(VAL_PERCENTAGE);
- num.fDims.add(DIM_PERCENTAGE);
-
- num = getInstanceOf(VAL_TIME);
- num.fDims.add(DIM_MS);
- num.fDims.add(DIM_S);
-
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
deleted file mode 100644
index bbab38f642..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMProperty.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMProperty extends PropCMContainer {
-
- // static fields
- private static java.util.Hashtable instances = null;
- private static java.util.Hashtable cachedIdMap = null;
- public final static String P_AZIMUTH = "azimuth";//$NON-NLS-1$
- public final static String P_BG = "background";//$NON-NLS-1$
- public final static String P_BG_ATTACHMENT = "background-attachment";//$NON-NLS-1$
- public final static String P_BG_COLOR = "background-color";//$NON-NLS-1$
- public final static String P_BG_IMAGE = "background-image";//$NON-NLS-1$
- public final static String P_BG_POSITION = "background-position";//$NON-NLS-1$
- public final static String P_BG_REPEAT = "background-repeat";//$NON-NLS-1$
- public final static String P_BORDER = "border";//$NON-NLS-1$
- public final static String P_BORDER_COLLAPSE = "border-collapse";//$NON-NLS-1$
- public final static String P_BORDER_COLOR = "border-color";//$NON-NLS-1$
- public final static String P_BORDER_SPACING = "border-spacing";//$NON-NLS-1$
- public final static String P_BORDER_STYLE = "border-style";//$NON-NLS-1$
- public final static String P_BORDER_TOP = "border-top";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT = "border-right";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM = "border-bottom";//$NON-NLS-1$
- public final static String P_BORDER_LEFT = "border-left";//$NON-NLS-1$
- public final static String P_BORDER_TOP_COLOR = "border-top-color";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT_COLOR = "border-right-color";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_COLOR = "border-bottom-color";//$NON-NLS-1$
- public final static String P_BORDER_LEFT_COLOR = "border-left-color";//$NON-NLS-1$
- public final static String P_BORDER_TOP_STYLE = "border-top-style";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT_STYLE = "border-right-style";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_STYLE = "border-bottom-style";//$NON-NLS-1$
- public final static String P_BORDER_LEFT_STYLE = "border-left-style";//$NON-NLS-1$
- public final static String P_BORDER_TOP_WIDTH = "border-top-width";//$NON-NLS-1$
- public final static String P_BORDER_RIGHT_WIDTH = "border-right-width";//$NON-NLS-1$
- public final static String P_BORDER_BOTTOM_WIDTH = "border-bottom-width";//$NON-NLS-1$
- public final static String P_BORDER_LEFT_WIDTH = "border-left-width";//$NON-NLS-1$
- public final static String P_BORDER_WIDTH = "border-width";//$NON-NLS-1$
- public final static String P_BOTTOM = "bottom";//$NON-NLS-1$
- public final static String P_CAPTION_SIDE = "caption-side";//$NON-NLS-1$
- public final static String P_CLEAR = "clear";//$NON-NLS-1$
- public final static String P_CLIP = "clip";//$NON-NLS-1$
- public final static String P_COLOR = "color";//$NON-NLS-1$
- public final static String P_CONTENT = "content";//$NON-NLS-1$
- public final static String P_COUNTER_INCREMENT = "counter-increment";//$NON-NLS-1$
- public final static String P_COUNTER_RESET = "counter-reset";//$NON-NLS-1$
- public final static String P_CUE = "cue";//$NON-NLS-1$
- public final static String P_CUE_AFTER = "cue-after";//$NON-NLS-1$
- public final static String P_CUE_BEFORE = "cue-before";//$NON-NLS-1$
- public final static String P_CURSOR = "cursor";//$NON-NLS-1$
- public final static String P_DIRECTION = "direction";//$NON-NLS-1$
- public final static String P_DISPLAY = "display";//$NON-NLS-1$
- public final static String P_ELEVATION = "elevation";//$NON-NLS-1$
- public final static String P_EMPTY_CELLS = "empty-cells";//$NON-NLS-1$
- public final static String P_FLOAT = "float";//$NON-NLS-1$
- public final static String P_FONT = "font";//$NON-NLS-1$
- public final static String P_FONT_FAMILY = "font-family";//$NON-NLS-1$
- public final static String P_FONT_SIZE = "font-size";//$NON-NLS-1$
- public final static String P_FONT_SIZE_ADJUST = "font-size-adjust";//$NON-NLS-1$
- public final static String P_FONT_STRETCH = "font-stretch";//$NON-NLS-1$
- public final static String P_FONT_STYLE = "font-style";//$NON-NLS-1$
- public final static String P_FONT_VARIANT = "font-variant";//$NON-NLS-1$
- public final static String P_FONT_WEIGHT = "font-weight";//$NON-NLS-1$
- public final static String P_HEIGHT = "height";//$NON-NLS-1$
- public final static String P_LEFT = "left";//$NON-NLS-1$
- public final static String P_LETTER_SPACING = "letter-spacing";//$NON-NLS-1$
- public final static String P_LINE_HEIGHT = "line-height";//$NON-NLS-1$
- public final static String P_LIST_STYLE = "list-style";//$NON-NLS-1$
- public final static String P_LIST_STYLE_IMAGE = "list-style-image";//$NON-NLS-1$
- public final static String P_LIST_STYLE_POSITION = "list-style-position";//$NON-NLS-1$
- public final static String P_LIST_STYLE_TYPE = "list-style-type";//$NON-NLS-1$
- public final static String P_MARGIN = "margin";//$NON-NLS-1$
- public final static String P_MARGIN_TOP = "margin-top";//$NON-NLS-1$
- public final static String P_MARGIN_RIGHT = "margin-right";//$NON-NLS-1$
- public final static String P_MARGIN_BOTTOM = "margin-bottom";//$NON-NLS-1$
- public final static String P_MARGIN_LEFT = "margin-left";//$NON-NLS-1$
- public final static String P_MARKER_OFFSET = "marker-offset";//$NON-NLS-1$
- public final static String P_MARKS = "marks";//$NON-NLS-1$
- public final static String P_MAX_HEIGHT = "max-height";//$NON-NLS-1$
- public final static String P_MAX_WIDTH = "max-width";//$NON-NLS-1$
- public final static String P_MIN_HEIGHT = "min-height";//$NON-NLS-1$
- public final static String P_MIN_WIDTH = "min-width";//$NON-NLS-1$
- public final static String P_ORPHANS = "orphans";//$NON-NLS-1$
- public final static String P_OUTLINE = "outline";//$NON-NLS-1$
- public final static String P_OUTLINE_COLOR = "outline-color";//$NON-NLS-1$
- public final static String P_OUTLINE_STYLE = "outline-style";//$NON-NLS-1$
- public final static String P_OUTLINE_WIDTH = "outline-width";//$NON-NLS-1$
- public final static String P_OVERFLOW = "overflow";//$NON-NLS-1$
- public final static String P_PADDING = "padding";//$NON-NLS-1$
- public final static String P_PADDING_TOP = "padding-top";//$NON-NLS-1$
- public final static String P_PADDING_RIGHT = "padding-right";//$NON-NLS-1$
- public final static String P_PADDING_BOTTOM = "padding-bottom";//$NON-NLS-1$
- public final static String P_PADDING_LEFT = "padding-left";//$NON-NLS-1$
- public final static String P_PAGE = "page";//$NON-NLS-1$
- public final static String P_PAGE_BREAK_AFTER = "page-break-after";//$NON-NLS-1$
- public final static String P_PAGE_BREAK_BEFORE = "page-break-before";//$NON-NLS-1$
- public final static String P_PAGE_BREAK_INSIDE = "page-break-inside";//$NON-NLS-1$
- public final static String P_PAUSE = "pause";//$NON-NLS-1$
- public final static String P_PAUSE_AFTER = "pause-after";//$NON-NLS-1$
- public final static String P_PAUSE_BEFORE = "pause-before";//$NON-NLS-1$
- public final static String P_PITCH = "pitch";//$NON-NLS-1$
- public final static String P_PITCH_RANGE = "pitch-range";//$NON-NLS-1$
- public final static String P_PLAY_DURING = "play-during";//$NON-NLS-1$
- public final static String P_POSITION = "position";//$NON-NLS-1$
- public final static String P_QUOTES = "quotes";//$NON-NLS-1$
- public final static String P_RICHNESS = "richness";//$NON-NLS-1$
- public final static String P_RIGHT = "right";//$NON-NLS-1$
- public final static String P_SIZE = "size";//$NON-NLS-1$
- public final static String P_SPEAK = "speak";//$NON-NLS-1$
- public final static String P_SPEAK_HEADER = "speak-header";//$NON-NLS-1$
- public final static String P_SPEAK_NUMERAL = "speak-numeral";//$NON-NLS-1$
- public final static String P_SPEAK_PUNCTUATION = "speak-punctuation";//$NON-NLS-1$
- public final static String P_SPEECH_RATE = "speech-rate";//$NON-NLS-1$
- public final static String P_STRESS = "stress";//$NON-NLS-1$
- public final static String P_TABLE_LAYOUT = "table-layout";//$NON-NLS-1$
- public final static String P_TEXT_ALIGN = "text-align";//$NON-NLS-1$
- public final static String P_TEXT_DECORATION = "text-decoration";//$NON-NLS-1$
- public final static String P_TEXT_INDENT = "text-indent";//$NON-NLS-1$
- public final static String P_TEXT_SHADOW = "text-shadow";//$NON-NLS-1$
- public final static String P_TEXT_TRANSFORM = "text-transform";//$NON-NLS-1$
- public final static String P_TOP = "top";//$NON-NLS-1$
- public final static String P_UNICODE_BIDI = "unicode-bidi";//$NON-NLS-1$
- public final static String P_VERTICAL_ALIGN = "vertical-align";//$NON-NLS-1$
- public final static String P_VISIBILITY = "visibility";//$NON-NLS-1$
- public final static String P_VOICE_FAMILY = "voice-family";//$NON-NLS-1$
- public final static String P_VOLUME = "volume";//$NON-NLS-1$
- public final static String P_WHITE_SPACE = "white-space";//$NON-NLS-1$
- public final static String P_WIDOWS = "widows";//$NON-NLS-1$
- public final static String P_WIDTH = "width";//$NON-NLS-1$
- public final static String P_WORD_SPACING = "word-spacing";//$NON-NLS-1$
- public final static String P_Z_INDEX = "z-index";//$NON-NLS-1$
- // instance fields
- private int fMinValueCount = 1;
- private int fMaxValueCount = 1;
- private Object[] mediaGroups;
- protected List containers;
-
- /**
- *
- */
- protected PropCMProperty(String name) {
- super(name);
- }
-
- /**
- *
- */
- Object appendChild(Object node) {
- Object ret = super.appendChild(node);
- if (node instanceof PropCMProperty) {
- // register shorthand container
- PropCMProperty cm = (PropCMProperty) node;
- if (cm.containers == null)
- cm.containers = new Vector();
- if (!cm.containers.contains(this))
- cm.containers.add(this);
- }
- return ret;
- }
-
- /**
- *
- */
- void appendMediaGroup(Object mg) {
- if (mediaGroups == null)
- mediaGroups = new Object[1];
- else {
- Object[] oldMediaGroups = mediaGroups;
- mediaGroups = new Object[oldMediaGroups.length + 1];
- System.arraycopy(oldMediaGroups, 0, mediaGroups, 0, oldMediaGroups.length);
- }
- mediaGroups[mediaGroups.length - 1] = mg;
- }
-
- /**
- *
- */
- public static PropCMProperty getInstanceOf(String name) {
- // initialize
- if (instances == null)
- instances = new Hashtable(200);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMProperty) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMProperty(name);
- instances.put(name, node);
- }
-
- return (PropCMProperty) node;
- }
-
- /**
- *
- */
- public int getMaxValueCount() {
- return fMaxValueCount;
- }
-
- /**
- *
- */
- public List getMediaGroups() {
- if (mediaGroups != null)
- return Arrays.asList(mediaGroups);
- else
- return new ArrayList();
- }
-
- /**
- *
- */
- public int getMinValueCount() {
- return fMinValueCount;
- }
-
- /**
- *
- */
- public static Enumeration getNameEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.keys();
- }
-
- /**
- *
- */
- public static Enumeration getPropertyEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.elements();
- }
-
- /**
- *
- */
- public int getShorthandContainerCount() {
- return (containers == null) ? 0 : containers.size();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_PROPERTY;
- }
-
- /**
- *
- */
- public boolean isShorthand() {
- int nChild = getNumChild();
- for (int i = 0; i < nChild; i++) {
- Object obj = getChildAt(i);
- if (obj instanceof PropCMProperty && !(obj instanceof PropCMSubProperty))
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- public static Vector names() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return new Vector(instances.keySet());
- }
-
- /**
- *
- */
- public static List names(Object mediaGroup) {
- if (mediaGroup == null)
- return names();
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- Vector properties = new Vector();
-
- Iterator it = instances.values().iterator();
- while (it.hasNext()) {
- PropCMProperty prop = (PropCMProperty) it.next();
- if (prop.getMediaGroups().contains(mediaGroup))
- properties.add(prop.getName());
- }
-
- return properties;
- }
-
- /**
- * If identifier is null, get all properties
- */
- public static Vector propertiesFor(String identifier, boolean shorthands) {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // if identifier is null, get all properties
- if (identifier == null)
- return new Vector(instances.values());
-
- if (cachedIdMap == null) {
- // start cacheing
- cachedIdMap = new Hashtable();
- }
- else {
- // search cached
- Object ret = cachedIdMap.get(identifier + String.valueOf(shorthands));
- if (ret != null)
- return new Vector((Collection) ret);
- }
-
- // create
- Enumeration propertyEnum = getPropertyEnum();
- HashSet set = new HashSet();
- while (propertyEnum.hasMoreElements()) {
- PropCMProperty prop = (PropCMProperty) propertyEnum.nextElement();
- if (!shorthands && prop.isShorthand())
- continue;
- if (prop.canHave(identifier))
- set.add(prop);
- }
-
- // cache
- cachedIdMap.put(identifier + String.valueOf(shorthands), set);
-
- return new Vector(set);
- }
-
- /**
- *
- */
- protected void setMaxValueCount(int newMaxValueCount) {
- fMaxValueCount = newMaxValueCount;
- }
-
- /**
- *
- */
- protected void setMinValueCount(int newMinValueCount) {
- fMinValueCount = newMinValueCount;
- }
-
- /**
- *
- */
- public PropCMProperty shorthandContainerAt(int i) {
- if (containers == null)
- return null;
- if (i < 0 || containers.size() <= i)
- return null;
- return (PropCMProperty) containers.get(i);
- }
-
- /**
- *
- */
- public Iterator shorthandContainerIterator() {
- if (containers == null) {
- return new Iterator() {
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- return null;
- }
-
- public void remove() {
- }
- };
- }
- else
- return containers.iterator();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java
deleted file mode 100644
index 00a1e82008..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMString.java
+++ /dev/null
@@ -1,85 +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.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- *
- */
-public class PropCMString extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static java.lang.String VAL_FONT = "font";//$NON-NLS-1$
- public final static java.lang.String VAL_COUNTER_ID = "counterId";//$NON-NLS-1$
- public final static java.lang.String VAL_PAGE_ID = "pageId";//$NON-NLS-1$
- public final static java.lang.String VAL_VOICE = "voice";//$NON-NLS-1$
- public final static java.lang.String VAL_ANY = "any"; //$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMString(String name) {
- super(name);
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- static public PropCMString getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMString) node;
-
- // register
- node = new PropCMString(name);
- instances.put(name, node);
-
- return (PropCMString) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_STRING;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java
deleted file mode 100644
index 81ebb3733d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMSubProperty.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-/**
- *
- */
-public class PropCMSubProperty extends PropCMProperty {
-
- // static fields
- private static java.util.Hashtable instances = null;
- public final static String PSUB_BG_POSITION_X = "background-positionH";//$NON-NLS-1$
- public final static String PSUB_BG_POSITION_Y = "background-positionV";//$NON-NLS-1$
- public final static String PSUB_CLIP_TOP = "clipTop";//$NON-NLS-1$
- public final static String PSUB_CLIP_RIGHT = "clipRight";//$NON-NLS-1$
- public final static String PSUB_CLIP_BOTTOM = "clipBottom";//$NON-NLS-1$
- public final static String PSUB_CLIP_LEFT = "clipLeft";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMSubProperty(String name) {
- super(name);
- }
-
- /**
- *
- */
- public PropCMProperty getContainer() {
- return shorthandContainerAt(0);
- }
-
- /**
- *
- */
- public static PropCMProperty getInstanceOf(String name) {
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMProperty) node;
-
- // register
- if (PropCMNode.isLoading()) {
- node = new PropCMSubProperty(name);
- instances.put(name, node);
- }
-
- return (PropCMProperty) node;
- }
-
- /**
- *
- */
- public static Enumeration getNameEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.keys();
- }
-
- /**
- *
- */
- public static Enumeration getPropertyEnum() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return instances.elements();
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_SUBPROPERTY;
- }
-
- /**
- *
- */
- public static Vector names() {
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- return new Vector(instances.keySet());
- }
-
- /**
- *
- */
- public void setContainer(PropCMProperty prop) {
- if (containers == null)
- containers = new Vector();
- containers.clear();
- containers.add(prop);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java
deleted file mode 100644
index 3375715d5e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMURange.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Set;
-
-/**
- *
- */
-public class PropCMURange extends PropCMNode {
-
- private static java.util.Hashtable instances = null;
- public final static String VAL_URANGE = "urange";//$NON-NLS-1$
-
- /**
- *
- */
- protected PropCMURange(String name) {
- super(name);
- }
-
- /**
- *
- */
- void getIdentifiers(Set indents) {
- }
-
- /**
- *
- */
- public static PropCMURange getInstanceOf(String name) {
- if (name == null)
- return null;
-
- // initialize
- if (instances == null)
- instances = new Hashtable(10);
-
- // Initialize of DB
- if (isNeedInitialize())
- PropCMNode.initPropertyCM();
-
- // query
- Object node = instances.get(name);
- if (node != null)
- return (PropCMURange) node;
-
- // register
- node = new PropCMURange(name);
- instances.put(name, node);
-
- return (PropCMURange) node;
- }
-
- /**
- *
- */
- public short getType() {
- return VAL_UNICODE_RANGE;
- }
-
- /**
- *
- */
- void getValues(Collection values) {
- if (values != null && !values.contains(this))
- values.add(this);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java
deleted file mode 100644
index 816ba377c6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentmodel/PropCMUtil.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.contentmodel;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- *
- */
-public class PropCMUtil {
-
- /**
- *
- */
- public static void minus(Collection src, Collection ref) {
- Iterator it = ref.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (src.contains(obj))
- src.remove(obj);
- }
- return;
- }
-
- /**
- *
- */
- public static void plus(Collection src, Collection ref) {
- Iterator it = ref.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (!src.contains(obj))
- src.add(obj);
- }
- return;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.java
deleted file mode 100644
index 3bbc582ac6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentProperties.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.css.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.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * Properties constants used by CSS. Clients should only read and modify the
- * CSS properties programmatically using this class.
- *
- * @since 1.1
- */
-public class CSSContentProperties {
- static final String CSSCORE_ID = CSSCorePlugin.getDefault().getBundle().getSymbolicName();
- private static final String PROJECT_KEY = "<project>"; //$NON-NLS-1$
-
- /**
- * The default css profile to use when none is specified.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String CSS_PROFILE = "css-profile"; //$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(CSSCORE_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(CSSCORE_ID))
- return null;
- node = node.node(CSSCORE_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, CSSCORE_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.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java
deleted file mode 100644
index 25a4b8d9a8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contentproperties/CSSContentPropertiesManager.java
+++ /dev/null
@@ -1,239 +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.css.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.css.core.internal.CSSCoreMessages;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-public class CSSContentPropertiesManager {
- public CSSContentPropertiesManager() {
- super();
- fResourceChangeListener = new ResourceChangeListener();
- fJob = new ContentPropertiesManagerJob();
- }
-
- private static CSSContentPropertiesManager _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(CSSCoreMessages.CSSContentPropertiesManager_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(CSSContentProperties.CSSCORE_ID, IResourceStatus.FAILED_SETTING_CHARSET, CSSCoreMessages.CSSContentPropertiesManager_Updating, null);
- monitor = monitor == null ? new NullProgressMonitor() : monitor;
- try {
- monitor.beginTask(CSSCoreMessages.CSSContentPropertiesManager_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 css profile preferences
- Preferences projectPrefs = CSSContentProperties.getPreferences(next, CSSContentProperties.CSS_PROFILE, false);
- if (projectPrefs != null)
- projectPrefs.flush();
-
- }
- }
- catch (BackingStoreException e) {
- // we got an error saving
- String detailMessage = NLS.bind(CSSCoreMessages.CSSContentPropertiesManager_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 css content setting to see if it has
- // been moved/deleted
- boolean resourceChanges = false;
-
- // project affected
- IProject currentProject = (IProject) projectDelta.getResource();
-
- resourceChanges = processPreferences(currentProject, CSSContentProperties.CSS_PROFILE, 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 = CSSContentProperties.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 = CSSContentProperties.getPreferences(targetProject, key, true);
- targetPrefs.put(CSSContentProperties.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 CSSContentPropertiesManager();
- 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.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java
deleted file mode 100644
index 72b876bdd8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ByteReader.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.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 no 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.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
deleted file mode 100644
index dbdffeccbc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizer.java
+++ /dev/null
@@ -1,1440 +0,0 @@
-/* The following code was generated by JFlex 1.2.2 on 7/28/08 5:19 PM */
-
-/*******************************************************************************
- * 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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.css.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 7/28/08 5:19 PM from the specification file
- * <tt>file:/D:/workspaces/wtp301/workspace/org.eclipse.wst.sse.core/DevTimeSupport/HeadParsers/CSSHeadTokenizer/CSSHeadTokenizer.jFlex</tt>
- */
-public class CSSHeadTokenizer {
-
- /** this character denotes the end of file */
- final public static int YYEOF = -1;
-
- /** lexical states */
- final public static int YYINITIAL = 0;
- final public static int UnDelimitedString = 12;
- final public static int DQ_STRING = 8;
- final public static int SQ_STRING = 10;
- final public static int ST_XMLDecl = 2;
- final public static int QuotedAttributeValue = 6;
- final public static int CHARSET_RULE = 4;
-
- /**
- * YY_LEXSTATE[l] is the state in the DFA for the lexical state l
- * YY_LEXSTATE[l+1] is the state in the DFA for the lexical state l
- * at the beginning of a line
- * l is of the form l = 2*k, k a non negative integer
- */
- private final static int YY_LEXSTATE[] = {
- 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7
- };
-
- /**
- * Translates characters to character classes
- */
- final private static String yycmap_packed =
- "\1\11\10\0\1\6\1\10\2\0\1\7\22\0\1\6\1\0\1\37"+
- "\2\0\1\42\1\0\1\40\7\0\1\41\13\0\1\36\1\13\1\12"+
- "\1\35\1\14\1\20\1\23\1\0\1\21\1\32\1\26\1\0\1\34"+
- "\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24\1\25"+
- "\1\27\3\0\1\15\10\0\1\23\1\0\1\21\1\32\1\26\1\0"+
- "\1\34\1\22\1\33\2\0\1\17\1\16\1\30\1\31\2\0\1\24"+
- "\1\25\1\27\3\0\1\15\102\0\1\4\3\0\1\5\17\0\1\3"+
- "\16\0\1\1\20\0\1\3\16\0\1\1\1\2\170\0\1\2\ufe87\0";
-
- /**
- * Translates characters to character classes
- */
- final private static char [] yycmap = yy_unpack_cmap(yycmap_packed);
-
-
- /* error codes */
- final private static int YY_UNKNOWN_ERROR = 0;
- final private static int YY_ILLEGAL_STATE = 1;
- final private static int YY_NO_MATCH = 2;
- final private static int YY_PUSHBACK_2BIG = 3;
-
- /* error messages for the codes above */
- final private static String YY_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Internal error: unknown state",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /** the input device */
- private java.io.Reader yy_reader;
-
- /** the current state of the DFA */
- private int yy_state;
-
- /** the current lexical state */
- private int yy_lexical_state = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char yy_buffer[] = new char[16384];
-
- /** the textposition at the last accepting state */
- private int yy_markedPos;
-
- /** the textposition at the last state to be included in yytext */
- private int yy_pushbackPos;
-
- /** the current text position in the buffer */
- private int yy_currentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int yy_startRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int yy_endRead;
-
- /** number of newlines encountered up to the start of the matched text */
-// private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
-// private int yycolumn;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean yy_atBOL;
-
- /** yy_atEOF == true <=> the scanner has returned a value for EOF */
- private boolean yy_atEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean yy_eof_done;
-
- /* user code: */
-
-
- private boolean hasMore = true;
- private final static int MAX_TO_SCAN = 8000;
- StringBuffer string = new StringBuffer();
- // state stack for easier state handling
- private IntStack fStateStack = new IntStack();
- private String valueText = null;
-
-
-
- public CSSHeadTokenizer() {
- super();
- }
-
- public void reset (Reader in) {
- /* the input device */
- yy_reader = in;
-
- /* the current state of the DFA */
- yy_state = 0;
-
- /* the current lexical state */
- yy_lexical_state = YYINITIAL;
-
- /* this buffer contains the current text to be matched and is
- the source of the yytext() string */
- java.util.Arrays.fill(yy_buffer, (char)0);
-
- /* the textposition at the last accepting state */
- yy_markedPos = 0;
-
- /* the textposition at the last state to be included in yytext */
- yy_pushbackPos = 0;
-
- /* the current text position in the buffer */
- yy_currentPos = 0;
-
- /* startRead marks the beginning of the yytext() string in the buffer */
- yy_startRead = 0;
-
- /**
- * endRead marks the last character in the buffer, that has been read
- * from input
- */
- yy_endRead = 0;
-
- /* number of newlines encountered up to the start of the matched text */
-// yyline = 0;
-
- /* the number of characters up to the start of the matched text */
- yychar = 0;
-
- /**
- * the number of characters from the last newline up to the start
- * of the matched text
- */
-// yycolumn = 0;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning
- * of a line
- */
- yy_atBOL = false;
-
- /* yy_atEOF == true <=> the scanner has returned a value for EOF */
- yy_atEOF = false;
-
- /* denotes if the user-EOF-code has already been executed */
- yy_eof_done = false;
-
-
- fStateStack.clear();
-
- hasMore = true;
-
- // its a little wasteful to "throw away" first char array generated
- // by class init (via auto generated code), but we really do want
- // a small buffer for our head parsers.
- if (yy_buffer.length != MAX_TO_SCAN) {
- yy_buffer = new char[MAX_TO_SCAN];
- }
-
-
- }
-
-
- public final HeadParserToken getNextToken() throws IOException {
- String context = null;
- context = primGetNextToken();
- HeadParserToken result = null;
- if (valueText != null) {
- result = createToken(context, yychar, valueText);
- valueText = null;
- } else {
- result = createToken(context, yychar, yytext());
- }
- return result;
- }
-
- public final boolean hasMoreTokens() {
- return hasMore && yychar < MAX_TO_SCAN;
- }
- private void pushCurrentState() {
- fStateStack.push(yystate());
-
- }
-
- private void popState() {
- yybegin(fStateStack.pop());
- }
- private HeadParserToken createToken(String context, int start, String text) {
- return new HeadParserToken(context, start, text);
- }
-
-
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- public CSSHeadTokenizer(java.io.Reader in) {
- this.yy_reader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- public CSSHeadTokenizer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] yy_unpack_cmap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 160) {
- 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]);
- }
-
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- private void yypushback(int number) {
- if ( number > yylength() )
- yy_ScanError(YY_PUSHBACK_2BIG);
-
- yy_markedPos -= number;
- }
-
-
- /**
- * Contains user EOF-code, which will be executed exactly once,
- * when the end of file is reached
- */
- private void yy_do_eof() {
- if (!yy_eof_done) {
- yy_eof_done = true;
- hasMore=false;
-
- }
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int yy_input;
- int yy_action;
-
-
- while (true) {
-
- yychar+= yylength();
-
- yy_atBOL = yy_markedPos <= 0 || yy_buffer[yy_markedPos-1] == '\n';
- if (!yy_atBOL && yy_buffer[yy_markedPos-1] == '\r') {
- yy_atBOL = yy_advance() != '\n';
- if (!yy_atEOF) yy_currentPos--;
- }
-
- yy_action = -1;
-
- yy_currentPos = yy_startRead = yy_markedPos;
-
- if (yy_atBOL)
- yy_state = YY_LEXSTATE[yy_lexical_state+1];
- else
- yy_state = YY_LEXSTATE[yy_lexical_state];
-
-
- yy_forAction: {
- while (true) {
-
- yy_input = yy_advance();
-
- if ( yy_input == YYEOF ) break yy_forAction;
-
- yy_input = yycmap[yy_input];
-
- boolean yy_isFinal = false;
- boolean yy_noLookAhead = false;
-
- yy_forNext: { switch (yy_state) {
- case 0:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 1:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_state = 9; break yy_forNext;
- case 2: yy_isFinal = true; yy_state = 10; break yy_forNext;
- case 3: yy_isFinal = true; yy_state = 11; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 12; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 13; break yy_forNext;
- case 11: yy_isFinal = true; yy_state = 14; break yy_forNext;
- case 16: yy_isFinal = true; yy_state = 15; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 2:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 16; break yy_forNext;
- case 12: yy_isFinal = true; yy_state = 17; break yy_forNext;
- case 22: yy_isFinal = true; yy_state = 18; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 3:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 20; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 8; break yy_forNext;
- }
-
- case 4:
- switch (yy_input) {
- case 6:
- case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 8: yy_isFinal = true; yy_state = 24; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 25; break yy_forNext;
- case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 5:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 30; break yy_forNext;
- case 12:
- case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
- case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- }
-
- case 6:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 34; break yy_forNext;
- case 34: yy_isFinal = true; yy_state = 35; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- }
-
- case 7:
- switch (yy_input) {
- case 11:
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 33: yy_isFinal = true; yy_state = 31; break yy_forNext;
- case 12: yy_isFinal = true; yy_state = 35; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 37; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
- case 31:
- case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 28; break yy_forNext;
- }
-
- case 9:
- switch (yy_input) {
- case 2: yy_isFinal = true; yy_noLookAhead = true; yy_state = 40; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 10:
- switch (yy_input) {
- case 1: yy_isFinal = true; yy_noLookAhead = true; yy_state = 41; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 11:
- switch (yy_input) {
- case 4: yy_state = 42; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 12:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 43; break yy_forNext;
- case 9: yy_state = 44; break yy_forNext;
- case 11: yy_state = 45; break yy_forNext;
- case 16: yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 13:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 43; break yy_forNext;
- case 11: yy_state = 45; break yy_forNext;
- case 16: yy_state = 46; break yy_forNext;
- case 9: yy_state = 47; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 14:
- switch (yy_input) {
- case 9: yy_state = 48; break yy_forNext;
- case 12: yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 15:
- switch (yy_input) {
- case 9: yy_state = 50; break yy_forNext;
- case 17: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 16:
- switch (yy_input) {
- case 12: yy_state = 52; break yy_forNext;
- case 22: yy_state = 53; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 17:
- switch (yy_input) {
- case 9: yy_state = 54; break yy_forNext;
- case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 18:
- switch (yy_input) {
- case 9: yy_state = 56; break yy_forNext;
- case 24: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 19:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 58; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 20:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 21; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 21:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 59; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 23:
- switch (yy_input) {
- case 6:
- case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 8: yy_state = 60; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 24:
- switch (yy_input) {
- case 6:
- case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 8: yy_state = 60; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 25:
- switch (yy_input) {
- case 31: yy_isFinal = true; yy_state = 26; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 27; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_state = 60; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 26:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 62; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 27:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 63; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 29:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 64; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 30:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
- case 31: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 12:
- case 33: yy_state = 65; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 31:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
- case 9: yy_state = 66; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 32:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 67; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 33:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 68; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 34:
- switch (yy_input) {
- case 7:
- case 8:
- case 11:
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 32; break yy_forNext;
- case 32: yy_isFinal = true; yy_state = 33; break yy_forNext;
- case 33: yy_state = 65; break yy_forNext;
- case 34: yy_state = 69; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 35:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 9: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 36:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 71; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 37:
- switch (yy_input) {
- case 11:
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 36; break yy_forNext;
- case 30: yy_isFinal = true; yy_state = 38; break yy_forNext;
- case 31:
- case 32: yy_isFinal = true; yy_state = 39; break yy_forNext;
- case 33: yy_state = 65; break yy_forNext;
- case 12: yy_state = 69; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 38:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 72; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 39:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 73; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 42:
- switch (yy_input) {
- case 5: yy_isFinal = true; yy_noLookAhead = true; yy_state = 74; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 43:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 43; break yy_forNext;
- case 9: yy_state = 44; break yy_forNext;
- case 11: yy_state = 45; break yy_forNext;
- case 16: yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 44:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 43; break yy_forNext;
- case 11: yy_state = 45; break yy_forNext;
- case 16: yy_state = 46; break yy_forNext;
- case 9: yy_state = 47; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 45:
- switch (yy_input) {
- case 9: yy_state = 48; break yy_forNext;
- case 12: yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 46:
- switch (yy_input) {
- case 9: yy_state = 50; break yy_forNext;
- case 17: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 47:
- switch (yy_input) {
- case 11: yy_state = 45; break yy_forNext;
- case 16: yy_state = 46; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 48:
- switch (yy_input) {
- case 12: yy_state = 49; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 49:
- switch (yy_input) {
- case 9: yy_state = 75; break yy_forNext;
- case 13: yy_state = 76; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 50:
- switch (yy_input) {
- case 17: yy_state = 51; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 51:
- switch (yy_input) {
- case 9: yy_state = 77; break yy_forNext;
- case 18: yy_state = 78; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 52:
- switch (yy_input) {
- case 9: yy_state = 54; break yy_forNext;
- case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 53:
- switch (yy_input) {
- case 9: yy_state = 56; break yy_forNext;
- case 24: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 54:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 55; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 55:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 79; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 56:
- switch (yy_input) {
- case 24: yy_state = 57; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 57:
- switch (yy_input) {
- case 9: yy_state = 80; break yy_forNext;
- case 17: yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 58:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
- case 9: yy_state = 82; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 60:
- switch (yy_input) {
- case 6:
- case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 8: yy_state = 60; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 61; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 61:
- switch (yy_input) {
- case 6:
- case 7: yy_isFinal = true; yy_state = 23; break yy_forNext;
- case 8: yy_state = 60; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 83; break yy_forNext;
- default: yy_isFinal = true; yy_noLookAhead = true; yy_state = 22; break yy_forNext;
- }
-
- case 65:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
- case 9: yy_state = 66; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 66:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 32; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 69:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- case 9: yy_state = 70; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 70:
- switch (yy_input) {
- case 29: yy_isFinal = true; yy_state = 29; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 75:
- switch (yy_input) {
- case 13: yy_state = 76; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 76:
- switch (yy_input) {
- case 9: yy_state = 84; break yy_forNext;
- case 14: yy_state = 85; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 77:
- switch (yy_input) {
- case 18: yy_state = 78; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 78:
- switch (yy_input) {
- case 9: yy_state = 86; break yy_forNext;
- case 19: yy_state = 87; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 80:
- switch (yy_input) {
- case 17: yy_state = 81; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 81:
- switch (yy_input) {
- case 9: yy_state = 88; break yy_forNext;
- case 25: yy_state = 89; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 82:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 19; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 83:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 60; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 84:
- switch (yy_input) {
- case 14: yy_state = 85; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 85:
- switch (yy_input) {
- case 9: yy_state = 90; break yy_forNext;
- case 15: yy_state = 91; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 86:
- switch (yy_input) {
- case 19: yy_state = 87; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 87:
- switch (yy_input) {
- case 9: yy_state = 92; break yy_forNext;
- case 20: yy_state = 93; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 88:
- switch (yy_input) {
- case 25: yy_state = 89; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 89:
- switch (yy_input) {
- case 9: yy_state = 94; break yy_forNext;
- case 26: yy_state = 95; 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 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
- case 9: yy_state = 97; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 92:
- switch (yy_input) {
- case 20: yy_state = 93; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 93:
- switch (yy_input) {
- case 9: yy_state = 98; break yy_forNext;
- case 21: yy_state = 99; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 94:
- switch (yy_input) {
- case 26: yy_state = 95; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 95:
- switch (yy_input) {
- case 9: yy_state = 100; break yy_forNext;
- case 27: yy_state = 101; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 96:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
- case 9: yy_isFinal = true; yy_state = 102; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 97:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
- case 9: yy_state = 103; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 98:
- switch (yy_input) {
- case 21: yy_state = 99; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 99:
- switch (yy_input) {
- case 9: yy_state = 104; break yy_forNext;
- case 22: yy_state = 105; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 100:
- switch (yy_input) {
- case 27: yy_state = 101; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 101:
- switch (yy_input) {
- case 9: yy_state = 106; break yy_forNext;
- case 24: yy_state = 107; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 102:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
- case 9: yy_state = 103; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 103:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 96; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 104:
- switch (yy_input) {
- case 22: yy_state = 105; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 105:
- switch (yy_input) {
- case 9: yy_state = 108; break yy_forNext;
- case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 106:
- switch (yy_input) {
- case 24: yy_state = 107; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 107:
- switch (yy_input) {
- case 9: yy_state = 110; break yy_forNext;
- case 28: yy_state = 111; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 108:
- switch (yy_input) {
- case 23: yy_isFinal = true; yy_state = 109; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 109:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_noLookAhead = true; yy_state = 112; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 110:
- switch (yy_input) {
- case 28: yy_state = 111; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 111:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 111; break yy_forNext;
- case 9: yy_state = 113; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 113:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 111; break yy_forNext;
- case 10: yy_isFinal = true; yy_state = 114; break yy_forNext;
- case 9: yy_state = 115; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 114:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
- case 9: yy_state = 117; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 115:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_state = 111; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 116:
- switch (yy_input) {
- case 9: yy_isFinal = true; yy_state = 114; break yy_forNext;
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 116; break yy_forNext;
- default: break yy_forAction;
- }
-
- case 117:
- switch (yy_input) {
- case 6:
- case 7:
- case 8: yy_isFinal = true; yy_state = 116; 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 29:
- case 64:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 119: break;
- case 22:
- case 23:
- case 25:
- case 61:
- case 83:
- { yypushback(yylength()); yybegin(UnDelimitedString); string.setLength(0); }
- case 120: break;
- case 21:
- case 59:
- { yybegin(YYINITIAL); hasMore = false; return CSSHeadTokenizerConstants.RuleEnd; }
- case 121: break;
- case 39:
- case 73:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue; }
- case 122: break;
- case 109:
- case 112:
- { if (yychar == 0 ) {yybegin(CHARSET_RULE); return CSSHeadTokenizerConstants.CHARSET_RULE;} }
- case 123: break;
- case 96:
- case 102:
- { if (yychar == 0 ) {yybegin(ST_XMLDecl); return XMLHeadTokenizerConstants.XMLDeclStart;} }
- case 124: break;
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 20:
- case 24:
- case 30:
- case 34:
- case 37:
- { if(yychar > MAX_TO_SCAN) {hasMore=false; return EncodingParserConstants.MAX_CHARS_REACHED;} }
- case 125: break;
- case 55:
- case 79:
- { yybegin(YYINITIAL); return XMLHeadTokenizerConstants.XMLDeclEnd; }
- case 126: break;
- case 114:
- case 116:
- { pushCurrentState(); yybegin(QuotedAttributeValue); return XMLHeadTokenizerConstants.XMLDelEncoding; }
- case 127: break;
- case 3:
- case 19:
- case 58:
- { pushCurrentState(); yybegin(QuotedAttributeValue); }
- case 128: break;
- case 40:
- { hasMore = false; return EncodingParserConstants.UTF16BE; }
- case 129: break;
- case 41:
- { hasMore = false; return EncodingParserConstants.UTF16LE; }
- case 130: break;
- case 74:
- { hasMore = false; return EncodingParserConstants.UTF83ByteBOM; }
- case 131: break;
- case 28:
- case 31:
- case 35:
- { string.append( yytext() ); }
- case 132: break;
- case 27:
- case 63:
- { yybegin(SQ_STRING); string.setLength(0); }
- case 133: break;
- case 26:
- case 62:
- { yybegin(DQ_STRING); string.setLength(0); }
- case 134: break;
- case 32:
- case 67:
- { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.InvalidTerminatedStringValue; }
- case 135: break;
- case 33:
- case 68:
- { popState(); valueText = string.toString(); return EncodingParserConstants.StringValue; }
- case 136: break;
- case 36:
- case 71:
- { yypushback(yylength());popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- case 137: break;
- case 38:
- case 72:
- { yypushback(yylength()); popState(); valueText = string.toString(); return EncodingParserConstants.UnDelimitedStringValue; }
- case 138: break;
- default:
- if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
- yy_atEOF = true;
- yy_do_eof();
- { hasMore = false; return EncodingParserConstants.EOF; }
- }
- else {
- yy_ScanError(YY_NO_MATCH);
- }
- }
- }
- }
-
- /**
- * Runs the scanner on input files.
- *
- * This main method is the debugging routine for the scanner.
- * It prints each returned token to System.out until the end of
- * file is reached, or an error occured.
- *
- * @param argv the command line, contains the filenames to run
- * the scanner on.
- */
- public static void main(String argv[]) {
- for (int i = 0; i < argv.length; i++) {
- CSSHeadTokenizer scanner = null;
- try {
- scanner = new CSSHeadTokenizer( new java.io.FileReader(argv[i]) );
- }
- catch (java.io.FileNotFoundException e) {
- System.out.println("File not found : \""+argv[i]+"\"");
- System.exit(1);
- }
- catch (java.io.IOException e) {
- System.out.println("Error opening file \""+argv[i]+"\"");
- System.exit(1);
- }
- catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Usage : java CSSHeadTokenizer <inputfile>");
- System.exit(1);
- }
-
- try {
- do {
- System.out.println(scanner.primGetNextToken());
- } while (!scanner.yy_atEOF);
-
- }
- catch (java.io.IOException e) {
- System.out.println("An I/O error occured while scanning :");
- System.out.println(e);
- System.exit(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java
deleted file mode 100644
index a991a03fa9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSHeadTokenizerConstants.java
+++ /dev/null
@@ -1,19 +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.css.core.internal.contenttype;
-
-
-public interface CSSHeadTokenizerConstants {
-
- String RuleEnd = "RuleEnd"; //$NON-NLS-1$
- String CHARSET_RULE = "CHARSET_RULE"; //$NON-NLS-1$
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
deleted file mode 100644
index 16f5fbdf40..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/CSSResourceEncodingDetector.java
+++ /dev/null
@@ -1,367 +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.css.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.core.runtime.content.IContentDescription;
-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.sse.core.internal.encoding.NonContentBasedEncodingRules;
-import org.eclipse.wst.xml.core.internal.contenttype.EncodingParserConstants;
-
-
-
-public class CSSResourceEncodingDetector implements IResourceCharsetDetector {
- class NullMemento extends EncodingMemento {
- /**
- *
- */
- public NullMemento() {
- super();
- String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null);
- setJavaCharsetName(defaultCharset);
- setAppropriateDefault(defaultCharset);
- setDetectedCharsetName(null);
- }
- }
-
-
- private CSSHeadTokenizer fTokenizer;
- private EncodingMemento fEncodingMemento;
- private boolean fHeaderParsed;
- private Reader fReader;
-
- /**
- * There is no spec defined encoding for CSS, so Null is returned.
- */
- public String getSpecDefaultEncoding() {
- // should match what's in plugin.xml (or look it up from there).
- return null;
- }
-
- private boolean canHandleAsUnicodeStream(String tokenType) {
- boolean canHandleAsUnicodeStream = false;
- if (tokenType == EncodingParserConstants.UTF83ByteBOM) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-8"; //$NON-NLS-1$
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUTF83ByteBOMUsed(true);
- }
- else if (tokenType == EncodingParserConstants.UTF16BE || tokenType == EncodingParserConstants.UTF16LE) {
- canHandleAsUnicodeStream = true;
- String enc = "UTF-16"; //$NON-NLS-1$
- byte[] bom = (tokenType == EncodingParserConstants.UTF16BE) ? IContentDescription.BOM_UTF_16BE : IContentDescription.BOM_UTF_16LE;
- createEncodingMemento(enc, EncodingMemento.DETECTED_STANDARD_UNICODE_BYTES);
- fEncodingMemento.setUnicodeStream(true);
- fEncodingMemento.setUnicodeBOM(bom);
- }
- return canHandleAsUnicodeStream;
- }
-
- /**
- * @return Returns the tokenizer.
- */
- private CSSHeadTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new CSSHeadTokenizer();
- }
- return fTokenizer;
- }
-
- private boolean isLegalString(String valueTokenType) {
- boolean result = false;
- if (valueTokenType != null) {
- result = valueTokenType.equals(EncodingParserConstants.StringValue) || valueTokenType.equals(EncodingParserConstants.UnDelimitedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTerminatedStringValue) || valueTokenType.equals(EncodingParserConstants.InvalidTermintatedUnDelimitedStringValue);
- }
- return result;
- }
-
- private void parseInput() throws IOException {
- checkInContents();
- if (fEncodingMemento == null) {
- checkHeuristics();
- }
- }
-
- private void checkInContents() throws IOException {
- CSSHeadTokenizer tokenizer = getTokenizer();
- tokenizer.reset(fReader);
- HeadParserToken token = null;
- String tokenType = null;
- do {
- token = tokenizer.getNextToken();
- tokenType = token.getType();
- if (canHandleAsUnicodeStream(tokenType)) {
- // side effect of canHandle is to create appropriate memento
- }
- else if (tokenType == CSSHeadTokenizerConstants.CHARSET_RULE) {
- if (tokenizer.hasMoreTokens()) {
- HeadParserToken valueToken = tokenizer.getNextToken();
- String valueTokenType = valueToken.getType();
- if (isLegalString(valueTokenType)) {
- createEncodingMemento(valueToken.getText(), EncodingMemento.FOUND_ENCODING_IN_CONTENT);
-
- }
- }
- }
-
- }
- while (tokenizer.hasMoreTokens());
- }
-
- /**
- *
- */
- private void checkHeuristics() throws IOException {
- boolean noHeuristic = false;
- String heuristicEncoding = null;
- try {
- fReader.reset();
- byte[] bytes = new byte[3];
- int nRead = 0;
- for (int i = 0; i < bytes.length; i++) {
- if (fReader.ready()) {
- int oneByte = fReader.read();
- nRead++;
- if (oneByte <= 0xFF) {
- bytes[i] = (byte) oneByte;
- }
- else {
- noHeuristic = true;
- }
- }
- else {
- noHeuristic = true;
- break;
- }
- }
- if (!noHeuristic && nRead == 3) {
- heuristicEncoding = EncodingGuesser.guessEncoding(bytes, 3);
- }
- }
- catch (IOException e) {
- // if any IO exception, then not a heuristic case
- }
- finally {
- fReader.reset();
- }
- if (heuristicEncoding != null) {
- createEncodingMemento(heuristicEncoding, EncodingMemento.GUESSED_ENCODING_FROM_STREAM);
- }
-
- }
-
- /**
- * 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
- */
- private void createEncodingMemento(String detectedCharsetName, String reason) {
- createEncodingMemento(detectedCharsetName);
- }
-
- /**
- * convience method all subclasses can use (but not override)
- */
- private final 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();
- }
-
- 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;
- }
-
- 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);
- }
- }
-
- /**
- *
- */
- private void resetAll() {
- fReader = null;
- fHeaderParsed = false;
- fEncodingMemento = null;
- }
-
- /**
- *
- */
- public void set(InputStream inputStream) {
- resetAll();
- fReader = new ByteReader(inputStream);
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossible, since we know ByteReader
- // supports marking
- throw new Error(e);
- }
- }
-
- /**
- *
- */
- public void set(IStorage iStorage) throws CoreException {
- resetAll();
- InputStream inputStream = iStorage.getContents();
- InputStream resettableStream = new BufferedInputStream(inputStream, CodedIO.MAX_BUF_SIZE);
- resettableStream.mark(CodedIO.MAX_MARK_SIZE);
- set(resettableStream);
- // TODO we'll need to "remember" IFile, or
- // get its (or its project's) settings, in case
- // those are needed to handle cases when the
- // encoding is not in the file stream.
- }
-
- /**
- * Note: this is not part of interface to help avoid confusion ... it
- * expected this Reader is a well formed character reader ... that is, its
- * all ready been determined to not be a unicode marked input stream. And,
- * its assumed to be in the correct position, at position zero, ready to
- * read first character.
- */
- public void set(Reader reader) {
- resetAll();
- fReader = reader;
- if (!fReader.markSupported()) {
- fReader = new BufferedReader(fReader);
- }
- try {
- fReader.mark(CodedIO.MAX_MARK_SIZE);
- }
- catch (IOException e) {
- // impossble, since we just checked if markable
- throw new Error(e);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java
deleted file mode 100644
index d04863d3ae..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/ContentDescriberForCSS.java
+++ /dev/null
@@ -1,200 +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.css.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;
-
-
-public final class ContentDescriberForCSS 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);
- 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);
- 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 specific check for validilty
- // based on contents.
- return IContentDescriber.INDETERMINATE;
- }
-
- private int computeValidity(Reader reader) {
- // currently no specific check for validilty
- // based on contents.
- return IContentDescriber.INDETERMINATE;
- }
-
- private IResourceCharsetDetector getDetector() {
- return new CSSResourceEncodingDetector();
- }
-
- /**
- * @param description
- * @param detector
- * @throws IOException
- */
- private void handleCalculations(IContentDescription description, IResourceCharsetDetector detector) throws IOException {
- // note: if we're asked for one, we set them all. I need to be sure if
- // called
- // mulitiple times (one for each, say) that we don't waste time
- // processing same
- // content again.
- EncodingMemento encodingMemento = ((CSSResourceEncodingDetector) detector).getEncodingMemento();
- // TODO: I need to verify to see if this BOM work is always done
- // by text type.
- Object detectedByteOrderMark = encodingMemento.getUnicodeBOM();
- if (detectedByteOrderMark != null) {
- Object existingByteOrderMark = description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- // not sure why would ever be different, so if is different, may
- // need to "push" up into base.
- if (!detectedByteOrderMark.equals(existingByteOrderMark))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, detectedByteOrderMark);
- }
-
-
- if (!encodingMemento.isValid()) {
- // note: after setting here, its the mere presence of
- // IContentDescriptionExtended.UNSUPPORTED_CHARSET
- // in the resource's description that can be used to determine if
- // invalid
- // in those cases, the "detected" property contains an
- // "appropriate default" to use.
- description.setProperty(IContentDescriptionExtended.UNSUPPORTED_CHARSET, encodingMemento.getInvalidEncoding());
- description.setProperty(IContentDescriptionExtended.APPROPRIATE_DEFAULT, encodingMemento.getAppropriateDefault());
- }
-
- Object detectedCharset = encodingMemento.getDetectedCharsetName();
- Object javaCharset = encodingMemento.getJavaCharsetName();
-
- // we always include detected, if its different than java
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
-
- if (javaCharset != null) {
- Object existingCharset = description.getProperty(IContentDescription.CHARSET);
- if (javaCharset.equals(existingCharset)) {
- handleDetectedSpecialCase(description, detectedCharset, javaCharset);
- }
- else {
- // we may need to add what we found, but only need to add
- // if different from default.the
- Object defaultCharset = getDetector().getSpecDefaultEncoding();
- if (defaultCharset != null) {
- if (!defaultCharset.equals(javaCharset)) {
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- else {
- // assuming if there is no spec default, we always need to
- // add, I'm assuming
- description.setProperty(IContentDescription.CHARSET, javaCharset);
- }
- }
- }
-
- }
-
- 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) {
-
- // Once we detected a charset, we should set the property even
- // though it's the same as javaCharset
- // because there are clients that rely on this property to
- // determine if the charset is actually detected in file or not.
- description.setProperty(IContentDescriptionExtended.DETECTED_CHARSET, detectedCharset);
- }
- }
-
- /**
- * @param description
- * @return
- */
- private boolean isRelevent(IContentDescription description) {
- boolean result = false;
- if (description == null)
- result = false;
- else if (description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- result = true;
- else if (description.isRequested(IContentDescription.CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.APPROPRIATE_DEFAULT))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.DETECTED_CHARSET))
- result = true;
- else if (description.isRequested(IContentDescriptionExtended.UNSUPPORTED_CHARSET))
- result = true;
- // else if
- // (description.isRequested(IContentDescriptionExtended.ENCODING_MEMENTO))
- // result = true;
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java
deleted file mode 100644
index 130800eec8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/EncodingGuesser.java
+++ /dev/null
@@ -1,173 +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.css.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.css.core/src/org/eclipse/wst/css/core/internal/contenttype/HeadParserToken.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/HeadParserToken.java
deleted file mode 100644
index 51dc01cce1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/HeadParserToken.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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.css.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.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
deleted file mode 100644
index aa8cabd9f7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/contenttype/IntStack.java
+++ /dev/null
@@ -1,99 +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.css.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.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java
deleted file mode 100644
index 007991b97b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/AbstractCSSNodeList.java
+++ /dev/null
@@ -1,63 +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.css.core.internal.document;
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- *
- */
-abstract class AbstractCSSNodeList {
-
- protected Vector nodes = null;
-
- ICSSNode appendNode(ICSSNode node) {
- if (node == null)
- return null;
- if (this.nodes == null)
- this.nodes = new Vector();
- this.nodes.addElement(node);
- return node;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- if (this.nodes == null)
- return 0;
- return this.nodes.size();
- }
-
-
- protected ICSSNode itemImpl(int index) {
- if (this.nodes == null)
- return null;
- if (index < 0 || index >= this.nodes.size())
- return null;
- return (ICSSNode) this.nodes.elementAt(index);
- }
-
-
- ICSSNode removeNode(int index) {
- if (this.nodes == null)
- return null; // no node
- if (index < 0 || index >= this.nodes.size())
- return null; // invalid parameter
-
- ICSSNode removed = (ICSSNode) this.nodes.elementAt(index);
- this.nodes.removeElementAt(index);
- return removed;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java
deleted file mode 100644
index 9a04a4f6c0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSAttrImpl.java
+++ /dev/null
@@ -1,133 +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.css.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-/**
- *
- */
-class CSSAttrImpl extends CSSRegionContainer implements ICSSAttr {
-
- private String fName = null;
- private String fValue = null;
- private CSSNodeImpl ownerCSSNode = null;
-
- CSSAttrImpl(CSSAttrImpl that) {
- super(that);
- this.fName = that.fName;
- this.setValue(that.fValue);
- }
-
- /**
- * CSSAttr constructor comment.
- */
- CSSAttrImpl(String name) {
- super();
- this.fName = name;
- }
-
- public ICSSNode cloneNode(boolean deep) {
- return new CSSAttrImpl(this);
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
- */
- public ICSSNamedNodeMap getAttributes() {
- return null;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getName() {
- return fName;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return ATTR_NODE;
- }
-
- public ICSSNode getOwnerCSSNode() {
- return ownerCSSNode;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getValue() {
- return fValue;
- }
-
- /**
- * @return boolean
- * @param name
- * java.lang.String
- */
- protected boolean matchName(String name) {
- if (name == null)
- return /* (this.name == null) */false;
- if (this.fName == null)
- return false;
- return this.fName.equals(name);
- }
-
- /**
- *
- */
- protected void notifyValueChanged(String oldValue) {
- if (this.ownerCSSNode == null)
- return;
-
- // for model
- ICSSDocument doc = ownerCSSNode.getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.valueChanged(this, oldValue);
-
- // for adapters
- String value = getValue();
- this.ownerCSSNode.notify(CHANGE, this, oldValue, value, this.ownerCSSNode.getStartOffset());
- }
-
- /**
- * @param newName
- * java.lang.String
- */
- protected void setName(java.lang.String newName) {
- fName = newName;
- }
-
- protected void setOwnerCSSNode(CSSNodeImpl newOwnerCSSNode) {
- ownerCSSNode = newOwnerCSSNode;
- }
-
- /**
- * @param newValue
- * java.lang.String
- */
- public void setValue(java.lang.String newValue) {
- String oldValue = fValue;
- fValue = newValue;
-
- notifyValueChanged(oldValue);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java
deleted file mode 100644
index 676c305bf0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSCharsetRuleImpl.java
+++ /dev/null
@@ -1,79 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-
-
-/**
- *
- */
-class CSSCharsetRuleImpl extends CSSRuleImpl implements ICSSCharsetRule {
-
- /**
- *
- */
- CSSCharsetRuleImpl() {
- super();
- }
-
- CSSCharsetRuleImpl(CSSCharsetRuleImpl that) {
- super(that);
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSCharsetRuleImpl cloned = new CSSCharsetRuleImpl(this);
-
- return cloned;
- }
-
- /**
- * The encoding information used in this <code>@charset</code> rule.
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the specified encoding value has a
- * syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding
- * rule is readonly.
- */
- public String getEncoding() {
- return CSSUtil.extractStringContents(getAttribute(ENCODING));
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return CHARSETRULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return CHARSET_RULE;
- }
-
- public void setEncoding(String encoding) throws org.w3c.dom.DOMException {
- String quote = CSSCorePlugin.getDefault().getPluginPreferences().getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- String enc = CSSUtil.extractStringContents(encoding);
- quote = CSSUtil.detectQuote(enc, quote);
- setAttribute(ENCODING, quote + enc + quote);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
deleted file mode 100644
index 6ea0a60158..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDeclarationItemParser.java
+++ /dev/null
@@ -1,1083 +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
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICounter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-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.internal.text.TextRegionListImpl;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-class CSSDeclarationItemParser {
- /**
- *
- */
- final class FloatInfo {
- /**
- *
- */
- FloatInfo(String text) {
- parse(text);
- }
-
- /**
- *
- */
- void parse(String text) {
- StringBuffer bufValue = new StringBuffer();
- StringBuffer bufIdent = new StringBuffer();
- boolean bNum = true;
- int len = text.length();
- for (int i = 0; i < len; i++) {
- char c = text.charAt(i);
- if (bNum) {
- // Only add +/- if it's the first character in the value buffer
- if ('0' <= c && c <= '9' || c == '.' || ((c == '+' || c == '-') && i == 0)) {
- bufValue.append(c);
- }
- else {
- bufIdent.append(c);
- bNum = false;
- }
- }
- else {
- bufIdent.append(c);
- }
- }
- String valueStr = bufValue.toString();
- try {
- fValue = Float.valueOf(valueStr).floatValue();
- }
- catch (NumberFormatException e) {
- bufIdent.insert(0, valueStr);
- }
- fIdentifier = bufIdent.toString();
- fType = getFloatValueType(valueStr, fIdentifier);
- }
-
- /**
- *
- */
- float getValue() {
- return fValue;
- }
-
- /**
- *
- */
- String getIdentifier() {
- return fIdentifier;
- }
-
- /**
- *
- */
- short getValueType() {
- return fType;
- }
-
- private float fValue = 0.0f;
- private String fIdentifier = null;
- private short fType = CSSPrimitiveValue.CSS_UNKNOWN;
- }
-
- final static int S_NORMAL = 0;
- final static int S_FUNCTION = 1;
- final static int S_FONT_SLASH = 2;
- final static int S_COMMA_SEPARATION = 3;
- private ICSSDocument fDocument = null;
- private IStructuredDocumentRegion fParentRegion = null;
- private boolean fTempStructuredDocument = false;
- private CSSModelUpdateContext fUpdateContext = null;
-
- /**
- * CSSDeclarationItemParser constructor comment.
- */
- CSSDeclarationItemParser(ICSSDocument doc) {
- super();
- fDocument = doc;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createAttrValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("attr")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 1) {
- return null;
- }
-
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(CSSPrimitiveValue.CSS_ATTR);
- if (value == null) {
- return null;
- }
-
- ITextRegion region = valueRegions.get(0);
- value.setValue(getText(region));
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createCountersValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("counters")) { //$NON-NLS-1$
- return null;
- }
-
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT, CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- int size = valueRegions.size();
- if (size != 2 && size != 3) {
- return null;
- }
-
- CounterImpl value = getCounter();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < size; i++) {
- ITextRegion region = valueRegions.get(i);
- String text = getText(region);
- CSSAttrImpl attr = null;
- switch (i) {
- case 0 :
- value.setIdentifier(text);
- attr = value.getAttributeNode(ICounter.IDENTIFIER);
- break;
- case 1 :
- value.setSeparator(text);
- attr = value.getAttributeNode(ICounter.SEPARATOR);
- break;
- case 2 :
- value.setListStyle(text);
- attr = value.getAttributeNode(ICounter.LISTSTYLE);
- break;
- default :
- break;
- }
- if (attr != null) {
- attr.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createCounterValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("counter")) { //$NON-NLS-1$
- return null;
- }
-
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- int size = valueRegions.size();
- if (size != 1 && size != 2) {
- return null;
- }
-
- CounterImpl value = getCounter();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < size; i++) {
- ITextRegion region = valueRegions.get(i);
- String text = getText(region);
- CSSAttrImpl attr = null;
- switch (i) {
- case 0 :
- value.setIdentifier(text);
- attr = value.getAttributeNode(ICounter.IDENTIFIER);
- break;
- case 1 :
- value.setListStyle(text);
- attr = value.getAttributeNode(ICounter.LISTSTYLE);
- break;
- default :
- break;
- }
- if (attr != null) {
- attr.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSStyleDeclItemImpl createDeclarationItem(ITextRegionList nodeRegions) {
- CSSStyleDeclItemImpl item = null;
- String name = getPropertyName(nodeRegions);
- if (name != null) {
- item = getCSSStyleDeclItem(name);
- }
- return item;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createFloatValue(String text, String type) {
- FloatInfo info = new FloatInfo(text);
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(info.getValueType());
- if (value != null) {
- value.setValue(info.getValue());
- }
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createFormatValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("format")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- // format can take variable args.
- if (valueRegions.size() == 0) {
- return null;
- }
-
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(ICSSPrimitiveValue.CSS_FORMAT);
- if (value == null) {
- return null;
- }
-
- ITextRegion region = valueRegions.get(0);
- value.setValue(CSSUtil.extractStringContents(getText(region)));
-
- return value;
-
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createLocalValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("local")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_STRING};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 1) {
- return null;
- }
-
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(ICSSPrimitiveValue.CSS_LOCAL);
- if (value == null) {
- return null;
- }
-
- ITextRegion region = valueRegions.get(0);
- value.setValue(CSSUtil.extractStringContents(getText(region)));
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createPrimitiveValue(ITextRegion region) {
- if (region == null) {
- return null;
- }
- CSSPrimitiveValueImpl value = null;
- String type = region.getType();
- String text = getText(region);
- if (isBlank(type)) {
- value = null;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
- value = createFloatValue(text, type);
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING || type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- value = createStringValue(text, type);
- }
-
- if (value == null) {
- value = createStringValue(text, type);
- }
-
- if (!fTempStructuredDocument && value != null) {
- value.setRangeRegion(fParentRegion, region, region);
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createPrimitiveValue(ITextRegionList regions) {
- CSSPrimitiveValueImpl value = null;
- CSSUtil.stripSurroundingSpace(regions);
- if (regions.isEmpty()) {
- return null;
- }
- ITextRegion region = regions.get(0);
- if (region == null) {
- return null;
- }
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- String text = getText(region).toLowerCase();
- if (text.equals("rgb(")) { //$NON-NLS-1$
- value = createRgbValue(regions);
- }
- else if (text.equals("counter(")) { //$NON-NLS-1$
- value = createCounterValue(regions);
- }
- else if (text.equals("counters(")) { //$NON-NLS-1$
- value = createCountersValue(regions);
- }
- else if (text.equals("attr(")) { //$NON-NLS-1$
- value = createAttrValue(regions);
- }
- else if (text.equals("format(")) { //$NON-NLS-1$
- value = createFormatValue(regions);
- }
- else if (text.equals("local(")) { //$NON-NLS-1$
- value = createLocalValue(regions);
- }
- else if (text.equals("rect(")) { //$NON-NLS-1$
- value = createRectValue(regions);
- }
- if (value == null) {
- value = createStringValue(regions);
- }
- }
- else {
- value = createStringValue(regions);
- }
-
- if (!fTempStructuredDocument && value != null) {
- value.setRangeRegion(fParentRegion, regions.get(0), regions.get(regions.size() - 1));
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createRectValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("rect")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION, CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT}; // IDENT:
- // for
- // 'auto'
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 4) {
- return null;
- }
-
- RectImpl value = getRect();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < 4; i++) {
- ITextRegion region = valueRegions.get(i);
- CSSPrimitiveValueImpl childValue = null;
- switch (i) {
- case 0 :
- childValue = (CSSPrimitiveValueImpl) value.getTop();
- break;
- case 1 :
- childValue = (CSSPrimitiveValueImpl) value.getRight();
- break;
- case 2 :
- childValue = (CSSPrimitiveValueImpl) value.getBottom();
- break;
- case 3 :
- childValue = (CSSPrimitiveValueImpl) value.getLeft();
- break;
- default :
- break;
- }
- if (childValue == null) {
- return null;
- }
- String text = getText(region);
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- setStringValue(childValue, text, type);
- }
- else {
- setFloatValue(childValue, text, type);
- }
- if (!fTempStructuredDocument) {
- childValue.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createRgbValue(ITextRegionList regions) {
- String funcName = getFunctionName(regions);
- if (funcName == null || !funcName.toLowerCase().equals("rgb")) { //$NON-NLS-1$
- return null;
- }
- String accepts[] = {CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER, CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE};
- ITextRegionList valueRegions = getFunctionParameters(regions, accepts);
- if (valueRegions.size() != 3) {
- return null;
- }
-
- RGBColorImpl value = getRGBColor();
- if (value == null) {
- return null;
- }
-
- for (int i = 0; i < 3; i++) {
- ITextRegion region = valueRegions.get(i);
- CSSPrimitiveValueImpl childValue = null;
- switch (i) {
- case 0 :
- childValue = (CSSPrimitiveValueImpl) value.getRed();
- break;
- case 1 :
- childValue = (CSSPrimitiveValueImpl) value.getGreen();
- break;
- case 2 :
- childValue = (CSSPrimitiveValueImpl) value.getBlue();
- break;
- default :
- break;
- }
- if (childValue == null) {
- return null;
- }
- setFloatValue(childValue, getText(region), region.getType());
- if (!fTempStructuredDocument) {
- childValue.setRangeRegion(fParentRegion, region, region);
- }
- }
-
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createStringValue(String text, String type) {
- short valueType = getStringValueType(text, type);
- CSSPrimitiveValueImpl value = getCSSPrimitiveValue(valueType);
- if (value != null) {
- if (valueType == CSSPrimitiveValue.CSS_URI) {
- text = CSSUtil.extractUriContents(text);
- }
- else if (valueType == CSSPrimitiveValue.CSS_STRING) {
- text = CSSUtil.extractStringContents(text);
- }
- value.setValue(text);
- }
- return value;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl createStringValue(ITextRegionList regions) {
- String type = CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT;
- if (regions.size() == 1) {
- ITextRegion region = regions.get(0);
- type = region.getType();
- }
- return createStringValue(makeString(regions), type);
- }
-
- /**
- *
- */
- private CounterImpl getCounter() {
- CounterImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getCounter();
- }
- else {
- node = (CounterImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_COUNTER);
- }
- return node;
- }
-
- /**
- *
- */
- private CSSPrimitiveValueImpl getCSSPrimitiveValue(short type) {
- CSSPrimitiveValueImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSPrimitiveValue(type);
- }
- else {
- node = (CSSPrimitiveValueImpl) fDocument.createCSSPrimitiveValue(type);
- }
- return node;
- }
-
- /**
- *
- */
- private CSSStyleDeclItemImpl getCSSStyleDeclItem(String propertyName) {
- CSSStyleDeclItemImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSStyleDeclItem(propertyName);
- }
- else {
- node = (CSSStyleDeclItemImpl) fDocument.createCSSStyleDeclItem(propertyName);
- }
- return node;
- }
-
- /**
- *
- */
- static short getFloatValueType(String ident) {
- ident = ident.toLowerCase();
- short valueType;
- if (ident.length() == 0) {
- valueType = CSSPrimitiveValue.CSS_NUMBER;
- }
- else if (ident.equals("%")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
- }
- else if (ident.equalsIgnoreCase("em")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EMS;
- }
- else if (ident.equalsIgnoreCase("ex")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EXS;
- }
- else if (ident.equalsIgnoreCase("px")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PX;
- }
- else if (ident.equalsIgnoreCase("cm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_CM;
- }
- else if (ident.equalsIgnoreCase("mm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MM;
- }
- else if (ident.equalsIgnoreCase("in")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_IN;
- }
- else if (ident.equalsIgnoreCase("pt")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PT;
- }
- else if (ident.equalsIgnoreCase("pc")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PC;
- }
- else if (ident.equalsIgnoreCase("deg")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_DEG;
- }
- else if (ident.equalsIgnoreCase("rad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_RAD;
- }
- else if (ident.equalsIgnoreCase("grad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_GRAD;
- }
- else if (ident.equalsIgnoreCase("ms")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MS;
- }
- else if (ident.equalsIgnoreCase("s")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_S;
- }
- else if (ident.equalsIgnoreCase("hz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_HZ;
- }
- else if (ident.equalsIgnoreCase("khz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_KHZ;
- }
- else {
- valueType = CSSPrimitiveValue.CSS_DIMENSION;
- }
- return valueType;
- }
-
- /**
- *
- */
- static short getFloatValueType(String value, String ident) {
- ident = ident.toLowerCase();
- short valueType;
- if (ident.length() == 0) {
- if (0 <= value.indexOf('.')) {
- valueType = CSSPrimitiveValue.CSS_NUMBER;
- }
- else {
- valueType = ICSSPrimitiveValue.CSS_INTEGER;
- }
- }
- else if (ident.equals("%")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PERCENTAGE;
- }
- else if (ident.equalsIgnoreCase("em")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EMS;
- }
- else if (ident.equalsIgnoreCase("ex")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_EXS;
- }
- else if (ident.equalsIgnoreCase("px")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PX;
- }
- else if (ident.equalsIgnoreCase("cm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_CM;
- }
- else if (ident.equalsIgnoreCase("mm")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MM;
- }
- else if (ident.equalsIgnoreCase("in")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_IN;
- }
- else if (ident.equalsIgnoreCase("pt")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PT;
- }
- else if (ident.equalsIgnoreCase("pc")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_PC;
- }
- else if (ident.equalsIgnoreCase("deg")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_DEG;
- }
- else if (ident.equalsIgnoreCase("rad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_RAD;
- }
- else if (ident.equalsIgnoreCase("grad")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_GRAD;
- }
- else if (ident.equalsIgnoreCase("ms")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_MS;
- }
- else if (ident.equalsIgnoreCase("s")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_S;
- }
- else if (ident.equalsIgnoreCase("hz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_HZ;
- }
- else if (ident.equalsIgnoreCase("khz")) { //$NON-NLS-1$
- valueType = CSSPrimitiveValue.CSS_KHZ;
- }
- else {
- valueType = CSSPrimitiveValue.CSS_DIMENSION;
- }
- return valueType;
- }
-
- /**
- *
- */
- private String getFunctionName(ITextRegionList regions) {
- if (regions == null || regions.size() < 2) {
- return null;
- }
- ITextRegion firstRegion = regions.get(0);
- if (firstRegion.getType() != CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- return null;
- }
- ITextRegion lastRegion = regions.get(regions.size() - 1);
- if (lastRegion.getType() != CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- return null;
- }
- String text = getText(firstRegion);
- return text.substring(0, text.length() - 1);
- }
-
- /**
- * this method has no validation check, then regions must be passed
- * getFunctionName()...
- */
- private ITextRegionList getFunctionParameters(ITextRegionList regions, String[] accepts) {
- ITextRegionList newRegions = new TextRegionListImpl();
- int nAccepts = (accepts != null) ? accepts.length : 0;
- Iterator i = regions.iterator();
- i.next(); // skip FUNCTION
- while (i.hasNext()) {
- ITextRegion region = (ITextRegion) i.next();
- if (region == null) {
- continue;
- }
- String type = region.getType();
- if (isBlank(type)) {
- continue;
- }
- if (nAccepts == 0) {
- newRegions.add(region);
- }
- else {
- for (int iAccept = 0; iAccept < nAccepts; iAccept++) {
- if (type == accepts[iAccept]) {
- newRegions.add(region);
- break;
- }
- }
- }
- }
- return newRegions;
- }
-
- /**
- *
- */
- // private String getPropertyName(IStructuredDocumentRegion flatNode) {
- // Vector nodeRegions = new Vector(flatNode.getRegions());
- // return getPropertyName(nodeRegions);
- // }
- /**
- *
- */
- private String getPropertyName(ITextRegionList nodeRegions) {
- ITextRegionList nameRegions = new TextRegionListImpl();
- String name = null;
- while (!nodeRegions.isEmpty()) {
- ITextRegion region = nodeRegions.remove(0);
- if (region == null) {
- continue;
- }
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- CSSUtil.stripSurroundingSpace(nameRegions);
- name = makeString(nameRegions);
- break;
- }
- else {
- nameRegions.add(region);
- }
- }
- return name;
- }
-
- /**
- *
- */
- private RectImpl getRect() {
- RectImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getRect();
- }
- else {
- node = (RectImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_RECT);
- }
- return node;
- }
-
- /**
- *
- */
- private RGBColorImpl getRGBColor() {
- RGBColorImpl node;
- if (fUpdateContext != null && fUpdateContext.isActive()) {
- node = fUpdateContext.getRGBColor();
- }
- else {
- node = (RGBColorImpl) fDocument.createCSSPrimitiveValue(CSSPrimitiveValue.CSS_RGBCOLOR);
- }
- return node;
- }
-
- /**
- *
- */
- private short getStringValueType(String text, String type) {
- short valueType;
- if (text.toLowerCase().equals("inherit")) { //$NON-NLS-1$
- valueType = ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- valueType = CSSPrimitiveValue.CSS_URI;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING) {
- valueType = CSSPrimitiveValue.CSS_STRING;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- valueType = ICSSPrimitiveValue.CSS_HASH;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && text.equals(",")) { //$NON-NLS-1$
- valueType = ICSSPrimitiveValue.CSS_COMMA;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && text.equals("/")) { //$NON-NLS-1$
- valueType = ICSSPrimitiveValue.CSS_SLASH;
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE) {
- valueType = ICSSPrimitiveValue.CSS_URANGE;
- }
- else {
- valueType = CSSPrimitiveValue.CSS_IDENT;
- }
- return valueType;
- }
-
- /**
- *
- */
- private String makeString(ITextRegionList regions) {
- StringBuffer buf = new StringBuffer();
- boolean bSpace = false;
- for (Iterator i = regions.iterator(); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- String type = region.getType();
- if (!bSpace && isBlank(type)) {
- buf.append(" "); //$NON-NLS-1$
- bSpace = true;
- }
- else {
- buf.append(getText(region));
- bSpace = false;
- }
- }
-
- return buf.toString();
- }
-
- /**
- *
- */
- void setStructuredDocumentTemporary(boolean bTemp) {
- fTempStructuredDocument = bTemp;
- }
-
- /**
- *
- */
- private void setFloatValue(CSSPrimitiveValueImpl value, String text, String type) {
- FloatInfo info = new FloatInfo(text);
- value.setFloatValue(info.getValueType(), info.getValue());
- }
-
- /**
- *
- */
- private void setStringValue(CSSPrimitiveValueImpl value, String text, String type) {
- short valueType = getStringValueType(text, type);
- value.setStringValue(valueType, text);
- }
-
- /**
- * @param item
- * org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclItem
- * @param nodeRegions
- * java.util.Vector
- */
- private void setupImportantAttribute(ICSSStyleDeclItem item, ITextRegionList nodeRegions) {
- if (item == null || nodeRegions == null || nodeRegions.isEmpty()) {
- return;
- }
- ITextRegion region = nodeRegions.get(nodeRegions.size() - 1);
- if (region != null && region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT) {
- item.setPriority(getText(region));
- CSSAttrImpl attr = ((CSSStyleDeclItemImpl) item).getAttributeNode(ICSSStyleDeclItem.IMPORTANT);
- attr.setRangeRegion(fParentRegion, region, region);
- nodeRegions.remove(region);
- }
- }
-
- /**
- *
- */
- void setUpdateContext(CSSModelUpdateContext updateContext) {
- fUpdateContext = updateContext;
- }
-
- /**
- *
- */
- public static boolean hasColonSeparator(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return false;
- }
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0) {
- return false;
- }
-
- for (Iterator i = regions.iterator(); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- if (region == null) {
- continue;
- }
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_SEPARATOR) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- CSSStyleDeclItemImpl setupDeclarationItem(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return null;
- }
- if (!hasColonSeparator(flatNode)) {
- return null;
- }
-
- fParentRegion = flatNode;
-
- ITextRegionList nodeRegions = new TextRegionListImpl(flatNode.getRegions()); // make
- // copy
- CSSStyleDeclItemImpl newItem = createDeclarationItem(nodeRegions);
- if (newItem == null) {
- return null;
- }
- if (!fTempStructuredDocument && flatNode != null) {
- newItem.setRangeStructuredDocumentRegion(flatNode, flatNode);
- }
-
- CSSUtil.stripSurroundingSpace(nodeRegions);
- setupImportantAttribute(newItem, nodeRegions);
- // Now, nodeRegions just has regions for value.
- setupValues(newItem, nodeRegions);
- return newItem;
- }
-
- void setupValues(ICSSStyleDeclItem item, IStructuredDocumentRegion parentRegion, ITextRegionList nodeRegions) {
- fParentRegion = parentRegion;
- setupValues(item, nodeRegions);
- }
-
- /**
- * nodeRegions must be broken. If you need after, make copy of them.
- */
- private void setupValues(ICSSStyleDeclItem item, ITextRegionList nodeRegions) {
- if (item == null) {
- return;
- }
-
- ICSSPrimitiveValue value;
- ITextRegionList regionBuf = new TextRegionListImpl();
-
- String propertyName = item.getPropertyName().toLowerCase();
- boolean bFont = (propertyName.equals(PropCMProperty.P_FONT));
- // (short-hand) font
- int status = (propertyName.equals(PropCMProperty.P_VOICE_FAMILY) || propertyName.equals(PropCMProperty.P_FONT_FAMILY)) ? S_COMMA_SEPARATION : S_NORMAL;
- while (!nodeRegions.isEmpty()) {
- value = null;
- ITextRegion region = nodeRegions.remove(0);
- if (region == null) {
- continue;
- }
- String type = region.getType();
- // if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type
- // == CSSRegionContexts.CSS_RBRACE) {
- // break;
- // }
- switch (status) {
- case S_NORMAL :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- regionBuf.add(region);
- status = S_FUNCTION;
- }
- else if (bFont && type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && fParentRegion.getText(region).equals("/")) { //$NON-NLS-1$
- value = createPrimitiveValue(region);
- status = S_FONT_SLASH;
- }
- else if (!isBlank(type)) {
- value = createPrimitiveValue(region);
- }
- break;
- case S_FUNCTION :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- regionBuf.add(region);
- value = createPrimitiveValue(regionBuf);
- regionBuf.clear();
- status = S_NORMAL;
- }
- else if (!isBlank(type)) {
- regionBuf.add(region);
- }
- break;
- case S_FONT_SLASH :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION) {
- value = createPrimitiveValue(region);
- status = S_COMMA_SEPARATION;
- }
- else if (!isBlank(type)) {
- value = createPrimitiveValue(region);
- }
- break;
- case S_COMMA_SEPARATION :
- if (type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR && fParentRegion.getText(region).equals(",")) { //$NON-NLS-1$
- value = createPrimitiveValue(regionBuf);
- regionBuf.clear();
- if (value != null) {
- if (fUpdateContext == null || !fUpdateContext.isActive()) {
- item.appendValue(value);
- }
- }
- value = createPrimitiveValue(region);
- }
- else {
- regionBuf.add(region);
- }
- break;
- default :
- break;
- }
- if (value != null) {
- if (fUpdateContext == null || !fUpdateContext.isActive()) {
- item.appendValue(value);
- }
- }
- }
- if (!regionBuf.isEmpty()) {
- value = createPrimitiveValue(regionBuf);
- if (fUpdateContext == null || !fUpdateContext.isActive()) {
- item.appendValue(value);
- }
- }
- }
-
- private String getText(ITextRegion region) {
- return (fParentRegion != null) ? fParentRegion.getText(region) : ""; //$NON-NLS-1$
- }
-
- private static boolean isBlank(String type) {
- return (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_S);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java
deleted file mode 100644
index e3a543bc83..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSDocumentImpl.java
+++ /dev/null
@@ -1,163 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-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.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-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.ICSSStyleRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-abstract class CSSDocumentImpl extends CSSStructuredDocumentRegionContainer implements ICSSDocument {
-
- private CSSModelImpl fModel = null;
-
- /**
- * CSSDocumentImpl constructor comment.
- */
- CSSDocumentImpl() {
- super();
- }
-
-
- CSSDocumentImpl(CSSDocumentImpl that) {
- super(that);
- }
-
- ICSSNode createCSSAttr(String name) {
- CSSAttrImpl attr = new CSSAttrImpl(name);
- attr.setOwnerDocument(this);
-
- return attr;
- }
-
- /**
- * @return org.w3c.dom.css.CSSCharsetRule
- */
- public ICSSCharsetRule createCSSCharsetRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSFontFaceRule
- */
- public CSSFontFaceRule createCSSFontFaceRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSImportRule
- */
- public ICSSImportRule createCSSImportRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.ICSSMediaRule
- */
- public ICSSMediaRule createCSSMediaRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPageRule
- */
- public ICSSPageRule createCSSPageRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue createCSSPrimitiveValue(short primitiveType) {
- CSSPrimitiveValueImpl value = null;
- if (primitiveType == CSSPrimitiveValue.CSS_COUNTER)
- value = new CounterImpl();
- else if (primitiveType == CSSPrimitiveValue.CSS_RECT)
- value = new RectImpl();
- else if (primitiveType == CSSPrimitiveValue.CSS_RGBCOLOR)
- value = new RGBColorImpl();
- else
- value = new CSSPrimitiveValueImpl(primitiveType);
- value.setOwnerDocument(this);
-
- return value;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * java.lang.String
- */
- public CSSRule createCSSRule(String rule) {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- public ICSSStyleDeclaration createCSSStyleDeclaration() {
- return null;
- }
-
- public ICSSStyleDeclItem createCSSStyleDeclItem(String propertyName) {
- CSSStyleDeclItemImpl item = new CSSStyleDeclItemImpl(propertyName);
- item.setOwnerDocument(this);
-
- return item;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleRule
- */
- public ICSSStyleRule createCSSStyleRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSUnknownRule
- */
- public CSSUnknownRule createCSSUnknownRule() {
- return null;
- }
-
- /**
- * @return org.w3c.dom.stylesheets.MediaList
- */
- public MediaList createMediaList() {
- return null;
- }
-
- public ICSSModel getModel() {
- return fModel;
- }
-
- void setModel(CSSModelImpl model) {
- this.fModel = model;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java
deleted file mode 100644
index 10cd9f7f61..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSFontFaceRuleImpl.java
+++ /dev/null
@@ -1,67 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-
-/**
- *
- */
-class CSSFontFaceRuleImpl extends CSSRuleDeclContainer implements CSSFontFaceRule {
-
- /**
- *
- */
- CSSFontFaceRuleImpl() {
- super();
- }
-
- CSSFontFaceRuleImpl(CSSFontFaceRuleImpl that) {
- super(that);
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSFontFaceRuleImpl cloned = new CSSFontFaceRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String extractPreString() {
- return "@font-face";//$NON-NLS-1$
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return FONTFACERULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return FONT_FACE_RULE;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java
deleted file mode 100644
index 4fa385b825..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSImportRuleImpl.java
+++ /dev/null
@@ -1,227 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IModelProvideAdapter;
-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.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.URLModelProviderCSS;
-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.DOMException;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- * currently public but may be made default access protected in future.
- */
-public class CSSImportRuleImpl extends CSSRuleImpl implements ICSSImportRule {
-
- private boolean fDirty = true;
- private ICSSStyleSheet fStyleSheet;
-
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSImportRuleImpl() {
- super();
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSImportRuleImpl(CSSImportRuleImpl that) {
- super(that);
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSImportRuleImpl cloned = new CSSImportRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- *
- */
- void closeStyleSheet() {
- if (fStyleSheet != null) {
- ICSSStyleSheet sheet = fStyleSheet;
- fStyleSheet = null; // to prevent loop, we must reset fStyleSheet
- // before all closing action
-
- sheet.getModel().removeStyleListener(getOwnerDocument().getModel());
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
- // if (getOwnerDocument().getModel().getStyleSheetType() ==
- // ICSSModel.EMBEDDED) { // case STYLE tag
- // adapter = (ModelProvideAdapter)
- // ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
- // }
- if (adapter != null)
- adapter.modelRemoved(sheet.getModel());
-
- sheet.getModel().releaseFromRead();
- }
- }
-
- /**
- * The location of the style sheet to be imported. The attribute will not
- * contain the <code>"url(...)"</code> specifier around the URI.
- */
- public String getHref() {
- return CSSUtil.extractUriContents(getAttribute(HREF));
- }
-
- /**
- * A list of media types for which this style sheet may be used.
- */
- public org.w3c.dom.stylesheets.MediaList getMedia() {
- ICSSNode media = getFirstChild();
- if (media != null) {
- if (media instanceof MediaList) {
- return (MediaList) media;
- }
- }
-
- // THIS CASE IS ERROR CASE
- return null;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return IMPORTRULE_NODE;
- }
-
- /**
- * The style sheet referred to by this rule, if it has been loaded. The
- * value of this attribute is <code>null</code> if the style sheet has
- * not yet been loaded or if it will not be loaded (e.g. if the style
- * sheet is for a media type not supported by the user agent).
- */
- public CSSStyleSheet getStyleSheet() {
-
- if (fDirty) {
- // NOTE: try/catch block is a TEMP fix to avoid compile errors:
- try {
- closeStyleSheet();
-
- if (getHref() == null || getHref().length() <= 0) {
- fDirty = false;
- return null;
- }
-
- IStructuredModel baseModel = getOwnerDocument().getModel();
- if (getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) { // case
- // STYLE
- // tag
- baseModel = ((IDOMNode) getOwnerDocument().getModel().getOwnerDOMNode()).getModel();
- }
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
- // if (getOwnerDocument().getModel().getStyleSheetType() ==
- // ICSSModel.EMBEDDED) { // case STYLE tag
- // adapter = (ModelProvideAdapter)
- // ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
- // }
-
- // load model from IModelManager
- URLModelProviderCSS provider = new URLModelProviderCSS();
- IStructuredModel newModel = provider.getModelForRead(baseModel, getHref());
- fDirty = false;
-
- if (newModel == null)
- return null;
- if (!(newModel instanceof ICSSModel)) {
- newModel.releaseFromRead();
- return null;
- }
-
- // notify adapter
- if (adapter != null)
- adapter.modelProvided(newModel);
-
- fStyleSheet = (ICSSStyleSheet) ((ICSSModel) newModel).getDocument();
- if (fStyleSheet != null)
- fStyleSheet.getModel().addStyleListener(getOwnerDocument().getModel());
- }
- catch (java.io.IOException e) {
- Logger.logException(e);
- }
- }
- return fStyleSheet;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return IMPORT_RULE;
- }
-
- /**
- *
- */
- public void refreshStyleSheet() {
- if (!fDirty) {
- closeStyleSheet();
- fDirty = true;
- notify(INodeNotifier.CHANGE, getAttributeNode(HREF), null, null, getStartOffset());
- }
- }
-
- /**
- */
- void releaseRule() {
- if (fStyleSheet != null) {
- ICSSStyleSheet sheet = fStyleSheet;
- fStyleSheet = null; // to prevent loop, we must reset fStyleSheet
- // before all closing action
-
- sheet.getModel().removeStyleListener(getOwnerDocument().getModel());
- // get ModelProvideAdapter
- IModelProvideAdapter adapter = (IModelProvideAdapter) getAdapterFor(IModelProvideAdapter.class);
- // if (getOwnerDocument().getModel().getStyleSheetType() ==
- // ICSSModel.EMBEDDED) { // case STYLE tag
- // adapter = (ModelProvideAdapter)
- // ((INodeNotifier)getOwnerDocument().getModel().getOwnerDOMNode()).getAdapterFor(ModelProvideAdapter.class);
- // }
- if (adapter != null)
- adapter.modelReleased(sheet.getModel());
-
- sheet.getModel().releaseFromRead();
- }
- }
-
- /**
- * @param href
- * java.lang.String
- */
- public void setHref(String href) throws DOMException {
- fDirty = true;
- setAttribute(HREF, CSSLinkConverter.addFunc(href));
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java
deleted file mode 100644
index 0175c877e3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSMediaRuleImpl.java
+++ /dev/null
@@ -1,230 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-class CSSMediaRuleImpl extends CSSRuleImpl implements ICSSMediaRule {
-
- /**
- *
- */
- CSSMediaRuleImpl() {
- super();
- }
-
- CSSMediaRuleImpl(CSSMediaRuleImpl that) {
- super(that);
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule appendRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) appendChild((CSSNodeImpl) rule);
- return ret;
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSMediaRuleImpl cloned = new CSSMediaRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * Used to delete a rule from the media block.
- *
- * @param index
- * The index within the media block's rule collection of the
- * rule to remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not
- * correspond to a rule in the media rule list. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule
- * is readonly.
- */
- public void deleteRule(int index) throws DOMException {
- CSSNodeImpl node = getIndexedRule(index);
- if (node != null)
- removeChild(node);
- }
-
- /**
- * A list of all CSS rules contained within the media block.
- */
- public CSSRuleList getCssRules() {
- CSSRuleListImpl list = new CSSRuleListImpl();
-
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule)
- list.appendNode(node);
- }
-
- return list;
- }
-
- CSSRuleImpl getIndexedRule(int index) {
- if (index < 0)
- return null;
-
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule) {
- if (i++ == index)
- return (CSSRuleImpl) node;
- }
- }
- return null;
- }
-
- /**
- * A list of media types for this rule.
- */
- public MediaList getMedia() {
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof MediaListImpl)
- return (MediaList) node;
- }
-
- return null;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return MEDIARULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return MEDIA_RULE;
- }
-
- /**
- * Used to insert a new rule into the media block.
- *
- * @param rule
- * The parsable text representing the rule. For rule sets this
- * contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index
- * The index within the media block's rule collection of the
- * rule before which to insert the specified rule. If the
- * specified index is equal to the length of the media blocks's
- * rule collection, the rule will be added to the end of the
- * media block.
- * @return The index within the media block's rule collection of the newly
- * inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be
- * inserted at the specified index, e.g., if an
- * <code>@import</code> rule is inserted after a standard rule set or other
- * at-rule. <br>
- * INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly. <br>
- * SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule, int index) throws DOMException {
- int length = getCssRules().getLength();
- if (index < 0 || length < index)
- throw new DOMException(DOMException.INDEX_SIZE_ERR, "");//$NON-NLS-1$
-
- CSSRuleImpl refRule = (length != index) ? getIndexedRule(index) : null;
-
- CSSRuleImpl newRule = (CSSRuleImpl) getOwnerDocument().createCSSRule(rule);
-
- // prevent from nesting @media rule
- if (newRule.getType() == CSSRule.MEDIA_RULE)
- throw new DOMException(DOMException.SYNTAX_ERR, "");//$NON-NLS-1$
-
- insertBefore(newRule, refRule);
-
- return index;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newRule
- * org.w3c.dom.css.CSSRule
- * @param refRule
- * org.w3c.dom.css.CSSRule
- */
- public org.w3c.dom.css.CSSRule insertRuleBefore(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule refRule) throws org.w3c.dom.DOMException {
- if (newRule == null && refRule == null)
- return null;
-
- CSSRule ret = (CSSRule) insertBefore((CSSNodeImpl) newRule, (CSSNodeImpl) refRule);
- return ret;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule removeRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) removeChild((CSSNodeImpl) rule);
- return ret;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newChild
- * org.w3c.dom.css.CSSRule
- * @param oldChild
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule replaceRule(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule oldRule) throws org.w3c.dom.DOMException {
- if (newRule == null && oldRule == null)
- return null;
-
- CSSRule ret = (CSSRule) replaceChild((CSSNodeImpl) newRule, (CSSNodeImpl) oldRule);
- return ret;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java
deleted file mode 100644
index 8494a09af6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelCreationContext.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-
-/**
- * currently public but may be made default access protected in future.
- */
-public class CSSModelCreationContext {
-
- private CSSNodeImpl fRootNode = null;
- private CSSNodeImpl fTargetNode = null;
- private CSSNodeImpl fNextNode = null;
- private int fReparseStart = -1;
- private int fReparseEnd = -1;
-
- /**
- * CSSModelContext constructor comment.
- */
- CSSModelCreationContext(CSSNodeImpl rootNode) {
- super();
-
- fRootNode = rootNode;
- }
-
- /**
- *
- */
- void clear() {
- fNextNode = null;
- fTargetNode = null;
- resetReparseRange();
- }
-
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSNodeImpl getNextNode() {
- return fNextNode;
- }
-
- /**
- *
- */
- int getReparseEnd() {
- return fReparseEnd;
- }
-
- /**
- *
- */
- int getReparseStart() {
- return fReparseStart;
- }
-
- /**
- *
- */
- CSSNodeImpl getRootNode() {
- return fRootNode;
- }
-
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSNodeImpl getTargetNode() {
- return fTargetNode;
- }
-
- /**
- *
- */
- boolean isToReparse() {
- return (0 <= getReparseStart() && 0 <= getReparseEnd());
- }
-
- /**
- *
- */
- void resetReparseRange() {
- fReparseStart = fReparseEnd = -1;
- }
-
- /**
- *
- */
- void setLast() {
- fNextNode = null;
-
- if (!(fRootNode instanceof CSSStructuredDocumentRegionContainer)) {
- fTargetNode = fRootNode;
- }
- else {
- IStructuredDocumentRegion lastStructuredDocumentRegion = ((CSSStructuredDocumentRegionContainer) fRootNode).getLastStructuredDocumentRegion();
- CSSNodeImpl node = fRootNode;
- while (node != null) {
- ICSSNode lastChild = node.getLastChild();
- if (lastChild instanceof CSSStructuredDocumentRegionContainer && ((CSSStructuredDocumentRegionContainer) lastChild).getLastStructuredDocumentRegion() == lastStructuredDocumentRegion) {
- node = (CSSNodeImpl) lastChild;
- }
- else {
- break;
- }
- }
- fTargetNode = node;
- }
- }
-
- /**
- *
- */
- void setNextNode(ICSSNode node) {
- fNextNode = (CSSNodeImpl) node;
- if (fNextNode != null) {
- fTargetNode = (CSSNodeImpl) fNextNode.getParentNode();
- }
- }
-
- /**
- *
- */
- void setReparseEnd(int end) {
- fReparseEnd = end;
- }
-
- /**
- *
- */
- void setReparseStart(int start) {
- fReparseStart = start;
- }
-
- /**
- *
- */
- void setTargetNode(ICSSNode node) {
- fTargetNode = (CSSNodeImpl) node;
- if (fNextNode != null && fNextNode.getParentNode() != fTargetNode) {
- fNextNode = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
deleted file mode 100644
index a864d433d0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelDeletionContext.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-
-
-/**
- *
- */
-class CSSModelDeletionContext {
-
- private int fOldStart = -1;
- private int fOldLength = 0;
- private int fNewStart = -1;
- private int fNewLength = 0;
- private int fLengthDifference = 0;
- private IStructuredDocumentRegionList fOldStructuredDocumentRegions = null;
- // private ICSSNode fRootNode = null;
- private int fRemovedRangeBegin = -1;
- private int fRemovedRangeEnd = -1;
- private CSSNodeListImpl fNodesToBeRemoved = new CSSNodeListImpl();
-
- /**
- * CSSModelDeletionContext constructor comment.
- */
- CSSModelDeletionContext(ICSSNode rootNode) {
- super();
-
- // fRootNode = rootNode;
- }
-
- /**
- *
- */
- boolean addNodeToBeRemoved(ICSSNode node) {
- int nNodes = fNodesToBeRemoved.getLength();
- for (int i = 0; i < nNodes; i++) {
- ICSSNode parent = fNodesToBeRemoved.item(i);
- if (CSSModelUtil.isParentOf(parent, node)) {
- return false;
- }
- }
- fNodesToBeRemoved.appendNode(node);
- return true;
- }
-
- /**
- *
- */
- void expandRemovedRangeBegin(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return;
- }
- int newBegin = flatNode.getStart(); // fOldStart == fNewStart, right??
- if (fRemovedRangeBegin < 0 || newBegin < fRemovedRangeBegin) {
- fRemovedRangeBegin = newBegin;
- }
- }
-
- /**
- *
- */
- void expandRemovedRangeEnd(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return;
- }
- int newEnd = flatNode.getEnd() + ((isOldNode(flatNode)) ? fLengthDifference : 0);
- if (fRemovedRangeEnd < 0 || fRemovedRangeEnd < newEnd) {
- fRemovedRangeEnd = newEnd;
- }
- }
-
- /**
- *
- */
- private CSSStructuredDocumentRegionContainer findContainer(CSSNodeImpl parent, IStructuredDocumentRegion flatNode) {
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- // Am i a container of flatNode?
- IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) parent).getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastNode = ((CSSStructuredDocumentRegionContainer) parent).getLastStructuredDocumentRegion();
- int firstStart = getOriginalOffset(firstNode);
- int lastStart = getOriginalOffset(lastNode);
- int start = flatNode.getStart();
-
- if (firstStart <= start && start <= lastStart) {
- // I am a container, is my child a container ?
- for (ICSSNode node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSNodeImpl) {
- CSSStructuredDocumentRegionContainer container = findContainer((CSSNodeImpl) node, flatNode);
- if (container != null) {
- return container;
- }
- }
- }
- return (CSSStructuredDocumentRegionContainer) parent;
- }
- }
-
- return null;
- }
-
- /**
- *
- */
- CSSStructuredDocumentRegionContainer findDeletionTarget(CSSNodeImpl parent, IStructuredDocumentRegion flatNode) {
- CSSStructuredDocumentRegionContainer target = findContainer(parent, flatNode);
- if (target == null) {
- return null;
- }
-
- // System.out.print(flatNode.toString() + ": ");
-
- // child a(=====)b(=====)c
- // parent (================) a,c can remove parent, but b cannot.
-
- ICSSNode child;
-
- for (child = target.getFirstChild(); child != null && !(child instanceof CSSStructuredDocumentRegionContainer); child = child.getNextSibling()) {
- // just advancing
- }
-
- if (child == null) {
- // System.out.println("target has no children."); // TESTBYCOZY
- return target; // has no child containers.
- }
- else {
- IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) child).getFirstStructuredDocumentRegion();
- if (flatNode.getStart() < getOriginalOffset(firstNode)) {
- // System.out.println("flatNode is in front of first child");
- // // TESTBYCOZY
- return target; // a
- }
- }
-
- for (child = target.getLastChild(); child != null && !(child instanceof CSSStructuredDocumentRegionContainer); child = child.getPreviousSibling()) {
- // just advancing
- }
-
- if (child == null) {
- // System.out.println("target has no children."); // TESTBYCOZY
- return target; // has no child containers.
- }
- else {
- IStructuredDocumentRegion firstNode = ((CSSStructuredDocumentRegionContainer) child).getFirstStructuredDocumentRegion();
- if (getOriginalOffset(firstNode) < flatNode.getStart()) {
- // System.out.println("flatNode is in after of last child");
- // // TESTBYCOZY
- return target; // c
- }
- }
-
- // System.out.println("flatNode inner of children"); // TESTBYCOZY
- return null; // b
- }
-
- /**
- *
- */
- Iterator getNodesToBeRemoved() {
- Collection nodes = new ArrayList();
- int nNodes = fNodesToBeRemoved.getLength();
- for (int i = 0; i < nNodes; i++) {
- nodes.add(fNodesToBeRemoved.item(i));
- }
- return nodes.iterator();
- }
-
- /**
- *
- */
- private int getOriginalOffset(IStructuredDocumentRegion flatNode) {
- int offset = 0;
- if (flatNode != null) {
- offset = flatNode.getStart();
- if (0 <= fLengthDifference) {
- if (fNewStart + fNewLength < offset) {
- offset -= fLengthDifference;
- }
- }
- else {
- if (fOldStart + fOldLength <= offset || (fNewStart < 0 && fOldStart <= offset && !isOldNode(flatNode)) || (0 <= fNewStart && fNewStart + fNewLength <= offset && !isOldNode(flatNode))) {
- offset -= fLengthDifference;
- }
- }
- }
-
- return offset;
- }
-
- /**
- *
- */
- int getRemovedRangeBegin() {
- return fRemovedRangeBegin;
- }
-
- /**
- *
- */
- int getRemovedRangeEnd() {
- return fRemovedRangeEnd;
- }
-
- /**
- *
- */
- private boolean isOldNode(IStructuredDocumentRegion flatNode) {
- if (fOldStructuredDocumentRegions != null) {
- for (Enumeration e = fOldStructuredDocumentRegions.elements(); e.hasMoreElements();) {
- if (e.nextElement() == flatNode) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- void setupContext(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- IStructuredDocumentRegion flatNode = null;
- fOldLength = CSSUtil.getTextLength(oldStructuredDocumentRegions);
- if (oldStructuredDocumentRegions != null && 0 < oldStructuredDocumentRegions.getLength() && (flatNode = oldStructuredDocumentRegions.item(0)) != null) {
- fOldStart = flatNode.getStart();
- }
- else {
- fOldStart = -1;
- }
- fNewLength = CSSUtil.getTextLength(newStructuredDocumentRegions);
- if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength() && (flatNode = newStructuredDocumentRegions.item(0)) != null) {
- fNewStart = flatNode.getStart();
- fRemovedRangeBegin = fNewStart;
- fRemovedRangeEnd = fNewStart + fNewLength;
- }
- else {
- fNewStart = -1;
- fRemovedRangeBegin = fRemovedRangeEnd = -1;
- }
- fLengthDifference = fNewLength - fOldLength;
- fOldStructuredDocumentRegions = oldStructuredDocumentRegions;
-
- // cleanup nodes
- while (0 < fNodesToBeRemoved.getLength()) {
- fNodesToBeRemoved.removeNode(0);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
deleted file mode 100644
index 03d6d40af3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelImpl.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.eventimpl.CSSEmbededStyleNotifyAdapter;
-import org.eclipse.wst.css.core.internal.eventimpl.CSSStyleNotifyAdapter;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-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.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.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-import org.eclipse.wst.css.core.internal.util.SelectorsCollector;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-import org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel;
-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.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.exceptions.ResourceInUse;
-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.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-
-public class CSSModelImpl extends AbstractStructuredModel implements ICSSModel, IStructuredDocumentListener {
-
- private CSSDocumentImpl document = null;
- private org.w3c.dom.Node ownerNode = null;
- private CSSStyleNotifyAdapter styleNotifier = null;
- private CSSModelParser fParser = null;
- private CSSModelUpdater fUpdater = null;
- private boolean fStructuredDocumentUpdate = false;
- private final static String ID_NON_EXTERNAL_CSS = "**_NON_EXTERNAL_CSS_***";//$NON-NLS-1$
-
- /**
- * CSSModelImpl constructor comment.
- *
- */
- public CSSModelImpl() {
- super();
- }
-
- /**
- * @param listener
- * org.eclipse.wst.css.core.event.CSSStyleListener
- */
- public void addStyleListener(ICSSStyleListener listener) {
- getStyleNotifier().addStyleListener(listener);
- }
-
- void attrReplaced(CSSNodeImpl parentNode, CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
- if (!fStructuredDocumentUpdate) {
- CSSModelUpdater updater = getUpdater();
- updater.attrReplaced(parentNode, newAttr, oldAttr);
- }
-
- ICSSSelector removed[] = null, added[] = null;
- if (oldAttr != null && oldAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) oldAttr).getName().equals(ICSSStyleRule.SELECTOR)) {
- CSSAttrImpl attr = (CSSAttrImpl) oldAttr;
- // collect changed selector
- ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
- removed = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- removed[i] = list.getSelector(i);
- }
- if (newAttr != null && newAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) newAttr).getName().equals(ICSSStyleRule.SELECTOR)) {
- CSSAttrImpl attr = (CSSAttrImpl) newAttr;
- // collect changed selector
- ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
- }
- if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- getStyleNotifier().fire(removed, added, null);
- }
- // for href attribute
- if (getStyleListeners() != null && getStyleListeners().size() > 0) {
- boolean update = false;
- if (oldAttr != null && oldAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) oldAttr).getName().equals(ICSSImportRule.HREF)) {
- update = true;
- }
- if (newAttr != null && newAttr.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) newAttr).getName().equals(ICSSImportRule.HREF)) {
- update = true;
- }
- if (update)
- ((ICSSImportRule) parentNode).getStyleSheet();
- }
- }
-
- /**
- *
- */
- public void beginRecording(Object requester, String label, String description) {
- getStyleNotifier().beginRecording();
-
- Node node = getOwnerDOMNode();
- if (node != null && node instanceof IDOMNode) {
- IStructuredModel model = ((IDOMNode) node).getModel();
- if (model != null) {
- model.beginRecording(requester, label, description);
- return;
- }
- }
- super.beginRecording(requester, label, description);
- }
-
- void childReplaced(CSSNodeImpl parentNode, CSSNodeImpl newChild, CSSNodeImpl oldChild) {
- if (!fStructuredDocumentUpdate) {
- CSSModelUpdater updater = getUpdater();
- updater.childReplaced(parentNode, newChild, oldChild);
- }
-
- // always check and send selector event
- ICSSSelector removed[] = null, added[] = null;
- if (parentNode.getNodeType() == ICSSNode.STYLESHEET_NODE || parentNode.getNodeType() == ICSSNode.MEDIARULE_NODE) {
- // collect old selectors
- SelectorsCollector selTrav = new SelectorsCollector();
- selTrav.apply(oldChild);
- int nSel = selTrav.getSelectors().size();
- if (nSel > 0) {
- removed = new ICSSSelector[nSel];
- for (int i = 0; i < nSel; i++)
- removed[i] = (ICSSSelector) selTrav.getSelectors().get(i);
- }
- // collect new selectors
- selTrav = new SelectorsCollector();
- selTrav.apply(newChild);
- nSel = selTrav.getSelectors().size();
- if (nSel > 0) {
- added = new ICSSSelector[nSel];
- for (int i = 0; i < nSel; i++)
- added[i] = (ICSSSelector) selTrav.getSelectors().get(i);
- }
- }
- else {
- // modification
- ICSSNode rule = parentNode;
- while (rule != null) {
- if (rule instanceof ICSSStyleRule)
- break;
- rule = rule.getParentNode();
- }
- if (rule != null) {
- ICSSSelectorList list = ((ICSSStyleRule) rule).getSelectors();
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
- }
- }
- if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- // send selector changed event
- getStyleNotifier().fire(removed, added, null);
- }
- // close removed import-rule's external style sheets
- {
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(oldChild);
- Iterator it = trav.getRules().iterator();
- while (it.hasNext()) {
- ((CSSImportRuleImpl) it.next()).closeStyleSheet();
- }
- }
- // send events to listener for new import-rules
- if (getStyleListeners() != null && getStyleListeners().size() > 0) {
- ImportedCollector trav = new ImportedCollector();
- trav.apply(newChild);
- }
- }
-
- /**
- *
- */
- private void closeImported() {
- if (!isShared()) {
- // release listeners
- if (getStyleListeners() != null) {
- Vector toRemove = new Vector(getStyleListeners());
- Iterator it = toRemove.iterator();
- while (it.hasNext()) {
- removeStyleListener((ICSSStyleListener) it.next());
- }
- }
- // close import rules
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(getDocument());
- Iterator it2 = trav.getRules().iterator();
- while (it2.hasNext()) {
- ((CSSImportRuleImpl) it2.next()).releaseRule();
- }
- }
- }
-
- private CSSDocumentImpl createDocument() {
- CSSDocumentImpl doc = null;
- int parserMode = CSSSourceParser.MODE_STYLESHEET;
- if (ownerNode == null) {
- // this case is external CSS file
- doc = (CSSStyleSheetImpl) DOMCSSImpl.createCSSStyleSheet(null, null); // parameters
- // are
- // for
- // STYLE-tag
- parserMode = CSSSourceParser.MODE_STYLESHEET;
- }
- else if (ownerNode instanceof org.w3c.dom.Element && ((Element) ownerNode).getTagName().toUpperCase().equals("STYLE")) {//$NON-NLS-1$
- // this case is STYLE-tag
- Element style = (Element) ownerNode;
- doc = (CSSStyleSheetImpl) DOMCSSImpl.createCSSStyleSheet(style.getAttribute("TITLE"), //$NON-NLS-1$
- style.getAttribute("MEDIA"));//$NON-NLS-1$
- parserMode = CSSSourceParser.MODE_STYLESHEET;
- }
- else if (ownerNode instanceof org.w3c.dom.Element || ownerNode instanceof org.w3c.dom.Attr) {
- // Inline attributes
- doc = (CSSStyleDeclarationImpl) DOMCSSImpl.createCSSStyleDeclaration();
- parserMode = CSSSourceParser.MODE_DECLARATION;
- }
- RegionParser regionParser = getStructuredDocument().getParser();
- if (regionParser instanceof CSSSourceParser) {
- ((CSSSourceParser) regionParser).setParserMode(parserMode);
- }
- return doc;
- }
-
- /**
- *
- */
- public void endRecording(Object requester) {
- Node node = getOwnerDOMNode();
- if (node != null && node instanceof IDOMNode) {
- IStructuredModel model = ((IDOMNode) node).getModel();
- if (model != null) {
- model.endRecording(requester);
- return;
- }
- }
- super.endRecording(requester);
-
- getStyleNotifier().endRecording();
- }
-
- public ICSSDocument getDocument() {
- if (document == null) {
- this.document = createDocument();
- this.document.setModel(this);
- }
- return this.document;
- }
-
- public IStructuredDocument getStructuredDocument() {
- IStructuredDocument structuredDocument = null;
- structuredDocument = super.getStructuredDocument();
- if (structuredDocument != null)
- return structuredDocument;
-
- // the first time
- Assert.isNotNull(getModelHandler());
- structuredDocument = (IStructuredDocument) getModelHandler().getDocumentLoader().createNewStructuredDocument();
-
- setStructuredDocument(structuredDocument);
- return structuredDocument;
- }
-
- /**
- * getNode method comment.
- */
- public IndexedRegion getIndexedRegion(int offset) {
- if (getDocument() == null)
- return null;
- return ((CSSStructuredDocumentRegionContainer) getDocument()).getContainerNode(offset);
- }
-
- /**
- * @return org.w3c.dom.Node
- */
- public Node getOwnerDOMNode() {
- return ownerNode;
- }
-
- /**
- * @param ownerNode
- * org.w3c.dom.Node if the case of external CSS model, you
- * should set null, else if internal css, you should set
- * STYLE-tag node, else if inline css, you should set the
- * element that is the owner of style-attribute.
- */
- public void setOwnerDOMNode(Node node) {
- // prohibit owner change
- Assert.isTrue(ownerNode == null);
- ownerNode = node;
- if (ownerNode != null) { // for internal/inline CSS context
- try {
- setId(ID_NON_EXTERNAL_CSS);
- }
- catch (ResourceInUse e) {
- // impossible
- }
- }
- }
-
- /**
- * currently public but may be made default access protected in future.
- */
- protected CSSModelParser getParser() {
- if (fParser == null) {
- if (getDocument() != null) {
- fParser = new CSSModelParser(document);
- }
- }
- return fParser;
- }
-
- /**
- * @return java.util.List
- */
- public List getStyleListeners() {
- return getStyleNotifier().getStyleListeners();
- }
-
- /**
- *
- * @return java.lang.Object
- */
- public java.lang.Object getStyleSheetType() {
- if (getDocument() instanceof ICSSStyleDeclaration)
- return INLINE;
- if (getOwnerDOMNode() != null)
- return EMBEDDED;
- else
- return EXTERNAL;
- }
-
- private CSSStyleNotifyAdapter getStyleNotifier() {
- if (styleNotifier == null) {
- styleNotifier = (ownerNode != null) ? new CSSEmbededStyleNotifyAdapter(this) : new CSSStyleNotifyAdapter(this);
- }
- return styleNotifier;
- }
-
- /**
- *
- */
- private CSSModelUpdater getUpdater() {
- if (fUpdater == null) {
- fUpdater = new CSSModelUpdater(this);
- fUpdater.setParser(getParser());
- }
- return fUpdater;
- }
-
- /**
- */
- public boolean isRecording() {
- return getStyleNotifier().isRecording();
- }
-
- /**
- * This function returns true if there are other references to the
- * underlying model.
- */
- public boolean isShared() {
- return (getStyleSheetType() == EXTERNAL) && super.isShared();
- }
-
- public void newModel(NewDocumentEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null)
- return;
- IStructuredDocument structuredDocument = structuredDocumentEvent.getStructuredDocument();
- if (structuredDocument == null)
- return;
- // this should not happen, but for the case
- if (structuredDocument != getStructuredDocument())
- setStructuredDocument(structuredDocument);
- IStructuredDocumentRegionList flatNodes = structuredDocument.getRegionList();
- if (flatNodes == null)
- return;
- if (getDocument() == null)
- return;
-
- fStructuredDocumentUpdate = true;
-
- ((CSSStructuredDocumentRegionContainer) getDocument()).removeChildNodes();
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.replaceStructuredDocumentRegions(flatNodes, null);
-
- fStructuredDocumentUpdate = false;
- }
-
- /**
- * noChange method comment.
- */
- public void noChange(NoChangeEvent structuredDocumentEvent) {
- // nop
- }
-
- public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null) {
- return;
- }
- IStructuredDocumentRegionList oldStructuredDocumentRegions = structuredDocumentEvent.getOldStructuredDocumentRegions();
- IStructuredDocumentRegionList newStructuredDocumentRegions = structuredDocumentEvent.getNewStructuredDocumentRegions();
- if (oldStructuredDocumentRegions == null && newStructuredDocumentRegions == null) {
- return;
- }
-
- fStructuredDocumentUpdate = true;
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.replaceStructuredDocumentRegions(newStructuredDocumentRegions, oldStructuredDocumentRegions);
-
- fStructuredDocumentUpdate = false;
- }
-
- /**
- * cleanup -> rebuild CSS Nodes This is pre-beta fix for 178176.
- */
- public void refreshNodes() {
- // cleanup old nodes
- fStructuredDocumentUpdate = true;
- ((CSSStructuredDocumentRegionContainer) getDocument()).removeChildNodes();
- fStructuredDocumentUpdate = false;
-
- getParser().cleanupUpdateContext();
-
- IStructuredDocument structuredDocument = getStructuredDocument();
- String source = structuredDocument.getText();
-
- structuredDocument.replaceText(this, 0, source.length(), null);
- structuredDocument.replaceText(this, 0, 0, source);
- }
-
- public void regionChanged(RegionChangedEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null) {
- return;
- }
- IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
- if (flatNode == null) {
- return;
- }
- ITextRegion region = structuredDocumentEvent.getRegion();
- if (region == null) {
- return;
- }
-
- fStructuredDocumentUpdate = true;
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.changeRegion(flatNode, region);
-
- fStructuredDocumentUpdate = false;
- }
-
- public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) {
- if (structuredDocumentEvent == null)
- return;
- IStructuredDocumentRegion flatNode = structuredDocumentEvent.getStructuredDocumentRegion();
- if (flatNode == null)
- return;
- ITextRegionList oldRegions = structuredDocumentEvent.getOldRegions();
- ITextRegionList newRegions = structuredDocumentEvent.getNewRegions();
- if (oldRegions == null && newRegions == null)
- return;
-
- fStructuredDocumentUpdate = true;
-
- CSSModelParser parser = getParser();
- parser.setStructuredDocumentEvent(structuredDocumentEvent);
- parser.replaceRegions(flatNode, newRegions, oldRegions);
-
- fStructuredDocumentUpdate = false;
-
- }
-
- /**
- *
- */
- public void releaseFromEdit() {
- closeImported();
- if (getStyleSheetType() == EXTERNAL) {
- super.releaseFromEdit();
- }
- }
-
- /**
- *
- */
- public void releaseFromRead() {
- closeImported();
- if (getStyleSheetType() == EXTERNAL) {
- super.releaseFromRead();
- }
- }
-
- /**
- * @param listener
- * org.eclipse.wst.css.core.event.CSSStyleListener
- */
- public void removeStyleListener(ICSSStyleListener listener) {
- getStyleNotifier().removeStyleListener(listener);
- }
-
- public void setStructuredDocument(IStructuredDocument newStructuredDocument) {
- IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
- if (newStructuredDocument == oldStructuredDocument)
- return; // noting to do
-
- if (oldStructuredDocument != null)
- oldStructuredDocument.removeDocumentChangingListener(this);
- super.setStructuredDocument(newStructuredDocument);
-
- if (newStructuredDocument != null) {
- if (newStructuredDocument.getLength() > 0) {
- newModel(new NewDocumentEvent(newStructuredDocument, this));
- }
- newStructuredDocument.addDocumentChangingListener(this);
- }
- }
-
- /**
- * @param srcModel
- * com.imb.sed.css.mode.intefaces.ICSSModel
- * @param removed
- * org.eclipse.wst.css.core.model.interfaces.ICSSSelector[]
- * @param added
- * org.eclipse.wst.css.core.model.interfaces.ICSSSelector[]
- */
- public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- getStyleNotifier().styleChanged(srcModel, removed, added, media);
- }
-
- /**
- * @param srcModel
- * org.eclipse.wst.css.core.model.interfaces.ICSSModel
- */
- public void styleUpdate(ICSSModel srcModel) {
- getStyleNotifier().styleUpdate(srcModel);
- }
-
- void valueChanged(CSSNodeImpl node, String oldValue) {
- if (!fStructuredDocumentUpdate) {
- CSSModelUpdater updater = getUpdater();
- updater.valueChanged(node, oldValue);
- }
-
- ICSSSelector removed[] = null, added[] = null;
- if (node != null) {
- if (node.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) node).getName().equals(ICSSStyleRule.SELECTOR)) {
- CSSAttrImpl attr = (CSSAttrImpl) node;
- // collect changed selector
- ICSSSelectorList list = new CSSSelectorListImpl(attr.getValue());
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
-
- // get old value
- list = new CSSSelectorListImpl(oldValue);
- removed = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- removed[i] = list.getSelector(i);
- }
- else if (node instanceof ICSSValue) {
- ICSSNode rule = node;
- while (rule != null) {
- if (rule instanceof ICSSStyleRule)
- break;
- rule = rule.getParentNode();
- }
- if (rule != null) {
- ICSSSelectorList list = ((ICSSStyleRule) rule).getSelectors();
- added = new ICSSSelector[list.getLength()];
- for (int i = 0; i < list.getLength(); i++)
- added[i] = list.getSelector(i);
- }
- }
- }
- if (removed != null || added != null || getDocument().getNodeType() == ICSSNode.STYLEDECLARATION_NODE) {
- // send selector changed event
- getStyleNotifier().fire(removed, added, null);
- }
- // for href attribute
- if (getStyleListeners() != null && getStyleListeners().size() > 0) {
- if (node != null && node.getNodeType() == ICSSNode.ATTR_NODE && ((CSSAttrImpl) node).getName().equals(ICSSImportRule.HREF)) {
- ((ICSSImportRule) ((ICSSAttr) node).getOwnerCSSNode()).getStyleSheet();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java
deleted file mode 100644
index d6e6486406..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelNodeFeeder.java
+++ /dev/null
@@ -1,126 +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.css.core.internal.document;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-
-
-/**
- *
- */
-class CSSModelNodeFeeder {
- /**
- * currently ICSSDocument is used but may go back to CSSDocumentImpl in future.
- */
- ICSSDocument fDocument = null;
- CSSModelUpdateContext fUpdateContext = null;
-
- /**
- * CSSModelNodeFeeder constructor comment.
- */
- CSSModelNodeFeeder() {
- super();
- }
-
- /**
- * CSSModelNodeFeeder constructor comment.
- * currently ICSSDocument is used but may go back to CSSDocumentImpl in future.
- */
- CSSModelNodeFeeder(ICSSDocument document, CSSModelUpdateContext updateContext) {
- super();
- fDocument = document;
- fUpdateContext = updateContext;
- }
-
- /**
- *
- */
- CSSCharsetRuleImpl getCSSCharsetRule() {
- CSSCharsetRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSCharsetRule();
- }
- else {
- node = (CSSCharsetRuleImpl) fDocument.createCSSCharsetRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSFontFaceRuleImpl getCSSFontFaceRule() {
- CSSFontFaceRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSFontFaceRule();
- }
- else {
- node = (CSSFontFaceRuleImpl) fDocument.createCSSFontFaceRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSImportRuleImpl getCSSImportRule() {
- CSSImportRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSImportRule();
- }
- else {
- node = (CSSImportRuleImpl) fDocument.createCSSImportRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSMediaRuleImpl getCSSMediaRule() {
- CSSMediaRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSMediaRule();
- }
- else {
- node = (CSSMediaRuleImpl) fDocument.createCSSMediaRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSPageRuleImpl getCSSPageRule() {
- CSSPageRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSPageRule();
- }
- else {
- node = (CSSPageRuleImpl) fDocument.createCSSPageRule();
- }
- return node;
- }
-
- /**
- *
- */
- CSSStyleRuleImpl getCSSStyleRule() {
- CSSStyleRuleImpl node;
- if (fUpdateContext.isActive()) {
- node = fUpdateContext.getCSSStyleRule();
- }
- else {
- node = (CSSStyleRuleImpl) fDocument.createCSSStyleRule();
- }
- return node;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
deleted file mode 100644
index 82adaa2543..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelParser.java
+++ /dev/null
@@ -1,1296 +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.css.core.internal.document;
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-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.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSRuleContainer;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.text.StructuredDocumentWalker;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-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.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.CoreNodeList;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- * currently public but may be made default access protected in future.
- */
-public class CSSModelParser {
-
- private ICSSDocument fDocument = null;
- private CSSModelCreationContext fCreationContext = null;
- private CSSModelDeletionContext fDeletionContext = null;
- private CSSModelUpdateContext fUpdateContext = null;
- private CSSModelNodeFeeder fFeeder = null;
- private StructuredDocumentWalker fStructuredDocumentWalker = null;
- private boolean fParseFloating = false;
-
- /**
- * CSSModelParser constructor comment.
- */
- private CSSModelParser() {
- super();
- }
-
- /**
- * currently provded this method but may be removed in future.
- */
- protected boolean isParseFloating(){
- return fParseFloating;
- }
- /**
- * currently provded this method but may be removed in future.
- */
- protected CSSModelCreationContext getCreationContext(){
- return fCreationContext;
- }
- /**
- * currently provded this method but may be removed in future.
- */
- protected boolean isUpdateContextActive(){
- return fUpdateContext != null ? fUpdateContext.isActive() : false;
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSModelParser(ICSSDocument doc) {
- this();
- fDocument = doc;
- fCreationContext = new CSSModelCreationContext((CSSNodeImpl)doc);
- fDeletionContext = new CSSModelDeletionContext(doc);
- fUpdateContext = new CSSModelUpdateContext();
- fFeeder = new CSSModelNodeFeeder(doc, fUpdateContext);
- }
-
- /**
- *
- */
- void changeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- replaceStructuredDocumentRegions(new CoreNodeList(flatNode, flatNode), new CoreNodeList(flatNode, flatNode));
- }
-
- /**
- *
- */
- void changeRegion(IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (flatNode == null || region == null) {
- return;
- }
- if (fDocument == null) {
- return;
- }
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- *
- */
- private void checkNextNode(IStructuredDocumentRegion flatNode, String type) {
- IStructuredDocumentRegion next = CSSUtil.findNextSignificantNode(flatNode);
- if (CSSUtil.getStructuredDocumentRegionType(next) == type) {
- fCreationContext.setReparseStart(flatNode.getEnd());
- fCreationContext.setReparseEnd(next.getEnd());
- }
- }
-
- /**
- *
- */
- private void cleanupDeletionContext() {
- // setupDeletionContext(null);
- }
-
- /**
- *
- */
- boolean cleanupFirstNode(IStructuredDocumentRegion firstNode, CSSStructuredDocumentRegionContainer target) {
- if (firstNode == null || target == null) {
- return false;
- }
-
- if (firstNode == target.getFirstStructuredDocumentRegion()) {
- IStructuredDocumentRegion nextNode = fStructuredDocumentWalker.getNextNodeInCurrent(firstNode);
- IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
- if (lastNode == null || fStructuredDocumentWalker.isOldNode(lastNode) || nextNode == null || lastNode.getStartOffset() < nextNode.getStartOffset()) {
- target.setRangeStructuredDocumentRegion(null, null);
- }
- else {
- target.setFirstStructuredDocumentRegion(nextNode);
- }
- ICSSNode parent = target.getParentNode();
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- cleanupFirstNode(firstNode, (CSSStructuredDocumentRegionContainer) parent);
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- boolean cleanupLastNode(IStructuredDocumentRegion lastNode, CSSStructuredDocumentRegionContainer target) {
- if (lastNode == null || target == null) {
- return false;
- }
-
- if (lastNode == target.getLastStructuredDocumentRegion()) {
- IStructuredDocumentRegion prevNode = fStructuredDocumentWalker.getPrevNodeInCurrent(lastNode);
- IStructuredDocumentRegion firstNode = target.getFirstStructuredDocumentRegion();
- if (firstNode == null || fStructuredDocumentWalker.isOldNode(firstNode) || prevNode == null || prevNode.getStartOffset() < firstNode.getStartOffset()) {
- target.setRangeStructuredDocumentRegion(null, null);
- }
- else {
- target.setLastStructuredDocumentRegion(prevNode);
- }
- ICSSNode parent = target.getParentNode();
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- cleanupLastNode(lastNode, (CSSStructuredDocumentRegionContainer) parent);
- return true;
- }
- }
-
- return false;
- }
-
- /**
- *
- */
- int cleanupUpdateContext() {
- int remains = fUpdateContext.getNodeCount();
- fUpdateContext.cleanupContext();
- return remains;
- }
-
- /**
- * create floating CSS rule (owner document will be set) this is for
- * CSSStyleSheet.createCSSRule(String)
- *
- * @return org.w3c.dom.css.CSSRule
- */
- CSSRule createCSSRule(IStructuredDocumentRegionList flatNodes) {
- if (flatNodes == null) {
- return null;
- }
-
- fParseFloating = true;
-
- // setup creation context
- fCreationContext.clear();
- fCreationContext.setTargetNode(null);
- fCreationContext.setNextNode(null);
- CSSRuleImpl parentRule = null;
-
- for (Enumeration e = flatNodes.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode == null) {
- continue;
- }
- CSSNodeImpl modified = insertStructuredDocumentRegion(flatNode);
- if (parentRule == null && modified instanceof CSSRuleImpl) {
- parentRule = (CSSRuleImpl) modified;
- }
- }
-
- fParseFloating = false;
-
- if (parentRule != null) {
- CSSModelUtil.cleanupContainer(parentRule);
- }
-
- return parentRule;
- }
-
- /**
- *
- */
- private IStructuredDocumentRegion findBraceClose(int depth, IStructuredDocumentRegion start, boolean bBreakSibling) {
- IStructuredDocumentRegion result = null;
- int braceLevel = 0;
- IStructuredDocumentRegion prevNode = null;
- IStructuredDocumentRegion region = start.getNext();
- for (; region != null; region = region.getNext()) {
- int offset = region.getStart();
- if (offset < 0) {
- Assert.isTrue(false);
- break;
- }
- CSSNodeImpl node = getNodeAt(offset);
- int depthHit = (node != null) ? CSSModelUtil.getDepth(node) : -1;
- if (depth <= depthHit) {
- // sibling is found before "}"
- if (bBreakSibling) {
- CSSNodeImpl parent = (CSSNodeImpl) node.getParentNode();
- while (depth <= CSSModelUtil.getDepth(parent)) {
- node = parent;
- parent = (CSSNodeImpl) parent.getParentNode();
- }
- if (parent != null && node != null) {
- parent.removeChild(node);
- }
- }
- else {
- result = prevNode;
- break;
- }
- }
- String type = CSSUtil.getStructuredDocumentRegionType(region);
- if (type == CSSRegionContexts.CSS_LBRACE) {
- braceLevel++;
- }
- if (type == CSSRegionContexts.CSS_RBRACE) {
- braceLevel--;
- if (braceLevel < 0) {
- result = region;
- break;
- }
- }
- prevNode = region;
- }
-
- if (result == null && region == null) {
- // reach the end of document
- result = prevNode;
- }
-
- return result;
- }
-
- /**
- *
- */
- private IStructuredDocumentRegionList getStructuredDocumentRegionList(int start, int end) {
- IStructuredDocumentRegionList nodeList = null;
- if (0 <= start && start <= end) {
- ICSSModel model = fDocument.getModel();
- if (model instanceof CSSModelImpl) {
- IStructuredDocument structuredDocument = ((CSSModelImpl) model).getStructuredDocument();
- if (structuredDocument != null) {
- IStructuredDocumentRegion startNode = structuredDocument.getRegionAtCharacterOffset(start);
- IStructuredDocumentRegion endNode = structuredDocument.getRegionAtCharacterOffset(end - 1);
- if (startNode != null && endNode != null) {
- nodeList = new CoreNodeList(startNode, endNode);
- }
- }
- }
- }
-
- return nodeList;
- }
-
- /**
- *
- */
- private CSSNodeImpl getNodeAt(int offset) {
- CSSNodeImpl rootNode = fCreationContext.getRootNode();
- ICSSNode target = rootNode.getNodeAt(offset);
- if (target instanceof CSSNodeImpl) {
- return (CSSNodeImpl) target;
- }
- else {
- return null;
- }
- }
-
- /**
- *
- */
- private CSSNodeImpl insertBraceClose(IStructuredDocumentRegion region) {
- ICSSNode target = CSSModelUtil.findBraceContainer(fCreationContext.getTargetNode());
-
- if (!(target instanceof CSSStructuredDocumentRegionContainer)) {
- return null;
- }
-
- CSSStructuredDocumentRegionContainer parent = (CSSStructuredDocumentRegionContainer) target;
- if (CSSModelUtil.isInterruption(parent, region)) {
- ICSSNode node = parent.getParentNode();
- if (node instanceof CSSNodeImpl) {
- fCreationContext.setReparseStart(parent.getStartOffset());
- fCreationContext.setReparseEnd(parent.getEndOffset());
- ((CSSNodeImpl) node).removeChild(parent);
- }
- return null;
- }
-
- if (parent instanceof ICSSPageRule || parent instanceof ICSSMediaRule || parent instanceof CSSFontFaceRule || parent instanceof ICSSStyleRule) {
- CSSModelUtil.expandStructuredDocumentRegionContainer(parent, region);
- if (!CSSModelUtil.isBraceClosed(target)) {
- fCreationContext.setTargetNode(parent.getParentNode());
- fCreationContext.setNextNode(parent.getNextSibling());
- return parent;
- }
- }
-
- return null;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertBraceOpen(IStructuredDocumentRegion region) {
- IStructuredDocumentRegion keyRegion = CSSUtil.findPreviousSignificantNode(region);
- if (keyRegion == null) {
- return null;
- }
- if (!fParseFloating) {
- CSSNodeImpl node = getNodeAt(keyRegion.getStartOffset());
- if (node != null && !(node instanceof ICSSRuleContainer)) {
- return null;
- }
- }
- String type = CSSUtil.getStructuredDocumentRegionType(keyRegion);
-
- CSSNodeImpl inserted = null;
- if (type == CSSRegionContexts.CSS_PAGE) {
- inserted = insertPageRule(keyRegion, region);
- }
- else if (type == CSSRegionContexts.CSS_MEDIA) {
- inserted = insertMediaRule(keyRegion, region);
- }
- else if (type == CSSRegionContexts.CSS_FONT_FACE) {
- inserted = insertFontFaceRule(keyRegion, region);
- }
- else if (CSSUtil.isSelectorText(keyRegion)) {
- inserted = insertStyleRule(keyRegion, region);
- }
-
- if (inserted instanceof CSSStructuredDocumentRegionContainer) {
- // CSSModelUtil.expandStructuredDocumentRegionContainer((CSSStructuredDocumentRegionContainer)inserted,
- // flatNode);
- IStructuredDocumentRegion braceClose = findBraceClose(CSSModelUtil.getDepth(inserted), region, (type == CSSRegionContexts.CSS_MEDIA));
- if (braceClose != null) {
- fCreationContext.setReparseStart(region.getEnd());
- fCreationContext.setReparseEnd(braceClose.getEnd());
- }
- }
-
- return inserted;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertCharsetRule(IStructuredDocumentRegion beginDocRegion, IStructuredDocumentRegion endDocRegion) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- ITextRegionList regions = new TextRegionListImpl(beginDocRegion.getRegions());
- regions.remove(0); // must be "@charset"
- ITextRegion encodingRegion = null;
- while (!regions.isEmpty()) {
- ITextRegion textRegion = regions.remove(0);
- if (textRegion == null) {
- continue;
- }
- String type = textRegion.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- continue;
- }
- if (type == CSSRegionContexts.CSS_STRING) {
- encodingRegion = textRegion;
- break;
- }
- else {
- break;
- }
- }
- if (encodingRegion == null) {
- return null;
- }
-
- CSSCharsetRuleImpl rule = fFeeder.getCSSCharsetRule();
- if (rule == null) {
- return null;
- }
-
- if (!fUpdateContext.isActive()) {
- rule.setAttribute(ICSSCharsetRule.ENCODING, beginDocRegion.getText(encodingRegion));
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(beginDocRegion, endDocRegion);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSCharsetRule.ENCODING);
- if (attr != null) {
- attr.setRangeRegion(beginDocRegion, encodingRegion, encodingRegion);
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- return rule;
- }
-
- /**
- * currently public but may be made default access protected in future.
- */
- protected CSSNodeImpl insertStructuredDocumentRegion(IStructuredDocumentRegion region) {
- if (fCreationContext == null || region == null) {
- return null;
- }
-
- String type = ((BasicStructuredDocumentRegion) region).getType();
- CSSNodeImpl modified = null;
-
- ICSSNode target = fCreationContext.getTargetNode();
-
- if ((fParseFloating && target == null) || target instanceof ICSSRuleContainer) {
- if (type == CSSRegionContexts.CSS_DELIMITER) {
- modified = insertSemiColonForRule(region);
- }
- else if (type == CSSRegionContexts.CSS_LBRACE) {
- modified = insertBraceOpen(region);
- }
- else if (type == CSSRegionContexts.CSS_RBRACE) {
- modified = insertBraceClose(region);
- }
- else if (type == CSSRegionContexts.CSS_MEDIA || type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_FONT_FACE || CSSUtil.isSelectorText(region)) {
- checkNextNode(region, CSSRegionContexts.CSS_LBRACE);
- }
- else if (type == CSSRegionContexts.CSS_IMPORT || type == CSSRegionContexts.CSS_CHARSET) {
- checkNextNode(region, CSSRegionContexts.CSS_DELIMITER);
- }
- }
- else if ((target instanceof CSSRuleDeclContainer || target instanceof CSSStyleDeclaration) && type == CSSRegionContexts.CSS_DECLARATION_PROPERTY) {
- modified = insertStyleDeclarationItem(region);
- }
- else if (target instanceof ICSSStyleDeclItem && type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- modified = insertSemiColonForStyleDeclarationItem(region);
- }
- else if (type == CSSRegionContexts.CSS_RBRACE) {
- modified = insertBraceClose(region);
- }
-
- // post process
- if (modified != null) {
- if (modified instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) modified).propagateRangeStructuredDocumentRegion();
- }
- }
-
- return modified;
- }
-
- /**
- *
- */
- private void insertStructuredDocumentRegions(IStructuredDocumentRegionList regionList) {
- for (Enumeration e = regionList.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion region = (IStructuredDocumentRegion) e.nextElement();
- if (region == null) {
- continue;
- }
- insertStructuredDocumentRegion(region);
- if (fCreationContext.isToReparse()) {
- int origStart = region.getEnd();
- int origEnd = regionList.item(regionList.getLength() - 1).getEnd();
- int newStart = fCreationContext.getReparseStart();
- int newEnd = fCreationContext.getReparseEnd();
- if (newStart < origStart || origEnd < newEnd) {
- IStructuredDocumentRegionList newNodeList = getStructuredDocumentRegionList(newStart, newEnd);
- setupCreationContext(newNodeList.item(0));
- insertStructuredDocumentRegions(newNodeList);
- return;
- }
- else {
- fCreationContext.resetReparseRange();
- }
- }
- }
- }
-
- /**
- *
- */
- private CSSNodeImpl insertFontFaceRule(IStructuredDocumentRegion region, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- CSSFontFaceRuleImpl rule = fFeeder.getCSSFontFaceRule();
- if (rule == null) {
- return null;
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(region, braceNode);
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertImportRule(IStructuredDocumentRegion beginDocRegion, IStructuredDocumentRegion endDocRegion) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- ITextRegionList regions = new TextRegionListImpl(beginDocRegion.getRegions());
- regions.remove(0); // must be "@import"
- ITextRegion hrefRegion = null;
- while (!regions.isEmpty()) {
- ITextRegion textRegion = regions.remove(0);
- if (textRegion == null) {
- continue;
- }
- String type = textRegion.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- continue;
- }
- if (type == CSSRegionContexts.CSS_URI || type == CSSRegionContexts.CSS_STRING) {
- hrefRegion = textRegion;
- break;
- }
- else {
- break;
- }
- }
- if (hrefRegion == null) {
- return null;
- }
-
- CSSImportRuleImpl rule = fFeeder.getCSSImportRule();
- if (rule == null) {
- return null;
- }
-
- CSSUtil.stripSurroundingSpace(regions);
- MediaListImpl mediaList = (MediaListImpl) rule.getMedia();
- setMediaList(mediaList, beginDocRegion, regions);
-
- if (!fUpdateContext.isActive()) {
- rule.setAttribute(ICSSImportRule.HREF, beginDocRegion.getText(hrefRegion));
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(beginDocRegion, endDocRegion);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSImportRule.HREF);
- if (attr != null) {
- attr.setRangeRegion(beginDocRegion, hrefRegion, hrefRegion);
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertMediaRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- CSSMediaRuleImpl rule = fFeeder.getCSSMediaRule();
- if (rule == null) {
- return null;
- }
-
- ITextRegionList regions = new TextRegionListImpl(flatNode.getRegions());
- regions.remove(0); // must be "@media"
-
- CSSUtil.stripSurroundingSpace(regions);
- MediaListImpl mediaList = (MediaListImpl) rule.getMedia();
- setMediaList(mediaList, flatNode, regions);
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertPageRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- // get selector regions
- ITextRegionList selectorRegions = new TextRegionListImpl(flatNode.getRegions());
- selectorRegions.remove(0); // must be "@page"
- CSSUtil.stripSurroundingSpace(selectorRegions);
-
- CSSPageRuleImpl rule = fFeeder.getCSSPageRule();
- if (rule == null) {
- return null;
- }
-
- if (!fUpdateContext.isActive()) {
- String selectorStr = CSSUtil.getRegionText(flatNode, selectorRegions);
- if (0 < selectorStr.length()) {
- rule.setSelectorText(selectorStr);
- }
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSPageRule.SELECTOR);
- if (attr != null && selectorRegions != null && !selectorRegions.isEmpty()) {
- attr.setRangeRegion(flatNode, selectorRegions.get(0), selectorRegions.get(selectorRegions.size() - 1));
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertSemiColonForRule(IStructuredDocumentRegion region) {
- IStructuredDocumentRegion keyRegion = CSSUtil.findPreviousSignificantNode(region);
- String type = CSSUtil.getStructuredDocumentRegionType(keyRegion);
-
- CSSNodeImpl inserted = null;
- if (type == CSSRegionContexts.CSS_IMPORT) {
- inserted = insertImportRule(keyRegion, region);
- }
- else if (type == CSSRegionContexts.CSS_CHARSET) {
- inserted = insertCharsetRule(keyRegion, region);
- }
-
- return inserted;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertSemiColonForStyleDeclarationItem(IStructuredDocumentRegion region) {
- // only target/net node is changed. nothing to do.
-
- CSSNodeImpl targetNode = fCreationContext.getTargetNode();
- if (targetNode instanceof ICSSStyleDeclItem) {
- int offset = targetNode.getStartOffset();
- // widen document region range
- // ((CSSStyleDeclItemImpl)targetNode).setLastStructuredDocumentRegion(region);
- CSSModelUtil.expandStructuredDocumentRegionContainer((CSSStyleDeclItemImpl) targetNode, region);
- // psStructuredDocumentRegion indicates CSSStyleDeclItem
- ICSSNode parentNode = targetNode.getParentNode();
- fCreationContext.setTargetNode(parentNode);
- ICSSNode next = null;
- if (parentNode.hasChildNodes()) {
- for (ICSSNode child = targetNode.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof CSSStructuredDocumentRegionContainer && offset < ((CSSStructuredDocumentRegionContainer) child).getStartOffset()) {
- next = child;
- break;
- }
- }
- }
- fCreationContext.setNextNode(next);
-
- return targetNode;
- }
-
- return null;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertStyleDeclarationItem(IStructuredDocumentRegion docRegion) {
- CSSStyleDeclarationImpl parent = null;
- CSSNodeImpl node = fCreationContext.getTargetNode();
- if (node instanceof CSSRuleDeclContainer) {
- CSSRuleDeclContainer declContainer = (CSSRuleDeclContainer) node;
- parent = (CSSStyleDeclarationImpl) declContainer.getStyle();
- }
- else if (node instanceof CSSStyleDeclarationImpl) {
- parent = (CSSStyleDeclarationImpl) node;
- }
-
- CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(parent.getOwnerDocument());
- itemParser.setStructuredDocumentTemporary(false);
- itemParser.setUpdateContext(fUpdateContext);
- CSSStyleDeclItemImpl declItem = itemParser.setupDeclarationItem(docRegion);
- if (declItem == null) {
- return null;
- }
-
- // setup flat container
- declItem.setRangeStructuredDocumentRegion(docRegion, docRegion);
-
- // insert to tree
- if (!fUpdateContext.isActive()) {
- propagateRangePreInsert(parent, declItem);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(declItem, next);
- }
- else {
- parent.appendChild(declItem);
- }
- }
-
- fCreationContext.setTargetNode(declItem);
- // TargetNext is set to null automatically
-
- return declItem;
- }
-
- /**
- *
- */
- private CSSNodeImpl insertStyleRule(IStructuredDocumentRegion flatNode, IStructuredDocumentRegion braceNode) {
- CSSNodeImpl parent = fCreationContext.getTargetNode();
- if (!fParseFloating && !(parent instanceof ICSSRuleContainer)) {
- return null;
- }
-
- // get selector regions
- ITextRegionList selectorRegions = new TextRegionListImpl(flatNode.getRegions());
- CSSUtil.stripSurroundingSpace(selectorRegions);
-
- CSSStyleRuleImpl rule = fFeeder.getCSSStyleRule();
- if (rule == null) {
- return null;
- }
-
- if (!fUpdateContext.isActive()) {
- String selectorStr = CSSUtil.getRegionText(flatNode, selectorRegions);
- if (selectorStr != null && 0 < selectorStr.length()) {
- rule.setSelectorText(selectorStr);
- }
- }
-
- // setup flat container
- rule.setRangeStructuredDocumentRegion(flatNode, braceNode);
- CSSAttrImpl attr = rule.getAttributeNode(ICSSPageRule.SELECTOR);
- if (attr != null && selectorRegions != null && !selectorRegions.isEmpty()) {
- attr.setRangeRegion(flatNode, selectorRegions.get(0), selectorRegions.get(selectorRegions.size() - 1));
- }
-
- // insert to tree
- if (!fUpdateContext.isActive() && parent != null) {
- propagateRangePreInsert(parent, rule);
- CSSNodeImpl next = fCreationContext.getNextNode();
- if (next != null) {
- parent.insertBefore(rule, next);
- }
- else {
- parent.appendChild(rule);
- }
- }
-
- fCreationContext.setTargetNode(rule);
- // TargetNext is set to null automatically
-
- return rule;
- }
-
- /**
- *
- */
- private void pretendRemoveNode() {
- CSSStructuredDocumentRegionContainer node = (CSSStructuredDocumentRegionContainer) fUpdateContext.getDeletionTarget();
- if (node == null) {
- return;
- }
-
- IStructuredDocumentRegion firstNode = node.getFirstStructuredDocumentRegion();
- if (firstNode != null) {
- fDeletionContext.expandRemovedRangeBegin(firstNode);
- }
- IStructuredDocumentRegion lastNode = node.getLastStructuredDocumentRegion();
- if (lastNode != null) {
- fDeletionContext.expandRemovedRangeEnd(lastNode);
- }
-
- shrinkContainer((CSSStructuredDocumentRegionContainer) fUpdateContext.getDeletionTargetParent(), node);
- }
-
- /**
- * currently public but may be made default access protected in future.
- *
- * @param parent
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param child
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- protected void propagateRangePreInsert(CSSNodeImpl parent, CSSNodeImpl child) {
- if (!(child instanceof CSSStructuredDocumentRegionContainer) || !(parent instanceof CSSStructuredDocumentRegionContainer)) {
- return;
- }
-
- CSSStructuredDocumentRegionContainer parentContainer = (CSSStructuredDocumentRegionContainer) parent;
- CSSStructuredDocumentRegionContainer childContainer = (CSSStructuredDocumentRegionContainer) child;
- IStructuredDocumentRegion firstNode = childContainer.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastNode = childContainer.getLastStructuredDocumentRegion();
- if (firstNode == null || lastNode == null) {
- return;
- }
-
- boolean bModified = parentContainer.includeRangeStructuredDocumentRegion(firstNode, lastNode);
- if (bModified) {
- parentContainer.propagateRangeStructuredDocumentRegion();
- }
- }
-
- /**
- *
- */
- private void removeStructuredDocumentRegion(IStructuredDocumentRegion flatNode) {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- do {
- flatNode = fStructuredDocumentWalker.getPrevNode(flatNode);
- type = (flatNode != null) ? CSSUtil.getStructuredDocumentRegionType(flatNode) : null;
- }
- while (type != null && (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT));
- }
- if (flatNode == null) {
- return;
- }
-
- // if (fDeletionContext.isInRemovedRange(flatNode)) { // already
- // removed
- // return;
- // }
-
- CSSStructuredDocumentRegionContainer node = fDeletionContext.findDeletionTarget((CSSNodeImpl)fDocument, flatNode);
- if (node == null || node == fDocument) {
- return; // not attached with any treeNode
- }
-
- if (node instanceof CSSStyleDeclarationImpl) {
- ICSSNode rule = node.getParentNode();
- if (rule instanceof CSSStyleRuleImpl) {
- node = (CSSStructuredDocumentRegionContainer) rule;
- }
- else {
- return;
- }
- }
-
- // ICSSNode p = node.getParentNode();
- // if (p == null || ! (p instanceof
- // CSSStructuredDocumentRegionContainer)) {
- // return;
- // }
- // CSSStructuredDocumentRegionContainer parent =
- // (CSSStructuredDocumentRegionContainer)p;
-
- if (fDeletionContext.addNodeToBeRemoved(node)) {
- IStructuredDocumentRegion firstNode = node.getFirstStructuredDocumentRegion();
- if (firstNode != null) {
- fDeletionContext.expandRemovedRangeBegin(firstNode);
- }
- IStructuredDocumentRegion lastNode = node.getLastStructuredDocumentRegion();
- if (lastNode != null) {
- fDeletionContext.expandRemovedRangeEnd(lastNode);
- }
- }
-
- // shrinkContainer(node);
- // parent.removeChild(node);
- }
-
- /**
- *
- */
- private void removeStructuredDocumentRegions(IStructuredDocumentRegionList flatNodes) {
- for (Enumeration e = flatNodes.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode == null) {
- continue;
- }
- removeStructuredDocumentRegion(flatNode);
- }
-
- Iterator i = fDeletionContext.getNodesToBeRemoved();
- while (i.hasNext()) {
- CSSNodeImpl node = (CSSNodeImpl) i.next();
- if (!(node instanceof CSSStructuredDocumentRegionContainer)) {
- continue;
- }
- CSSNodeImpl parent = (CSSNodeImpl) node.getParentNode();
- if (!(parent instanceof CSSStructuredDocumentRegionContainer)) {
- continue;
- }
- shrinkContainer((CSSStructuredDocumentRegionContainer) parent, (CSSStructuredDocumentRegionContainer) node);
- parent.removeChild(node);
- }
- }
-
- /**
- *
- */
- void replaceStructuredDocumentRegions(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- if (fDocument == null || fCreationContext == null) {
- return;
- }
-
- if (oldStructuredDocumentRegions != null && 0 < oldStructuredDocumentRegions.getLength()) {
- setupDeletionContext(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- short updateMode = fUpdateContext.getUpdateMode();
- if (updateMode == CSSModelUpdateContext.UPDATE_IDLE) {
- removeStructuredDocumentRegions(oldStructuredDocumentRegions);
- }
- else {
- pretendRemoveNode();
- }
- newStructuredDocumentRegions = getStructuredDocumentRegionList(fDeletionContext.getRemovedRangeBegin(), fDeletionContext.getRemovedRangeEnd());
- cleanupDeletionContext();
- }
-
- if (newStructuredDocumentRegions != null && 0 < newStructuredDocumentRegions.getLength()) {
- setupCreationContext(newStructuredDocumentRegions.item(0));
- insertStructuredDocumentRegions(newStructuredDocumentRegions);
- }
-
- // make document hold whole structuredDocument
- /*
- * boolean bUpdate = false; IStructuredDocumentRegion flatNode;
- * flatNode = fDocument.getFirstStructuredDocumentRegion(); bUpdate =
- * bUpdate || (flatNode == null ||
- * fStructuredDocumentWalker.isOldNode(flatNode) ||
- * flatNode.getPrevious() != null); flatNode =
- * fDocument.getLastStructuredDocumentRegion(); bUpdate = bUpdate ||
- * (flatNode == null || fStructuredDocumentWalker.isOldNode(flatNode) ||
- * flatNode.getNext() != null);
- */
- IStructuredDocument structuredDocument = fStructuredDocumentWalker.getStructuredDocument();
- ((CSSStructuredDocumentRegionContainer)fDocument).setRangeStructuredDocumentRegion(structuredDocument.getFirstStructuredDocumentRegion(), structuredDocument.getLastStructuredDocumentRegion());
- /* } */
-
- // remove in official release
- // CSSModelUtil.diagnoseTree(fDocument,
- // fStructuredDocumentWalker.getStructuredDocument());
- }
-
- /**
- *
- */
- void replaceRegions(IStructuredDocumentRegion flatNode, ITextRegionList newRegions, ITextRegionList oldRegions) {
- if (flatNode == null) {
- return;
- }
- if (newRegions == null || oldRegions == null) {
- return;
- }
- if (fDocument == null) {
- return;
- }
-
- changeStructuredDocumentRegion(flatNode);
- }
-
- /**
- */
- private void resetCreationTarget(IStructuredDocumentRegion newStructuredDocumentRegion) {
- if (newStructuredDocumentRegion == null || newStructuredDocumentRegion.getStartOffset() <= 0) {
- // top of document
- fCreationContext.setTargetNode(fDocument);
- fCreationContext.setNextNode(fDocument.getFirstChild());
- return;
- }
-
- int cursorPos = newStructuredDocumentRegion.getStartOffset();
- CSSNodeImpl cursorNode = getNodeAt(cursorPos);
- if (cursorNode == null) { // end of document
- cursorNode = (CSSNodeImpl)fDocument;
- }
-
- // find edge of tree node
- CSSNodeImpl node = null;
- // boolean bOverSemiColon = false;
- boolean bOverOpenBrace = false;
- IStructuredDocumentRegion flatNode;
- for (flatNode = newStructuredDocumentRegion; flatNode != null; flatNode = flatNode.getPrevious()) {
- node = getNodeAt(flatNode.getStartOffset());
- if (node == null) {
- node = (CSSNodeImpl)fDocument;
- }
- if (node != cursorNode || node.getStartOffset() == flatNode.getStartOffset()) {
- break;
- }
- if (flatNode != newStructuredDocumentRegion) {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- // if (type == CSSRegionContexts.CSS_DELIMITER ||
- // type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- // bOverSemiColon = true;
- // } else
- if (type == CSSRegionContexts.CSS_LBRACE) {
- bOverOpenBrace = true;
- }
- }
- }
-
- CSSNodeImpl targetNode = null;
-
- // if (flatNode == null) {
- // v<--|
- // AAAAAA
- // BBBBBBBBBB cursorNode:A , node:B -> target is A
- // targetNode = (node == null) ? fDocument : node;
- // } else
- if (cursorNode == node) {
- // v<--|
- // AAAAAA
- // BBBBBBBBBB cursorNode:A , node:B -> target is A
- if (bOverOpenBrace && cursorNode instanceof CSSRuleDeclContainer) {
- targetNode = (CSSNodeImpl) ((CSSRuleDeclContainer) cursorNode).getStyle();
- }
- else {
- targetNode = cursorNode;
- }
- }
- else {
- // v<--|
- // AAA
- // BBBBBBBBBB cursorNode:B , node:A -> depend on A's node type
- short nodeType = node.getNodeType();
- if (nodeType == ICSSNode.STYLEDECLITEM_NODE || nodeType == ICSSNode.CHARSETRULE_NODE || nodeType == ICSSNode.IMPORTRULE_NODE) {
- // targetNode = (CSSNodeImpl)((bOverSemiColon) ?
- // node.getParentNode() : node); // NP
- String regionType = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (regionType == CSSRegionContexts.CSS_DELIMITER || regionType == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- targetNode = (CSSNodeImpl) node.getParentNode();
- }
- else {
- targetNode = node;
- }
- }
- else if (CSSUtil.getStructuredDocumentRegionType(flatNode) == CSSRegionContexts.CSS_RBRACE) {
- targetNode = (CSSNodeImpl) node.getParentNode();
- }
- else {
- targetNode = node;
- }
- }
-
- fCreationContext.setTargetNode(targetNode);
- ICSSNode next = null;
- if (targetNode.hasChildNodes()) {
- for (ICSSNode child = targetNode.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof CSSStructuredDocumentRegionContainer && cursorPos < ((CSSStructuredDocumentRegionContainer) child).getStartOffset()) {
- next = child;
- break;
- }
- }
- }
- fCreationContext.setNextNode(next);
-
- }
-
- /**
- */
- private void resetReparseRange() {
- fCreationContext.clear();
- }
-
- void setStructuredDocumentEvent(StructuredDocumentEvent event) {
- if (fStructuredDocumentWalker == null) {
- fStructuredDocumentWalker = new StructuredDocumentWalker();
- }
- fStructuredDocumentWalker.initialize(event);
- }
-
- /**
- * regions: surrounding spaces should be removed. Q. Why did you set
- * mediaTable ? A. MediaList may have two or more medium that have same
- * value, then searcing in MediaList is not perfect. Q.
- * fUpdateContext.isActive() is not care. Are you OK? A. OK.
- */
- private void setMediaList(MediaListImpl mediaList, IStructuredDocumentRegion region, ITextRegionList textRegions) {
- if (mediaList == null || textRegions == null) {
- return;
- }
- Collection mediaTable = new HashSet();
- CSSNodeListImpl attrs = mediaList.getMedia();
- for (int i = 0; i != attrs.getLength(); i++) {
- mediaTable.add(attrs.item(i));
- }
-
- ITextRegion start = null;
- ITextRegion end = null;
-
- Iterator i = textRegions.iterator();
- ITextRegion textRegion = (ITextRegion) ((i.hasNext()) ? i.next() : null);
- while (textRegion != null) {
- if (textRegion.getType() == CSSRegionContexts.CSS_MEDIUM) {
- String mediumStr = region.getText(textRegion);
- if (0 < mediumStr.length()) {
- CSSAttrImpl attr = null;
- // is the medium already set ?
- Iterator iTable = mediaTable.iterator();
- while (iTable.hasNext()) {
- CSSAttrImpl cai = (CSSAttrImpl) iTable.next();
- if (mediumStr.equalsIgnoreCase(cai.getValue())) {
- attr = cai;
- mediaTable.remove(cai);
- break;
- }
- }
- if (attr == null) {
- // is not set. create new attribute
- String key = "mediumP" + mediaList.mediumCounter++; //$NON-NLS-1$
- mediaList.setAttribute(key, mediumStr);
- attr = mediaList.getAttributeNode(key);
- }
- attr.setRangeRegion(region, textRegion, textRegion);
- if (start == null) {
- start = textRegion;
- }
- end = textRegion;
- }
- }
- textRegion = (ITextRegion) ((i.hasNext()) ? i.next() : null);
- }
-
- if (start != null && end != null) {
- mediaList.setRangeRegion(region, start, end);
- }
- }
-
- /**
- *
- */
- private void setupCreationContext(IStructuredDocumentRegion region) {
- resetReparseRange();
- resetCreationTarget(region);
- }
-
- /**
- *
- */
- private void setupDeletionContext(IStructuredDocumentRegionList newStructuredDocumentRegions, IStructuredDocumentRegionList oldStructuredDocumentRegions) {
- fDeletionContext.setupContext(newStructuredDocumentRegions, oldStructuredDocumentRegions);
- }
-
- /**
- *
- */
- void setupUpdateContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
- fUpdateContext.setupContext(updateMode, parentNode, targetNode);
- }
-
- /**
- *
- */
- void shrinkContainer(CSSStructuredDocumentRegionContainer parent, CSSStructuredDocumentRegionContainer child) {
- if (child == null) {
- return;
- }
-
- boolean bModified = false;
- bModified = bModified || cleanupLastNode(child.getLastStructuredDocumentRegion(), parent);
- bModified = bModified || cleanupFirstNode(child.getFirstStructuredDocumentRegion(), parent);
-
- if (bModified) {
- if (parent != null) {
- for (ICSSNode node = parent.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (child != node && node instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) node).propagateRangeStructuredDocumentRegion();
- }
- }
- }
- }
-
- child.setRangeStructuredDocumentRegion(null, null);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java
deleted file mode 100644
index e7f4e9352d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdateContext.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import java.util.LinkedList;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.util.AbstractCssTraverser;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-class CSSModelUpdateContext {
-
-
- class CSSNodeUpdateTraverser extends AbstractCssTraverser {
- public CSSNodeUpdateTraverser() {
- super();
- setTraverseImported(false);
- setTraverseImportFirst(false);
- }
-
- public LinkedList getNodeList() {
- return fTravNodeList;
- }
-
- protected void begin(ICSSNode node) {
- fTravNodeList = new LinkedList();
- }
-
- protected short preNode(ICSSNode node) {
- if (node instanceof CSSStyleDeclarationImpl || node instanceof CSSAttrImpl || node instanceof MediaListImpl) {
- // skip
- }
- else {
- fTravNodeList.add(node);
- }
- if (node instanceof CSSPrimitiveContainer) {
- return TRAV_PRUNE;
- }
- else {
- return TRAV_CONT;
- }
- }
-
- LinkedList fTravNodeList = null;
- }
-
- ICSSNode fLastNode = null;
- ICSSNode fDeletionTargetParent = null;
- ICSSNode fDeletionTarget = null;
- LinkedList fNodeList = null;
- private short fUpdateMode = UPDATE_IDLE;
- static final short UPDATE_IDLE = 0;
- static final short UPDATE_INSERT_FNCONTAINER = 1;
- static final short UPDATE_INSERT_RCONTAINER = 2;
- static final short UPDATE_REMOVE_FNCONTAINER = 3;
- static final short UPDATE_REMOVE_RCONTAINER = 4;
- static final short UPDATE_CHANGE_RCONTAINER = 5;
-
- /**
- * CSSNodeUpdateQueue constructor comment.
- */
- CSSModelUpdateContext() {
- super();
- }
-
- /**
- *
- */
- void cleanupContext() {
- fNodeList = null;
- fDeletionTarget = null;
- fDeletionTargetParent = null;
- fUpdateMode = UPDATE_IDLE;
- }
-
- /**
- *
- */
- CounterImpl getCounter() {
- ICSSNode node = getNode();
- if (node instanceof CounterImpl) {
- return (CounterImpl) node;
- }
- else {
- CSSUtil.debugOut("CounterImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSCharsetRuleImpl getCSSCharsetRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSCharsetRuleImpl) {
- return (CSSCharsetRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSCharsetRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSFontFaceRuleImpl getCSSFontFaceRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSFontFaceRuleImpl) {
- return (CSSFontFaceRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSFontFaceRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSImportRuleImpl getCSSImportRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSImportRuleImpl) {
- return (CSSImportRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSImportRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSMediaRuleImpl getCSSMediaRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSMediaRuleImpl) {
- return (CSSMediaRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSMediaRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSPageRuleImpl getCSSPageRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSPageRuleImpl) {
- return (CSSPageRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSPageRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSPrimitiveValueImpl getCSSPrimitiveValue(short type) {
- ICSSNode node = getNode();
- if (node instanceof CSSPrimitiveValueImpl) {
- short nodeType = ((CSSPrimitiveValueImpl) node).getPrimitiveType();
- if (nodeType == type || ((nodeType == CSSPrimitiveValue.CSS_NUMBER || nodeType == ICSSPrimitiveValue.CSS_INTEGER) && (type == CSSPrimitiveValue.CSS_NUMBER || type == ICSSPrimitiveValue.CSS_INTEGER))) {
- return (CSSPrimitiveValueImpl) node;
- }
- }
-
- if (node instanceof CSSPrimitiveValueImpl) {
- CSSPrimitiveValueImpl value = (CSSPrimitiveValueImpl) node;
- CSSUtil.debugOut("CSSPrimitiveValueImpl [" + type + //$NON-NLS-1$
- "] is expected, but type is [" + //$NON-NLS-1$
- value.getPrimitiveType() + "]: \"" + value.generateSource() + "\"");//$NON-NLS-2$//$NON-NLS-1$
- }
- else {
- CSSUtil.debugOut("CSSPrimitiveValueImpl(" + type + //$NON-NLS-1$
- ") is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- }
-
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- /**
- *
- */
- CSSPrimitiveValueImpl getCSSPrimitiveValueAny() {
- ICSSNode node = getNode();
- if (node instanceof CSSPrimitiveValueImpl) {
- return (CSSPrimitiveValueImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSPrimitiveValueImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSStyleDeclItemImpl getCSSStyleDeclItem(String propertyName) {
- ICSSNode node = getNode();
- if (node instanceof CSSStyleDeclItemImpl && ((CSSStyleDeclItemImpl) node).getPropertyName().equalsIgnoreCase(propertyName)) {
- return (CSSStyleDeclItemImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSStyleDeclItemImpl(" + propertyName + //$NON-NLS-1$
- ") is expected, but " + CSSUtil.getClassString(node));//$NON-NLS-1$
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- CSSStyleRuleImpl getCSSStyleRule() {
- ICSSNode node = getNode();
- if (node instanceof CSSStyleRuleImpl) {
- return (CSSStyleRuleImpl) node;
- }
- else {
- CSSUtil.debugOut("CSSStyleRuleImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- ICSSNode getDeletionTarget() {
- return fDeletionTarget;
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- ICSSNode getDeletionTargetParent() {
- return fDeletionTargetParent;
- }
-
- /**
- *
- */
- private ICSSNode getNode() {
- ICSSNode node = null;
- if (fNodeList != null && 0 < fNodeList.size()) {
- node = (ICSSNode) fNodeList.removeFirst();
- }
- fLastNode = node;
- return node;
- }
-
- /**
- *
- */
- int getNodeCount() {
- if (fNodeList != null) {
- return fNodeList.size();
- }
- else {
- return -1;
- }
- }
-
- /**
- *
- */
- // ICSSNode getParentNode() {
- // return fParentNode;
- // }
- /**
- *
- */
- RectImpl getRect() {
- ICSSNode node = getNode();
- if (node instanceof RectImpl) {
- return (RectImpl) node;
- }
- else {
- CSSUtil.debugOut("RectImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- RGBColorImpl getRGBColor() {
- ICSSNode node = getNode();
- if (node instanceof RGBColorImpl) {
- return (RGBColorImpl) node;
- }
- else {
- CSSUtil.debugOut("RGBColorImpl is expected, but " + //$NON-NLS-1$
- CSSUtil.getClassString(node));
- ungetNode();
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * @return short
- */
- short getUpdateMode() {
- return fUpdateMode;
- }
-
- /**
- *
- */
- boolean isActive() {
- return (fNodeList != null);
- }
-
- /**
- *
- */
- void setupContext(short updateMode, ICSSNode parentNode, ICSSNode targetNode) {
- fUpdateMode = updateMode;
-
- ICSSNode traverseRoot;
- if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_CHANGE_RCONTAINER) {
- traverseRoot = parentNode;
- while (traverseRoot instanceof CSSRegionContainer) {
- traverseRoot = traverseRoot.getParentNode();
- }
- }
- else {
- traverseRoot = targetNode;
- }
-
- if (updateMode == UPDATE_REMOVE_RCONTAINER || updateMode == UPDATE_INSERT_RCONTAINER || // region
- // insert
- // =>
- // replace
- // flat
- // node
- updateMode == UPDATE_CHANGE_RCONTAINER || updateMode == UPDATE_REMOVE_FNCONTAINER) {
- fDeletionTarget = traverseRoot;
- if (fDeletionTarget == targetNode) {
- fDeletionTargetParent = parentNode;
- }
- else {
- fDeletionTargetParent = fDeletionTarget.getParentNode();
- }
- }
- else {
- fDeletionTarget = null;
- fDeletionTargetParent = null;
- }
-
- if (updateMode == UPDATE_INSERT_RCONTAINER || updateMode == UPDATE_INSERT_FNCONTAINER || updateMode == UPDATE_REMOVE_RCONTAINER || // region
- // remove
- // =>
- // re-insert
- // flat
- // node
- updateMode == UPDATE_CHANGE_RCONTAINER) {
- CSSNodeUpdateTraverser traverser = new CSSNodeUpdateTraverser();
- traverser.apply(traverseRoot);
- fNodeList = traverser.getNodeList();
- }
- else {
- fNodeList = null;
- }
- }
-
- /**
- *
- */
- private void ungetNode() {
- if (fNodeList != null && fLastNode != null) {
- fNodeList.addFirst(fLastNode);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
deleted file mode 100644
index d92bca5907..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUpdater.java
+++ /dev/null
@@ -1,561 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.formatter.AttrChangeContext;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.events.NoChangeEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument;
-import org.w3c.dom.DOMException;
-
-
-/**
- *
- */
-class CSSModelUpdater {
-
- private CSSModelImpl fModel = null;
- private CSSModelParser fParser = null;
-
- /**
- * CSSModelUpdater constructor comment.
- */
- CSSModelUpdater() {
- super();
- }
-
- /**
- *
- */
- CSSModelUpdater(CSSModelImpl model) {
- super();
- fModel = model;
- }
-
- /**
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private void attrInserted(CSSNodeImpl parentNode, CSSAttrImpl attr) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(parentNode);
-
- if (formatter == null) {
- CSSUtil.debugOut("Cannot get format adapter : " + parentNode.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- short updateMode = CSSModelUpdateContext.UPDATE_INSERT_RCONTAINER;
- fParser.setupUpdateContext(updateMode, parentNode, attr);
-
- // get formatted info
- AttrChangeContext region = new AttrChangeContext();
- String text = new String(formatter.formatAttrChanged(parentNode, attr, true, region));
-
- // set text
- StructuredDocumentEvent result = insertText(region.start, region.end - region.start, text);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private void attrRemoved(CSSNodeImpl parentNode, CSSAttrImpl attr) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(parentNode);
-
- if (formatter == null) {
- CSSUtil.debugOut("Cannot get format adapter : " + parentNode.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- short updateMode = CSSModelUpdateContext.UPDATE_REMOVE_RCONTAINER;
- fParser.setupUpdateContext(updateMode, parentNode, attr);
-
- // get formatted info
- AttrChangeContext region = new AttrChangeContext();
- String text = new String(formatter.formatAttrChanged(parentNode, attr, false, region));
-
- // set text
- StructuredDocumentEvent result = insertText(region.start, region.end - region.start, text);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- void attrReplaced(CSSNodeImpl parentNode, CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
- if (parentNode == null) {
- return;
- }
-
- if (oldAttr != null) {
- attrRemoved(parentNode, (CSSAttrImpl) oldAttr);
- }
-
- if (newAttr != null) {
- attrInserted(parentNode, (CSSAttrImpl) newAttr);
- }
- }
-
- /**
- *
- */
- private void childInserted(CSSNodeImpl parentNode, CSSNodeImpl node) {
- short updateMode = CSSModelUpdateContext.UPDATE_IDLE;
-
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_INSERT_FNCONTAINER;
- }
- else if (node instanceof CSSRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_INSERT_RCONTAINER;
- }
- else {
- CSSUtil.debugOut("What's this node? : " + node.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- fParser.setupUpdateContext(updateMode, parentNode, node);
-
- StructuredDocumentEvent result = defaultInserted(parentNode, node);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- private void childRemoved(CSSNodeImpl parentNode, CSSNodeImpl node) {
- short updateMode = CSSModelUpdateContext.UPDATE_IDLE;
-
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_REMOVE_FNCONTAINER;
- }
- else if (node instanceof CSSRegionContainer) {
- updateMode = CSSModelUpdateContext.UPDATE_REMOVE_RCONTAINER;
- }
- else {
- CSSUtil.debugOut("What's this node? : " + node.getClass().toString());//$NON-NLS-1$
- return;
- }
-
- fParser.setupUpdateContext(updateMode, parentNode, node);
-
- CSSNodeImpl prev = getOldPrevious(parentNode, node);
- CSSNodeImpl next = getOldNext(parentNode, node);
- int insertPos = -1, endPos = -1;
- String source = "";//$NON-NLS-1$
- if (prev != null) {
- insertPos = prev.getEndOffset();
- }
- else {
- insertPos = node.getStartOffset();
- insertPos -= nearestSpaceLengthBefore(parentNode, insertPos);
- }
- if (next != null) {
- endPos = next.getStartOffset();
- }
- else {
- endPos = node.getEndOffset();
- endPos += nearestSpaceLengthAfter(parentNode, endPos);
- }
- source = getSpaceBefore(parentNode, next, node);
- StructuredDocumentEvent result;
- if (source.length() > 0) {
- result = insertText(insertPos, endPos - insertPos, source);
- }
- else {
- result = removeText(insertPos, endPos - insertPos);
- }
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- /*
- * int removeStart = -1; int removeEnd = -1; if (node instanceof
- * CSSStructuredDocumentRegionContainer) {
- * CSSStructuredDocumentRegionContainer container =
- * (CSSStructuredDocumentRegionContainer)node;
- * IStructuredDocumentRegion firstNode =
- * container.getFirstStructuredDocumentRegion();
- * IStructuredDocumentRegion lastNode =
- * container.getLastStructuredDocumentRegion(); if (firstNode != null &&
- * lastNode != null) { removeStart = firstNode.getStart(); removeEnd =
- * lastNode.getEnd(); } } else if (node instanceof CSSRegionContainer) {
- * CSSRegionContainer container = (CSSRegionContainer)node;
- * ITextRegion firstRegion = container.getFirstRegion(); ITextRegion
- * lastRegion = container.getLastRegion(); if (firstRegion != null &&
- * lastRegion != null) { removeStart = firstRegion.getStartOffset();
- * removeEnd = lastRegion.getEndOffset(); } } if (0 <= removeStart &&
- * 0 <= removeEnd) { removeText(removeStart, removeEnd - removeStart +
- * 1); }
- */
- }
-
- /**
- *
- */
- void childReplaced(CSSNodeImpl parentNode, CSSNodeImpl newChild, CSSNodeImpl oldChild) {
- if (parentNode == null) {
- return;
- }
-
- if (oldChild != null) {
- childRemoved(parentNode, oldChild);
- }
-
- if (newChild != null) {
- childInserted(parentNode, newChild);
- }
- }
-
- /**
- *
- */
- private StructuredDocumentEvent defaultInserted(CSSNodeImpl parentNode, CSSNodeImpl node) {
- int insertPos = -1;
- ICSSNode sibling;
- String preSpace = "", postSpace = "";//$NON-NLS-2$//$NON-NLS-1$
- int length = 0;
-
- if (insertPos < 0) {
- if ((sibling = node.getPreviousSibling()) != null) {
- // after previous child
- insertPos = getTextEnd(sibling);
- }
- }
-
- if (insertPos < 0) {
- if ((sibling = node.getNextSibling()) != null) {
- // before next child
- insertPos = getTextStart(sibling);
- }
- }
-
- if (insertPos < 0) {
- // position of parent
- insertPos = getChildInsertPos(parentNode);
- }
-
- if (insertPos < 0) {
- // firsttime
- insertPos = 0;
- }
-
- // format previous spaces
- length = nearestSpaceLengthBefore(parentNode, insertPos);
- insertPos -= length;
- preSpace = getSpaceBefore(parentNode, node, null);
- // format post spaces
- length += nearestSpaceLengthAfter(parentNode, insertPos + length);
- postSpace = getSpaceBefore(parentNode, node.getNextSibling(), null);
-
- // set text
- String text = preSpace + node.generateSource().trim() + postSpace;
- return insertText(insertPos, length, text);
- }
-
- /**
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private int getChildInsertPos(CSSNodeImpl node) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
- if (formatter != null)
- return formatter.getChildInsertPos(node);
- else
- return node.getEndOffset();
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private CSSNodeImpl getOldNext(CSSNodeImpl parentNode, CSSNodeImpl node) {
- CSSNodeImpl child = (CSSNodeImpl) parentNode.getLastChild();
- CSSNodeImpl ret = null;
- while (child != null) {
- if (node.getEndOffset() < child.getEndOffset())
- ret = child;
- else
- break;
- child = (CSSNodeImpl) child.getPreviousSibling();
- }
- return ret;
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private CSSNodeImpl getOldPrevious(CSSNodeImpl parentNode, CSSNodeImpl node) {
- CSSNodeImpl child = (CSSNodeImpl) parentNode.getFirstChild();
- CSSNodeImpl ret = null;
- while (child != null) {
- if (child.getStartOffset() < node.getStartOffset())
- ret = child;
- else
- break;
- child = (CSSNodeImpl) child.getNextSibling();
- }
- return ret;
- }
-
- /**
- * @return java.lang.String
- * @param parentNode
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- * @param node
- * org.eclipse.wst.css.core.model.CSSNodeImpl
- */
- private String getSpaceBefore(ICSSNode parentNode, ICSSNode node, ICSSNode toRemove) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) parentNode);
-
- if (formatter != null) {
- org.eclipse.jface.text.IRegion exceptFor = null;
- if (toRemove != null) {
- CSSNodeImpl remove = (CSSNodeImpl) toRemove;
- exceptFor = new org.eclipse.jface.text.Region(remove.getStartOffset(), remove.getEndOffset() - remove.getStartOffset());
- }
- return formatter.formatBefore(parentNode, node, exceptFor).toString();
- }
- else
- return "";//$NON-NLS-1$
- }
-
- /**
- *
- */
- private int getTextEnd(ICSSNode node) {
- int end = -1;
- if (node != null) {
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- end = ((CSSStructuredDocumentRegionContainer) node).getEndOffset();
- }
- else if (node instanceof CSSRegionContainer) {
- end = ((CSSRegionContainer) node).getEndOffset();
- }
- }
- return end;
- }
-
- /**
- *
- */
- private int getTextStart(ICSSNode node) {
- int start = -1;
- if (node != null) {
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- start = ((CSSStructuredDocumentRegionContainer) node).getStartOffset();
- }
- else if (node instanceof CSSRegionContainer) {
- start = ((CSSRegionContainer) node).getStartOffset();
- }
- }
- return start;
- }
-
- /**
- *
- */
- private StructuredDocumentEvent insertText(int start, int oldLength, String text) {
- StructuredDocumentEvent result = null;
- BasicStructuredDocument structuredDocument = (BasicStructuredDocument) fModel.getStructuredDocument();
- if (structuredDocument != null) {
- if (text != null && 0 < oldLength && start + oldLength <= structuredDocument.getLength()) {
- // minimize text change
- String delText = structuredDocument.get(start, oldLength);
- int newLength = text.length();
- int shorterLen = Math.min(oldLength, newLength);
- int stMatchLen;
- for (stMatchLen = 0; stMatchLen < shorterLen && text.charAt(stMatchLen) == delText.charAt(stMatchLen); stMatchLen++) {
- //
- }
- if (0 < stMatchLen && stMatchLen < shorterLen && text.charAt(stMatchLen - 1) == 0x000d && (text.charAt(stMatchLen) == 0x000a || delText.charAt(stMatchLen) == 0x000a)) {
- // must not divide 0d->0a sequence
- stMatchLen--;
- }
- if (stMatchLen == shorterLen) {
- if (oldLength < newLength) { // just insert
- oldLength = 0;
- start += stMatchLen;
- text = text.substring(stMatchLen);
- }
- else if (newLength < oldLength) { // just remove
- oldLength -= stMatchLen;
- start += stMatchLen;
- text = null;
- }
- else { // nothing to do
- oldLength = 0;
- text = null;
- }
- }
- else {
- int edMatchLen;
- for (edMatchLen = 0; stMatchLen + edMatchLen < shorterLen && text.charAt(newLength - edMatchLen - 1) == delText.charAt(oldLength - edMatchLen - 1); edMatchLen++) {
- //
- }
- if (0 < edMatchLen && text.charAt(newLength - edMatchLen) == 0x000a && ((edMatchLen < newLength && text.charAt(newLength - edMatchLen - 1) == 0x000d) || (edMatchLen < oldLength && delText.charAt(oldLength - edMatchLen - 1) == 0x000d))) {
- // must not divide 0d->0a sequence
- edMatchLen--;
- }
- oldLength -= stMatchLen + edMatchLen;
- start += stMatchLen;
- if (stMatchLen + edMatchLen < newLength) {
- text = text.substring(stMatchLen, newLength - edMatchLen);
- }
- else {
- text = null;
- }
- }
- }
- if (0 < oldLength || text != null) {
- // String delText = structuredDocument.get(start, oldLength);
- result = structuredDocument.replaceText(fModel, start, oldLength, text);
- }
- }
- return result;
- }
-
- /**
- * @return int
- * @param insertPos
- * int
- */
- private int nearestSpaceLengthAfter(CSSNodeImpl node, int insertPos) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
- if (formatter != null) {
- return formatter.getLengthToReformatAfter(node, insertPos);
- }
- else
- return 0;
- }
-
- /**
- * @return int
- * @param insertPos
- * int
- */
- private int nearestSpaceLengthBefore(CSSNodeImpl node, int insertPos) {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(node);
- if (formatter != null) {
- return formatter.getLengthToReformatBefore(node, insertPos);
- }
- else
- return 0;
- }
-
- /**
- *
- */
- private StructuredDocumentEvent removeText(int start, int length) {
- StructuredDocumentEvent result = null;
- IStructuredDocument structuredDocument = fModel.getStructuredDocument();
- if (structuredDocument != null) {
- result = structuredDocument.replaceText(fModel, start, length, new String(""));//$NON-NLS-1$
- }
- return result;
- }
-
- /**
- *
- */
- void setParser(CSSModelParser parser) {
- fParser = parser;
- }
-
- /**
- *
- */
- void valueChanged(CSSNodeImpl node, String oldValue) {
- if (!(node instanceof CSSRegionContainer)) {
- CSSUtil.debugOut("Too Bad.." + //$NON-NLS-1$
- ((node == null) ? "null" : node.getClass().toString()));//$NON-NLS-1$
- return;
- }
-
- int start = node.getStartOffset();
-
- if (node.getNodeType() == ICSSNode.ATTR_NODE) {
- ICSSAttr attr = (ICSSAttr) node;
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) attr.getOwnerCSSNode());
- if (formatter != null)
- start = formatter.getAttrInsertPos(attr.getOwnerCSSNode(), attr.getName());
- }
-
- int oldLength = (oldValue == null) ? 0 : oldValue.length();
- // flash old IStructuredDocumentRegion/ITextRegion
- if (node instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) node).setFirstStructuredDocumentRegion(null);
- ((CSSStructuredDocumentRegionContainer) node).setLastStructuredDocumentRegion(null);
- }
- else if (node instanceof CSSRegionContainer) {
- ((CSSRegionContainer) node).setRangeRegion(null, null, null);
- }
- // generate new source
- String newValue = node.generateSource();
-
- ICSSNode parent;
- if (node.getNodeType() == ICSSNode.ATTR_NODE) {
- parent = ((ICSSAttr) node).getOwnerCSSNode();
- }
- else {
- parent = node.getParentNode();
- }
-
- fParser.setupUpdateContext(CSSModelUpdateContext.UPDATE_CHANGE_RCONTAINER, parent, node);
-
- StructuredDocumentEvent result = insertText(start, oldLength, newValue);
-
- int nRemains = fParser.cleanupUpdateContext();
-
- if (0 < nRemains && !(result instanceof NoChangeEvent)) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
deleted file mode 100644
index f9b137a19f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSModelUtil.java
+++ /dev/null
@@ -1,293 +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.css.core.internal.document;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.css.core.internal.CSSCoreMessages;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSRuleContainer;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-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;
-
-/**
- *
- */
-class CSSModelUtil {
-
- /**
- *
- */
- static boolean canContainBrace(ICSSNode node) {
- return (node != null && (node instanceof ICSSRuleContainer || node instanceof CSSRuleDeclContainer)) ? true : false;
- }
-
- /**
- * @param parent
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- static void cleanupContainer(ICSSNode parent) {
- if (parent == null) {
- return;
- }
- for (ICSSNode child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- cleanupContainer(child);
- }
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- ((CSSStructuredDocumentRegionContainer) parent).setRangeStructuredDocumentRegion(null, null);
- }
- else if (parent instanceof CSSRegionContainer) {
- ((CSSRegionContainer) parent).setRangeRegion(null, null, null);
- }
- }
-
- static boolean diagnoseNode(ICSSNode parent, IStructuredDocument structuredDocument) {
- // check this
- Vector errors = new Vector();
- if (parent instanceof CSSStructuredDocumentRegionContainer) {
- CSSStructuredDocumentRegionContainer node = (CSSStructuredDocumentRegionContainer) parent;
- String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
- IStructuredDocumentRegion flatNode = node.getFirstStructuredDocumentRegion();
- if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
- errors.add(NLS.bind(CSSCoreMessages._1concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is null."
- }
- else if (flatNode != null) {
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
- if (flatNode != modelNode) {
- errors.add(NLS.bind(CSSCoreMessages._2concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first flat node is not in model."
- }
- }
- flatNode = node.getLastStructuredDocumentRegion();
- if (flatNode == null && (!(node instanceof CSSStyleDeclarationImpl || node instanceof CSSStyleSheetImpl) || node.getFirstChild() != null)) {
- errors.add(NLS.bind(CSSCoreMessages._3concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is null."
- }
- else if (flatNode != null) {
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(flatNode.getStart());
- if (flatNode != modelNode) {
- errors.add(NLS.bind(CSSCoreMessages._4concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last flat node is not in model."
- }
- }
- }
- else if (parent instanceof CSSRegionContainer) {
- CSSRegionContainer node = (CSSRegionContainer) parent;
- String nodeText = CSSUtil.getClassString(node) + ": ";//$NON-NLS-1$
- ITextRegion region = node.getFirstRegion();
- IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
- if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
- errors.add(NLS.bind(CSSCoreMessages._25concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(NLS.bind(CSSCoreMessages._26concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
- }
- }
- region = node.getLastRegion();
- if (region == null && (!(node instanceof MediaListImpl) || node.getFirstChild() != null)) {
- errors.add(NLS.bind(CSSCoreMessages._27concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(NLS.bind(CSSCoreMessages._28concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
- }
- }
- }
-
- ICSSNodeList attrs = parent.getAttributes();
- int nAttrs = attrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- ICSSAttr attr = (ICSSAttr) attrs.item(i);
- CSSRegionContainer node = (CSSRegionContainer) attr;
- String nodeText = CSSUtil.getClassString(node) + "(" + attr.getName() + "): ";//$NON-NLS-2$//$NON-NLS-1$
- ITextRegion region = node.getFirstRegion();
- IStructuredDocumentRegion parentRegion = node.getDocumentRegion();
- if (region == null && 0 < attr.getValue().length()) {
- errors.add(NLS.bind(CSSCoreMessages._5concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(NLS.bind(CSSCoreMessages._6concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}first region is not in model."
- }
- }
- region = node.getLastRegion();
- if (region == null && 0 < attr.getValue().length()) {
- errors.add(NLS.bind(CSSCoreMessages._7concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is null."
- }
- else if (region != null) {
- int offset = parentRegion.getStartOffset(region);
- IStructuredDocumentRegion modelNode = structuredDocument.getRegionAtCharacterOffset(offset);
- ITextRegion modelRegion = modelNode.getRegionAtCharacterOffset(offset);
- if (region != modelRegion) {
- errors.add(NLS.bind(CSSCoreMessages._8concat_ERROR_, (new Object[]{nodeText}))); //$NON-NLS-1$ = "{0}last region is not in model."
- }
- }
- }
-
- if (!errors.isEmpty()) {
- Iterator i = errors.iterator();
- while (i.hasNext()) {
- CSSUtil.debugOut((String) i.next());
- }
- return false;
- }
- else {
- return true;
- }
- }
-
- /**
- * @return boolean
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- static boolean diagnoseTree(ICSSNode parent, IStructuredDocument structuredDocument) {
- if (parent == null) {
- return false;
- }
- // check children
- for (ICSSNode child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- diagnoseTree(child, structuredDocument);
- }
-
- diagnoseNode(parent, structuredDocument);
-
- return true;
- }
-
- /**
- * If needed, modify last flat node
- */
- static void expandStructuredDocumentRegionContainer(CSSStructuredDocumentRegionContainer target, IStructuredDocumentRegion flatNode) {
- if (target == null || flatNode == null) {
- return;
- }
-
- IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
- if (lastNode == flatNode) {
- return;
- }
- if (lastNode == null || lastNode.getStart() < flatNode.getStart()) {
- target.setLastStructuredDocumentRegion(flatNode);
- }
- }
-
- /*
- *
- */
- static ICSSNode findBraceContainer(ICSSNode node) {
- for (ICSSNode i = node; i != null; i = i.getParentNode()) {
- if (CSSModelUtil.canContainBrace(i)) {
- return i;
- }
- }
- return null;
- }
-
- /**
- *
- */
- static int getDepth(ICSSNode node) {
- int depth = -1;
- while (node != null) {
- depth++;
- node = node.getParentNode();
- }
- return depth;
- }
-
- /**
- *
- */
- static boolean isBraceClosed(ICSSNode node) {
- boolean bClosed = true;
- if (!(node instanceof CSSStructuredDocumentRegionContainer)) {
- return bClosed;
- }
-
- IStructuredDocumentRegion first = ((CSSStructuredDocumentRegionContainer) node).getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion last = ((CSSStructuredDocumentRegionContainer) node).getLastStructuredDocumentRegion();
- if (first == null || last == null) {
- return bClosed;
- }
- if (last.getStart() < first.getStart()) {
- return bClosed;
- }
-
- IStructuredDocumentRegion flatNode = first;
- int nOpen = 0;
- int nClose = 0;
- do {
- String type = CSSUtil.getStructuredDocumentRegionType(flatNode);
- if (type == CSSRegionContexts.CSS_LBRACE) {
- nOpen++;
- }
- else if (type == CSSRegionContexts.CSS_RBRACE) {
- nClose++;
- }
- flatNode = flatNode.getNext();
- }
- while (flatNode != null && flatNode != last);
-
- if ((nOpen == 0 && nClose == 0) || nClose < nOpen) {
- bClosed = false;
- }
-
- return bClosed;
- }
-
- /**
- * only for insertion..
- */
- static boolean isInterruption(CSSStructuredDocumentRegionContainer target, IStructuredDocumentRegion flatNode) {
- if (target == null || flatNode == null) {
- return false;
- }
- int start = flatNode.getStart();
- IStructuredDocumentRegion firstNode = target.getFirstStructuredDocumentRegion();
- IStructuredDocumentRegion lastNode = target.getLastStructuredDocumentRegion();
- if (firstNode != null && firstNode.getStart() < start && lastNode != null && start < lastNode.getStart()) {
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- static boolean isParentOf(ICSSNode parent, ICSSNode child) {
- if (parent == null || child == null) {
- return false;
- }
-
- for (ICSSNode node = child; node != null; node = node.getParentNode()) {
- if (parent == node) {
- return true;
- }
- }
-
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java
deleted file mode 100644
index 9d21149b4d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNamedNodeMapImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- *
- */
-public class CSSNamedNodeMapImpl extends CSSNodeListImpl implements ICSSNamedNodeMap {
-
- /**
- * CSSNamedNodeMapImpl constructor comment.
- */
- CSSNamedNodeMapImpl() {
- super();
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param name
- * java.lang.String
- */
- public ICSSNode getNamedItem(String name) {
- Iterator it = nodes.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof CSSAttrImpl && ((CSSAttrImpl) obj).getName().compareToIgnoreCase(name) == 0) {
- return (ICSSNode) obj;
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java
deleted file mode 100644
index 0f37dac06c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeImpl.java
+++ /dev/null
@@ -1,470 +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.css.core.internal.document;
-
-
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNamedNodeMap;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.core.internal.provisional.AbstractNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.DOMException;
-
-
-/**
- *
- */
-public abstract class CSSNodeImpl extends AbstractNotifier implements ICSSNode, IndexedRegion {
-
- private CSSDocumentImpl fOwnerDocument = null;
- private CSSNodeImpl fParentNode = null;
- private CSSNodeImpl fNextSibling = null;
- private CSSNodeImpl fPreviousSibling = null;
- private CSSNodeImpl fFirstChild = null;
- private CSSNodeImpl fLastChild = null;
- protected CSSNamedNodeMapImpl fAttrs = null;
-
- /**
- * CSSNodeImpl constructor comment.
- */
- CSSNodeImpl() {
- super();
- }
-
- CSSNodeImpl(CSSNodeImpl that) {
- if (that != null) {
- this.fOwnerDocument = that.fOwnerDocument;
- if (that.fAttrs != null) {
- int nAttrs = that.fAttrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- CSSAttrImpl attr = (CSSAttrImpl) that.fAttrs.item(i);
- setAttribute(attr.getName(), attr.getValue());
- }
- }
- }
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSNodeImpl appendChild(CSSNodeImpl newChild) throws org.w3c.dom.DOMException {
- return insertBefore(newChild, null);
- }
- /**
- * currently public but may be made default access protected in future.
- */
- protected void cloneChildNodes(ICSSNode newParent, boolean deep) {
- if (newParent == null || newParent == this)
- return;
-
- CSSNodeImpl container = (CSSNodeImpl) newParent;
- container.removeChildNodes();
-
- for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
- CSSNodeImpl cloned = (CSSNodeImpl) child.cloneNode(deep);
- if (cloned != null)
- container.appendChild(cloned);
- }
- }
-
- /**
- * @return boolean
- * @param offset
- * int
- */
- public boolean contains(int offset) {
- return (getStartOffset() <= offset && offset < getEndOffset());
- }
-
- /**
- *
- * currently public but may be made default access protected in future.
- *
- * @return java.lang.String
- */
- protected String generateSource() {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(this);
- return formatter.format(this).toString();
- }
-
- /**
- *
- * currently public but may be made default access protected in future.
- *
- * @return java.lang.String
- * @param name
- * java.lang.String
- */
- protected String getAttribute(String name) {
- CSSAttrImpl attr = getAttributeNode(name);
- if (attr != null)
- return attr.getValue();
- return null;
- }
-
- protected CSSAttrImpl getAttributeNode(String name) {
- if (fAttrs == null)
- return null;
-
- int nAttrs = fAttrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- CSSAttrImpl attr = (CSSAttrImpl) fAttrs.item(i);
- if (attr.matchName(name))
- return attr;
- }
- return null;
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
- */
- public ICSSNamedNodeMap getAttributes() {
- if (fAttrs == null)
- fAttrs = new CSSNamedNodeMapImpl();
- return fAttrs;
- }
-
- public ICSSNodeList getChildNodes() {
- CSSNodeListImpl list = new CSSNodeListImpl();
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- list.appendNode(node);
- }
- return list;
- }
-
- ICSSNode getCommonAncestor(ICSSNode node) {
- if (node == null)
- return null;
-
- for (ICSSNode na = node; na != null; na = na.getParentNode()) {
- for (ICSSNode ta = this; ta != null; ta = ta.getParentNode()) {
- if (ta == na)
- return ta;
- }
- }
-
- return null; // not found
- }
-
- CSSDocumentImpl getContainerDocument() {
- for (ICSSNode node = this; node != null; node = node.getParentNode()) {
- if (node instanceof CSSDocumentImpl) {
- CSSDocumentImpl doc = (CSSDocumentImpl) node;
- if (doc.isDocument())
- return doc;
- }
- }
- return null;
- }
-
- CSSNodeImpl getContainerNode(int offset) {
- if (!contains(offset))
- return null;
-
- for (ICSSNode child = getFirstChild(); child != null; child = child.getNextSibling()) {
- ICSSNode found = ((CSSNodeImpl) child).getContainerNode(offset);
- if (found != null)
- return (CSSNodeImpl) found;
- }
-
- return this;
- }
-
- /**
- */
- public FactoryRegistry getFactoryRegistry() {
- ICSSModel model = getOwnerDocument().getModel();
- if (model != null) {
- FactoryRegistry reg = model.getFactoryRegistry();
- if (reg != null)
- return reg;
- }
- return null;
- }
-
- public ICSSNode getFirstChild() {
- return this.fFirstChild;
- }
-
- public ICSSNode getLastChild() {
- return this.fLastChild;
- }
-
- public ICSSNode getNextSibling() {
- return this.fNextSibling;
- }
-
- ICSSNode getNodeAt(int offset) {
- // the same as getContainerNode()
- return getContainerNode(offset);
- }
-
- public ICSSDocument getOwnerDocument() {
- return this.fOwnerDocument;
- }
-
- public ICSSNode getParentNode() {
- return this.fParentNode;
- }
-
- public ICSSNode getPreviousSibling() {
- return this.fPreviousSibling;
- }
-
- ICSSNode getRootNode() {
- CSSNodeImpl parent = (CSSNodeImpl) getParentNode();
- if (parent == null)
- return this;
- return parent.getRootNode();
- }
-
- /**
- * @return boolean
- */
- public boolean hasChildNodes() {
- return (this.fFirstChild != null);
- }
-
- /**
- * @return boolean
- */
- public boolean hasProperties() {
- return false;
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSNodeImpl insertBefore(CSSNodeImpl newChild, CSSNodeImpl refChild) throws org.w3c.dom.DOMException {
- if (newChild == null)
- return null;
-
- CSSNodeImpl child = newChild;
- CSSNodeImpl next = refChild;
- CSSNodeImpl prev = null;
- if (next == null) {
- prev = this.fLastChild;
- this.fLastChild = child;
- }
- else {
- prev = (CSSNodeImpl) next.getPreviousSibling();
- next.setPreviousSibling(child);
- }
-
- if (prev == null)
- this.fFirstChild = child;
- else
- prev.setNextSibling(child);
- child.setPreviousSibling(prev);
- child.setNextSibling(next);
- child.setParentNode(this);
-
- notifyChildReplaced(child, null);
-
- return newChild;
- }
-
- protected void notifyAttrReplaced(CSSNodeImpl newAttr, CSSNodeImpl oldAttr) {
- // for model
- ICSSDocument doc = getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.attrReplaced(this, newAttr, oldAttr);
-
- // for adapters
- int type = CHANGE;
- if (newAttr == null)
- type = REMOVE;
- else if (oldAttr == null)
- type = ADD;
- notify(type, oldAttr, oldAttr, newAttr, getStartOffset());
- }
-
- protected void notifyChildReplaced(CSSNodeImpl newChild, CSSNodeImpl oldChild) {
- // for model
- ICSSDocument doc = getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.childReplaced(this, newChild, oldChild);
-
- // for adapters
- int type = CHANGE;
- if (newChild == null)
- type = REMOVE;
- else if (oldChild == null)
- type = ADD;
- notify(type, oldChild, oldChild, newChild, getStartOffset());
- }
-
- void removeAttributeNode(CSSNodeImpl attr) {
- // find
- int nAttrs = fAttrs.getLength();
- for (int i = 0; i < nAttrs; i++) {
- if (fAttrs.item(i) == attr) {
- fAttrs.removeNode(i);
- notifyAttrReplaced(null, attr);
- return;
- }
- }
- }
-
- protected CSSNodeImpl removeChild(CSSNodeImpl oldChild) throws org.w3c.dom.DOMException {
- if (oldChild == null)
- return null;
- if (oldChild.getParentNode() != this)
- return null;
-
- // close import rules
- ImportRuleCollector trav = new ImportRuleCollector();
- trav.apply(oldChild);
- Iterator it = trav.getRules().iterator();
- while (it.hasNext()) {
- ((CSSImportRuleImpl) it.next()).closeStyleSheet();
- }
-
- CSSNodeImpl child = oldChild;
- CSSNodeImpl prev = (CSSNodeImpl) child.getPreviousSibling();
- CSSNodeImpl next = (CSSNodeImpl) child.getNextSibling();
-
- if (prev == null)
- this.fFirstChild = next;
- else
- prev.setNextSibling(next);
-
- if (next == null)
- this.fLastChild = prev;
- else
- next.setPreviousSibling(prev);
-
- child.setPreviousSibling(null);
- child.setNextSibling(null);
- child.setParentNode(null);
-
- notifyChildReplaced(null, child);
-
- return child;
- }
-
- /**
- *
- */
- void removeChildNodes() {
- ICSSNode nextChild = null;
- for (ICSSNode child = getFirstChild(); child != null; child = nextChild) {
- nextChild = child.getNextSibling();
- removeChild((CSSNodeImpl) child);
- }
- }
-
- protected CSSNodeImpl replaceChild(CSSNodeImpl newChild, CSSNodeImpl oldChild) throws org.w3c.dom.DOMException {
- if (oldChild == null)
- return newChild;
- if (newChild != null)
- insertBefore(newChild, oldChild);
- return removeChild(oldChild);
- }
-
- /**
- *
- * currently public but may be made default access protected in future.
- *
- * @param name
- * java.lang.String
- * @param value
- * java.lang.String
- */
- public void setAttribute(String name, String value) {
- if (name == null)
- return;
-
- CSSAttrImpl attr = getAttributeNode(name);
- if (attr != null) {
- String oldValue = attr.getValue();
- if (value != null && value.equals(oldValue))
- return;
- if (value == null) {
- if (oldValue != null) {
- removeAttributeNode(attr);
- }
- return;
- }
- }
- else {
- if (value == null)
- return;
- if (fAttrs == null)
- fAttrs = new CSSNamedNodeMapImpl();
- CSSDocumentImpl doc = (CSSDocumentImpl) getOwnerDocument();
- if (doc == null)
- return;
- attr = (CSSAttrImpl) doc.createCSSAttr(name);
- attr.setOwnerCSSNode(this);
- fAttrs.appendNode(attr);
- notifyAttrReplaced(attr, null);
- }
- attr.setValue(value);
- }
-
- /**
- * @param cssText
- * java.lang.String
- */
- public void setCssText(String cssText) {
- // TODO : call flat model parser and replace myself with new three!!
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- private void setNextSibling(ICSSNode nextSibling) {
- this.fNextSibling = (CSSNodeImpl) nextSibling;
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public void setOwnerDocument(ICSSDocument ownerDocument) {
- this.fOwnerDocument = (CSSDocumentImpl) ownerDocument;
- }
-
- private void setParentNode(ICSSNode parentNode) {
- this.fParentNode = (CSSNodeImpl) parentNode;
- }
-
- private void setPreviousSibling(ICSSNode previousSibling) {
- this.fPreviousSibling = (CSSNodeImpl) previousSibling;
- }
-
- public int getLength() {
- int result = -1;
- int start = getStartOffset();
- if (start >= 0) {
- int end = getEndOffset();
- if (end >= 0) {
- result = end - start;
- if (result < -1) {
- result = -1;
- }
- }
- }
- return result;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java
deleted file mode 100644
index ed13871af7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSNodeListImpl.java
+++ /dev/null
@@ -1,27 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNodeList;
-
-class CSSNodeListImpl extends AbstractCSSNodeList implements ICSSNodeList {
-
- CSSNodeListImpl() {
- super();
- }
-
- public ICSSNode item(int index) {
- return itemImpl(index);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java
deleted file mode 100644
index e49d5789ee..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPageRuleImpl.java
+++ /dev/null
@@ -1,98 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-
-
-/**
- *
- */
-class CSSPageRuleImpl extends CSSRuleDeclContainer implements ICSSPageRule {
-
- ICSSSelectorList fSelectorList = new CSSSelectorListImpl(null);
-
- /**
- *
- */
- CSSPageRuleImpl() {
- super();
- }
-
- CSSPageRuleImpl(CSSPageRuleImpl that) {
- super(that);
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSPageRuleImpl cloned = new CSSPageRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String extractPreString() {
- StringBuffer preStr = new StringBuffer("@page ");//$NON-NLS-1$
- preStr.append(getSelectorText());
-
- return preStr.toString();
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return PAGERULE_NODE;
- }
-
- public ICSSSelectorList getSelectors() {
- return fSelectorList;
- }
-
- /**
- * The parsable textual representation of the page selector for the rule.
- *
- * @exception org.w3c.dom.DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has
- * a syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is
- * readonly.
- */
- public String getSelectorText() {
- return getAttribute(SELECTOR);
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return PAGE_RULE;
- }
-
- /**
- *
- */
- public void setSelectorText(String selectorText) throws org.w3c.dom.DOMException {
- setAttribute(SELECTOR, selectorText);
- fSelectorList = new CSSSelectorListImpl(selectorText);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java
deleted file mode 100644
index 8d1f18699f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveContainer.java
+++ /dev/null
@@ -1,39 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-
-/**
- *
- */
-abstract class CSSPrimitiveContainer extends CSSPrimitiveValueImpl {
-
- CSSPrimitiveContainer(CSSPrimitiveContainer that) {
- super(that);
- }
-
- CSSPrimitiveContainer(short primitiveType) {
- super(primitiveType);
- }
-
- protected abstract void initPrimitives();
- /**
- * currently public but may be made default access protected in future.
- */
- public void setOwnerDocument(ICSSDocument ownerDocument) {
- super.setOwnerDocument(ownerDocument);
-
- initPrimitives();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java
deleted file mode 100644
index 1bbc097a53..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java
+++ /dev/null
@@ -1,362 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.Counter;
-import org.w3c.dom.css.RGBColor;
-import org.w3c.dom.css.Rect;
-
-
-/**
- *
- */
-class CSSPrimitiveValueImpl extends CSSRegionContainer implements ICSSPrimitiveValue {
-
- protected short fPrimitiveType = CSS_UNKNOWN;
- private float fFloatValue = 0.0f;
- private String fStringValue = null;
-
- CSSPrimitiveValueImpl(CSSPrimitiveValueImpl that) {
- super(that);
-
- this.fPrimitiveType = that.fPrimitiveType;
- this.fFloatValue = that.fFloatValue;
- this.fStringValue = that.fStringValue;
- }
-
- CSSPrimitiveValueImpl(short primitiveType) {
- super();
- fPrimitiveType = primitiveType;
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSPrimitiveValueImpl cloned = new CSSPrimitiveValueImpl(this);
-
- return cloned;
- }
-
- /**
- * This method is used to get the Counter value. If this CSS value doesn't
- * contain a counter value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>Counter</code> interface.
- *
- * @return The Counter value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a Counter value (e.g. this is not
- * <code>CSS_COUNTER</code>).
- */
- public Counter getCounterValue() throws DOMException {
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getCSSValueText() {
- return getCssText();
- }
-
- /**
- * A code defining the type of the value as defined above.
- */
- public short getCssValueType() {
- if (getPrimitiveType() == CSS_INHERIT_PRIMITIVE) {
- return CSS_INHERIT;
- }
- else {
- return CSS_PRIMITIVE_VALUE;
- }
- }
-
- /**
- * This method is used to get a float value in a specified unit. If this
- * CSS value doesn't contain a float value or can't be converted into the
- * specified unit, a <code>DOMException</code> is raised.
- *
- * @param unitType
- * A unit code to get the float value. The unit code can only
- * be a float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>,<code>CSS_EMS</code>,
- * <code>CSS_EXS</code>,<code>CSS_PX</code>,
- * <code>CSS_CM</code>,<code>CSS_MM</code>,
- * <code>CSS_IN</code>,<code>CSS_PT</code>,
- * <code>CSS_PC</code>,<code>CSS_DEG</code>,
- * <code>CSS_RAD</code>,<code>CSS_GRAD</code>,
- * <code>CSS_MS</code>,<code>CSS_S</code>,
- * <code>CSS_HZ</code>,<code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @return The float value in the specified unit.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a float value or if the float value can't be
- * converted into the specified unit.
- */
- public float getFloatValue(short unitType) throws DOMException {
- switch (fPrimitiveType) {
- case CSS_NUMBER :
- case CSS_PERCENTAGE :
- case CSS_EMS :
- case CSS_EXS :
- case CSS_PX :
- case CSS_CM :
- case CSS_MM :
- case CSS_IN :
- case CSS_PT :
- case CSS_PC :
- case CSS_DEG :
- case CSS_RAD :
- case CSS_GRAD :
- case CSS_MS :
- case CSS_S :
- case CSS_HZ :
- case CSS_KHZ :
- case CSS_DIMENSION :
- case CSS_INTEGER :
- case CSS_HASH :
- return fFloatValue;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/17
- * 12:12:18)
- *
- * @return short
- */
- public short getNodeType() {
- return PRIMITIVEVALUE_NODE;
- }
-
- /**
- * The type of the value as defined by the constants specified above.
- */
- public short getPrimitiveType() {
- return fPrimitiveType;
- }
-
- /**
- * This method is used to get the Rect value. If this CSS value doesn't
- * contain a rect value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>Rect</code> interface.
- *
- * @return The Rect value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a Rect value. (e.g. this is not
- * <code>CSS_RECT</code>).
- */
- public Rect getRectValue() throws DOMException {
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * This method is used to get the RGB color. If this CSS value doesn't
- * contain a RGB color value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>RGBColor</code> interface.
- *
- * @return the RGB color value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property
- * can't return a RGB color value (e.g. this is not
- * <code>CSS_RGBCOLOR</code>).
- */
- public RGBColor getRGBColorValue() throws DOMException {
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
-
- /**
- * This method is used to get the string value. If the CSS value doesn't
- * contain a string value, a <code>DOMException</code> is raised. Some
- * properties (like 'font-family' or 'voice-family') convert a whitespace
- * separated list of idents to a string.
- *
- * @return The string value in the current unit. The current
- * <code>primitiveType</code> can only be a string unit type
- * (i.e. <code>CSS_STRING</code>,<code>CSS_URI</code>,
- * <code>CSS_IDENT</code> and <code>CSS_ATTR</code>).
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a string value.
- */
- public String getStringValue() throws DOMException {
- switch (fPrimitiveType) {
- case CSS_STRING :
- case CSS_URI :
- case CSS_IDENT :
- case CSS_ATTR :
- case CSS_URANGE :
- case CSS_FORMAT :
- case CSS_LOCAL :
- case CSS_HASH :
- case CSS_COMMA :
- case CSS_SLASH :
- case CSS_INHERIT_PRIMITIVE :
- return fStringValue;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void notifyValueChanged(String oldValue) {
- // for model
- ICSSDocument doc = getContainerDocument();
- if (doc == null)
- return;
- CSSModelImpl model = (CSSModelImpl) doc.getModel();
- if (model == null)
- return;
- model.valueChanged(this, oldValue);
-
- // for adapters
- notify(CHANGE, new Short(fPrimitiveType), null, null, getStartOffset());
- }
-
- /**
- * A method to set the float value with a specified unit. If the property
- * attached with this value can not accept the specified unit or the float
- * value, the value will be unchanged and a <code>DOMException</code>
- * will be raised.
- *
- * @param unitType
- * A unit code as defined above. The unit code can only be a
- * float unit type (i.e. <code>CSS_NUMBER</code>,
- * <code>CSS_PERCENTAGE</code>,<code>CSS_EMS</code>,
- * <code>CSS_EXS</code>,<code>CSS_PX</code>,
- * <code>CSS_CM</code>,<code>CSS_MM</code>,
- * <code>CSS_IN</code>,<code>CSS_PT</code>,
- * <code>CSS_PC</code>,<code>CSS_DEG</code>,
- * <code>CSS_RAD</code>,<code>CSS_GRAD</code>,
- * <code>CSS_MS</code>,<code>CSS_S</code>,
- * <code>CSS_HZ</code>,<code>CSS_KHZ</code>,
- * <code>CSS_DIMENSION</code>).
- * @param floatValue
- * The new float value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the attached property
- * doesn't support the float value or the unit type. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public void setFloatValue(short unitType, float floatValue) throws DOMException {
- switch (unitType) {
- case CSS_NUMBER :
- case CSS_PERCENTAGE :
- case CSS_EMS :
- case CSS_EXS :
- case CSS_PX :
- case CSS_CM :
- case CSS_MM :
- case CSS_IN :
- case CSS_PT :
- case CSS_PC :
- case CSS_DEG :
- case CSS_RAD :
- case CSS_GRAD :
- case CSS_MS :
- case CSS_S :
- case CSS_HZ :
- case CSS_KHZ :
- case CSS_DIMENSION :
- case CSS_INTEGER :
- String oldValue = getCSSValueText();
- fPrimitiveType = unitType;
- fFloatValue = floatValue;
- notifyValueChanged(oldValue);
- break;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * A method to set the string value with the specified unit. If the
- * property attached to this value can't accept the specified unit or the
- * string value, the value will be unchanged and a
- * <code>DOMException</code> will be raised.
- *
- * @param stringType
- * A string code as defined above. The string code can only be
- * a string unit type (i.e. <code>CSS_STRING</code>,
- * <code>CSS_URI</code>,<code>CSS_IDENT</code>, and
- * <code>CSS_ATTR</code>).
- * @param stringValue
- * The new string value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a string value or if the string value can't be
- * converted into the specified unit. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- */
- public void setStringValue(short stringType, String stringValue) throws DOMException {
- switch (stringType) {
- case CSS_STRING :
- case CSS_URI :
- case CSS_IDENT :
- case CSS_ATTR :
- case CSS_URANGE :
- case CSS_FORMAT :
- case CSS_LOCAL :
- case CSS_HASH :
- case CSS_COMMA :
- case CSS_SLASH :
- case CSS_INHERIT_PRIMITIVE :
- String oldValue = getCSSValueText();
- fPrimitiveType = stringType;
- fStringValue = stringValue;
- notifyValueChanged(oldValue);
- break;
- default :
- throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
- }
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/24
- * 15:06:25)
- *
- * @param floatValue
- * float
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setValue(float floatValue) throws org.w3c.dom.DOMException {
- setFloatValue(getPrimitiveType(), floatValue);
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/24
- * 15:06:25)
- *
- * @param stringValue
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setValue(java.lang.String stringValue) throws org.w3c.dom.DOMException {
- setStringValue(getPrimitiveType(), stringValue);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
deleted file mode 100644
index c569e91036..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRegionContainer.java
+++ /dev/null
@@ -1,203 +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.css.core.internal.document;
-
-
-
-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;
-
-/**
- *
- */
-abstract class CSSRegionContainer extends CSSNodeImpl {
-
- private ITextRegion fFirstRegion = null;
- private ITextRegion fLastRegion = null;
- private IStructuredDocumentRegion fParentRegion = null;
-
- /**
- * CSSRegionContainer constructor comment.
- */
- CSSRegionContainer() {
- super();
- }
-
- CSSRegionContainer(CSSRegionContainer that) {
- super(that);
- }
-
- /**
- * @return java.lang.String
- */
- public String getCssText() {
- if (fFirstRegion == null || fLastRegion == null)
- return generateSource();
-
- ITextRegionList regions = fParentRegion.getRegions();
- StringBuffer source = new StringBuffer();
- boolean bIn = false;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion current = regions.get(i);
- if (bIn) {
- source.append(fParentRegion.getText(current));
- if (current == fLastRegion)
- break;
- }
- else {
- if (current == fFirstRegion) {
- bIn = true;
- source.append(fParentRegion.getText(current));
- if (current == fLastRegion)
- break;
- }
- }
- }
-
- return source.toString();
- }
-
- /**
- * @return int
- */
- public int getEndOffset() {
- int result = -1;
- ITextRegion region = getLastRegion();
- if (!(region == null || fParentRegion == null)) {
- result = fParentRegion.getEndOffset(region);
- }
- return result;
- }
-
- IStructuredDocumentRegion getDocumentRegion() {
- return fParentRegion;
- }
-
- ITextRegion getFirstRegion() {
- return fFirstRegion;
- }
-
- ITextRegion getLastRegion() {
- return fLastRegion;
- }
-
- ITextRegion getRegion(int index) {
- if (getFirstRegion() == null)
- return null;
- ITextRegionList regions = fParentRegion.getRegions();
-
- for (int i = 0; i < regions.size(); i++) {
- if (regions.get(i) == getFirstRegion()) {
- if (i + index < regions.size()) {
- ITextRegion target = regions.get(i + index);
- if (target.getStart() <= getLastRegion().getStart())
- return target;
- }
- return null;
- }
- }
- return null;
- }
-
- /**
- * @return int
- */
- int getRegionCount() {
- validateRange();
-
- if (getFirstRegion() == null)
- return 0;
- if (getFirstRegion() == getLastRegion())
- return 1;
- ITextRegionList regions = fParentRegion.getRegions();
-
- int j = 0;
- for (int i = 0; i < regions.size(); i++) {
- ITextRegion current = regions.get(i);
- if (j != 0 || current == getFirstRegion())
- j++;
- if (current == getLastRegion())
- break;
- }
- return j;
- }
-
- /**
- * @return int
- */
- public int getStartOffset() {
- int result = -1;
- ITextRegion region = getFirstRegion();
- if (!(region == null || fParentRegion == null)) {
- result = fParentRegion.getStartOffset(region);
- }
- return result;
- }
-
-
-
- /**
- * @deprecated
- */
- ITextRegion setFirstRegion(ITextRegion region) {
- this.fFirstRegion = region;
- return region;
- }
-
- /**
- * @deprecated
- */
- ITextRegion setLastRegion(ITextRegion lastRegion) {
- this.fLastRegion = lastRegion;
- return lastRegion;
- }
-
- void setRangeRegion(IStructuredDocumentRegion parentRegion, ITextRegion firstRegion, ITextRegion lastRegion) {
- this.fParentRegion = parentRegion;
- this.fFirstRegion = firstRegion;
- this.fLastRegion = lastRegion;
-
- if (firstRegion == null && lastRegion == null) {
- setFirstRegion(null);
- setLastRegion(null);
- }
- else { // range validation
- validateRange();
- }
- }
-
- /**
- * @return boolean
- */
- private boolean validateRange() {
- boolean bModified = false;
-
- if (this.fFirstRegion != null || this.fLastRegion != null) {
- if (this.fFirstRegion == null) {
- this.fFirstRegion = this.fLastRegion;
- bModified = true;
- }
- else if (this.fLastRegion == null) {
- this.fLastRegion = this.fFirstRegion;
- bModified = true;
- }
- else if (this.fFirstRegion.getStart() > this.fLastRegion.getStart()) {
- // need to swap first for last
- ITextRegion reg = fFirstRegion;
- fFirstRegion = fLastRegion;
- fLastRegion = reg;
- bModified = true;
- }
- }
- return bModified;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java
deleted file mode 100644
index 64381642dc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleDeclContainer.java
+++ /dev/null
@@ -1,56 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- *
- */
-abstract class CSSRuleDeclContainer extends CSSRuleImpl {
-
- /**
- * CSSRuleDeclContainer constructor comment.
- */
- CSSRuleDeclContainer() {
- super();
- }
-
- /**
- * CSSRuleDeclContainer constructor comment.
- *
- */
- CSSRuleDeclContainer(CSSRuleDeclContainer that) {
- super(that);
- }
-
- /**
- * @return java.lang.String
- */
- abstract String extractPreString();
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- public CSSStyleDeclaration getStyle() {
-
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSStyleDeclaration)
- return (CSSStyleDeclaration) node;
- }
-
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java
deleted file mode 100644
index 32e6e38290..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleImpl.java
+++ /dev/null
@@ -1,80 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSStyleSheet;
-
-
-/**
- *
- */
-abstract class CSSRuleImpl extends CSSStructuredDocumentRegionContainer implements CSSRule {
-
- /**
- *
- */
- CSSRuleImpl() {
- super();
- }
-
- CSSRuleImpl(CSSRuleImpl that) {
- super(that);
- }
-
- /**
- * If this rule is contained inside another rule (e.g. a style rule inside
- * an
- *
- * @media block), this is the containing rule. If this rule is not nested
- * inside any other rules, this returns <code>null</code>.
- */
- public CSSRule getParentRule() {
- ICSSNode rule = getParentNode();
-
- // parent rule is used only if parent is media rule
- if (rule instanceof CSSMediaRuleImpl)
- return (CSSRule) rule;
-
- return null;
- }
-
- /**
- * The style sheet that contains this rule.
- */
- public CSSStyleSheet getParentStyleSheet() {
- ICSSNode parent = getParentNode();
- while (parent != null) {
- if (parent instanceof CSSStyleSheetImpl)
- return (CSSStyleSheet) parent;
- parent = parent.getParentNode();
- }
- return null;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public abstract short getType();
-
- /**
- * @return boolean
- */
- public boolean hasProperties() {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java
deleted file mode 100644
index 51f15a490b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSRuleListImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.document;
-
-
-
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-
-/**
- *
- */
-public class CSSRuleListImpl extends AbstractCSSNodeList implements CSSRuleList {
-
- /**
- *
- */
- CSSRuleListImpl() {
- super();
- }
-
- /**
- * Used to retrieve a CSS rule by ordinal index. The order in this
- * collection represents the order of the rules in the CSS style sheet. If
- * index is greater than or equal to the number of rules in the list, this
- * returns <code>null</code>.
- *
- * @param indexIndex
- * into the collection
- * @return The style rule at the <code>index</code> position in the
- * <code>CSSRuleList</code>, or <code>null</code> if that is
- * not a valid index.
- */
- public CSSRule item(int index) {
- return (CSSRule) itemImpl(index);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
deleted file mode 100644
index 4f6dd49629..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelector.java
+++ /dev/null
@@ -1,422 +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.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-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.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.xml.core.internal.provisional.NameValidator;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-
-/**
- *
- */
-class CSSSelector implements ICSSSelector {
-
- private int fSpecificity = -1;
- private String fCachedString = null;
- private List fTokens = null;
- private List fItems = null;
- private List fParseErrors = null;
- private List fNameErrors = null;
-
- CSSSelector(List tokens) {
- fTokens = new ArrayList(tokens);
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSelector foreign = (CSSSelector) obj;
-
- // if (fSpecificity != foreign.fSpecificity) return false;
-
- if (getLength() != foreign.getLength())
- return false;
-
- for (int i = 0; i < getLength(); i++) {
- if (!getItem(i).equals(foreign.getItem(i)))
- return false;
- }
-
- return true;
- }
-
- public ICSSSelectorItem getItem(int index) {
- if (fItems == null) {
- fItems = parseSelector(fTokens);
- }
- if (fItems != null && 0 <= index && index < fItems.size()) {
- return (ICSSSelectorItem) fItems.get(index);
- }
- else {
- return null;
- }
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator getIterator() {
- if (fItems == null) {
- fItems = parseSelector(fTokens);
- }
- return (fItems != null) ? fItems.iterator() : null;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- if (fItems == null) {
- fItems = parseSelector(fTokens);
- }
- return (fItems != null) ? fItems.size() : 0;
- }
-
- /**
- * @return org.w3c.dom.Element
- */
- private Element getParentElement(Element element) {
- try {
- element = (Element) element.getParentNode();
- }
- catch (Exception ex) {
- // cast error or null pointer ...
- element = null;
- }
- return element;
- }
-
- /**
- * @return org.w3c.dom.Element
- */
- private Element getPreviousElement(Element element) {
- Element p = null;
- for (Node node = element.getPreviousSibling(); node != null; node = node.getPreviousSibling()) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- p = (Element) node;
- break;
- }
- }
- return p;
- }
-
- /**
- * Calculate a selector's specificity a = the number of ID attributes in
- * the selector b = the number of other attributes and pseudo-classes in
- * the selector c = the number of element names in the selector (ignore
- * pseudo-elements) Concatenating the three numbers a-b-c (in a number
- * system with a large base) gives the specificity.
- *
- * @return int
- */
- public int getSpecificity() {
- if (fSpecificity < 0) {
- int nIDs = 0;
- int nAttributes = 0;
- int nElements = 0;
- Iterator i = getIterator();
- while (i.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) i.next();
- if (item instanceof CSSSimpleSelector) {
- CSSSimpleSelector selector = (CSSSimpleSelector) item;
- nIDs += selector.getNumOfIDs();
- nAttributes += selector.getNumOfAttributes();
- nAttributes += selector.getNumOfClasses();
- nAttributes += selector.getNumOfPseudoNames();
- if (!selector.isUniversal()) {
- nElements++;
- }
- }
- }
- fSpecificity = nIDs * 10000 + nAttributes * 100 + nElements;
- }
-
- return fSpecificity;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- if (fCachedString == null) {
- StringBuffer buf = new StringBuffer();
- Iterator i = getIterator();
- while (i.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) i.next();
- if (item instanceof CSSSelectorCombinator) {
- // If item is DESCENDANT combinator, it is just single
- // space.
- // Then, you dont have to append string..
- if (((CSSSelectorCombinator) item).getCombinatorType() != ICSSSelectorCombinator.DESCENDANT) {
- buf.append(" ");//$NON-NLS-1$
- buf.append(item.getString());
- }
- buf.append(" ");//$NON-NLS-1$
- }
- else {
- buf.append(item.getString());
- }
- }
- fCachedString = buf.toString();
- }
-
- return fCachedString;
- }
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- public boolean match(org.w3c.dom.Element element, java.lang.String pseudoName) {
- Element target = element;
- char combinatorType = ICSSSelectorCombinator.UNKNOWN;
- Element chunkStartElement = null; // for CHILD and ADJACENT
- // combinator
- int chunkStartItem = -1; // for CHILD and ADJACENT combinator
- int numItems = getLength();
- for (int iItem = numItems - 1; iItem >= 0; iItem--) {
- // Check Selector Items
- ICSSSelectorItem item = getItem(iItem);
- if (item instanceof ICSSSimpleSelector) {
- // Simple Selector
- if (target == null)
- return false;
- if (!matchExactly((ICSSSimpleSelector) item, target, pseudoName)) {
- switch (combinatorType) {
- case ICSSSelectorCombinator.DESCENDANT :
- do {
- target = getParentElement(target);
- if (target == null)
- return false;
- }
- while (!matchExactly((ICSSSimpleSelector) item, target, pseudoName));
- break;
- case ICSSSelectorCombinator.CHILD :
- case ICSSSelectorCombinator.ADJACENT :
- if (chunkStartElement != null && chunkStartElement != element) {
- // previous conbinator must be DESCENDENT.
- // goto parent
- target = getParentElement(chunkStartElement);
- iItem = chunkStartItem + 1;
- chunkStartElement = null;
- chunkStartItem = -1;
- break;
- }
- default :
- // other combinators are not supported yet.
- return false;
- }
- }
- }
- else if (item instanceof ICSSSelectorCombinator) {
- // Combinator ( "+", ">", " ", ...)
- if (iItem == numItems - 1)
- return false; // last item is combinator
-
- ICSSSelectorCombinator sc = (ICSSSelectorCombinator) item;
- combinatorType = sc.getCombinatorType();
- switch (combinatorType) {
- case ICSSSelectorCombinator.DESCENDANT :
- target = getParentElement(target);
- break;
- case ICSSSelectorCombinator.CHILD :
- case ICSSSelectorCombinator.ADJACENT :
- if (chunkStartElement == null) {
- chunkStartElement = target;
- chunkStartItem = iItem + 1; // safe because this
- // is not a last item.
- }
- if (combinatorType == ICSSSelectorCombinator.CHILD) {
- target = getParentElement(target);
- }
- else {
- target = getPreviousElement(target);
- }
- break;
- }
- }
- else {
- // what is this item ???
- return false;
- }
- }
- // OK this selector maches the element.
- return true;
-
- }
-
- /**
- * @return boolean
- */
- private boolean matchExactly(ICSSSimpleSelector selector, Element element, String pseudoName) {
- IStyleSelectorAdapter adapter = (IStyleSelectorAdapter) ((INodeNotifier) element).getAdapterFor(IStyleSelectorAdapter.class);
- if (adapter != null) {
- return adapter.match(selector, element, pseudoName);
- }
-
- if (element == null)
- return false;
- int i;
- String key;
-
- // TODO: PseudoName
-
- // check tag name
- if (!selector.isUniversal() && !element.getNodeName().equals(selector.getName()))
- return false;
-
- // check id
- i = selector.getNumOfIDs();
- if (i > 0) {
- if (i > 1)
- return false;
- key = element.getAttribute("id");//$NON-NLS-1$
- if (key == null)
- return false;
- if (!selector.getID(0).equals(key))
- return false;
- }
-
- // check class
- i = selector.getNumOfClasses();
- if (i > 0) {
- key = element.getAttribute("class");//$NON-NLS-1$
- if (key == null)
- return false;
- StringTokenizer tokenizer = new StringTokenizer(key);
- for (i = i - 1; i >= 0; i--) {
- boolean ok = false;
- while (tokenizer.hasMoreTokens()) {
- if (selector.getClass(i).equals(tokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
-
- // check attributes
- for (i = selector.getNumOfAttributes() - 1; i >= 0; i--) {
- StringTokenizer tokenizer = new StringTokenizer(selector.getAttribute(i), "=~| \t\r\n\f");//$NON-NLS-1$
- int countTokens = tokenizer.countTokens();
- if (countTokens > 0) {
- String attrValue = element.getAttribute(tokenizer.nextToken());
- if (attrValue == null)
- return false;
- if (countTokens > 1) {
- String token = tokenizer.nextToken("= \t\r\n\f");//$NON-NLS-1$
- StringTokenizer attrValueTokenizer = null;
- if (token.equals("~")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue);
- }
- else if (token.equals("|")) {//$NON-NLS-1$
- attrValueTokenizer = new StringTokenizer(attrValue, "-");//$NON-NLS-1$
- }
- if (attrValueTokenizer != null) {
- if (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- boolean ok = false;
- while (attrValueTokenizer.hasMoreTokens()) {
- if (token.equals(attrValueTokenizer.nextToken())) {
- ok = true;
- break;
- }
- }
- if (!ok)
- return false;
- }
- }
- else {
- if (!attrValue.equals(token))
- return false;
- }
- }
- }
- }
-
- return true;
- }
-
- private List parseSelector(List tokens) {
- CSSSelectorParser parser = new CSSSelectorParser(tokens);
- List selector = parser.getSelector();
- Iterator i = parser.getErrors();
- fParseErrors = new ArrayList();
- while (i.hasNext()) {
- fParseErrors.add(i.next());
- }
- return selector;
- }
-
- public Iterator getErrors() {
- if (fNameErrors == null) {
- fNameErrors = new ArrayList();
- Iterator iItem = getIterator();
- while (iItem.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) iItem.next();
- if (item instanceof ICSSSimpleSelector) {
- if (!((ICSSSimpleSelector) item).isUniversal()) {
- String name = ((ICSSSimpleSelector) item).getName();
- if (!NameValidator.isValid(name)) {
- fNameErrors.add(item);
- }
- }
- }
- }
- }
- List errors = new ArrayList(fParseErrors);
- errors.addAll(fNameErrors);
- return errors.iterator();
- }
-
- public String toString() {
- return getString();
- }
-
- /**
- * @see ICSSSelector#getErrorCount()
- */
- public int getErrorCount() {
- int nErrors = 0;
- Iterator i = getErrors();
- while (i.hasNext()) {
- nErrors++;
- i.next();
- }
- return nErrors;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java
deleted file mode 100644
index d015aa515a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorCombinator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator;
-
-/**
- *
- */
-class CSSSelectorCombinator extends CSSSelectorItem implements ICSSSelectorCombinator {
-
- char fType = ICSSSelectorCombinator.UNKNOWN;
-
- /**
- * CSSSelectorCombinator constructor comment.
- */
- public CSSSelectorCombinator(char type) {
- super();
- setCombinatorType(type);
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSelectorCombinator foreign = (CSSSelectorCombinator) obj;
-
- return (getCombinatorType() == foreign.getCombinatorType());
-
- }
-
- /**
- * @return int
- */
- public char getCombinatorType() {
- return fType;
- }
-
- /**
- * @return int
- */
- public int getItemType() {
- return COMBINATOR;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- StringBuffer buf = new StringBuffer();
- buf.append(fType);
- return buf.toString();
- }
-
- void setCombinatorType(char type) {
- fType = type;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java
deleted file mode 100644
index 3436661aa0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorItem.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-
-/**
- *
- */
-abstract class CSSSelectorItem implements ICSSSelectorItem {
-
- /**
- * CSSSelectorItem constructor comment.
- */
- public CSSSelectorItem() {
- super();
- }
-
- /**
- * @return int
- */
- public int getItemType() {
- return 0;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java
deleted file mode 100644
index ed231f9f5a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorListImpl.java
+++ /dev/null
@@ -1,207 +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.css.core.internal.document;
-
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.w3c.dom.Element;
-
-
-/**
- *
- */
-public class CSSSelectorListImpl implements ICSSSelectorList {
-
- private String fText = null;
- private String fCachedString = null; // normalized string
- private List fSelectors = null;
-
- public CSSSelectorListImpl(String cssText) {
- super();
- fText = cssText;
- parseSelectorText();
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSelectorListImpl foreign = (CSSSelectorListImpl) obj;
-
- if (getLength() != foreign.getLength())
- return false;
-
- for (int i = 0; i < getLength(); i++) {
- if (!getSelector(i).equals(foreign.getSelector(i)))
- return false;
- }
-
- return true;
- }
-
- /**
- * @return java.util.Iterator
- */
- public Iterator getIterator() {
- return getSelectors().iterator();
- }
-
- /**
- * @return int
- */
- public int getLength() {
- return getSelectors().size();
- }
-
- public ICSSSelector getSelector(int index) {
- List selectors = getSelectors();
- if (0 <= index && index < selectors.size()) {
- return (ICSSSelector) selectors.get(index);
- }
- else {
- return null;
- }
- }
-
- private List getSelectors() {
- if (fSelectors == null) {
- parseSelectorText();
- }
- return fSelectors;
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- if (fCachedString == null) {
- StringBuffer buf = new StringBuffer();
- boolean bFirst = true;
- // groups is list of comma-separated selectors
- Iterator i = getSelectors().iterator();
- while (i.hasNext()) {
- if (!bFirst) {
- buf.append(", ");//$NON-NLS-1$
- }
- ICSSSelector item = (ICSSSelector) i.next();
- buf.append(item.getString());
- bFirst = false;
- }
- fCachedString = buf.toString();
- }
- return fCachedString;
- }
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- public boolean match(Element element, String pseudoName) {
- int nSelectors = getLength();
- for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
- // Check each Selector Lists
- ICSSSelector selector = getSelector(iSelector);
- if (selector.match(element, pseudoName))
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- private void parseSelectorText() {
- fSelectors = new ArrayList();
- if (fText == null) {
- return;
- }
-
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_STYLESHEET, fText);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return;
- }
-
- List tokenGroup = new ArrayList();
- for (int i = 0; i < tokens.length; i++) {
- CSSTextToken token = tokens[i];
- if (token.kind == CSSRegionContexts.CSS_SELECTOR_SEPARATOR && 0 < tokenGroup.size()) {
- ICSSSelector selector = new CSSSelector(tokenGroup);
- if (selector != null) {
- fSelectors.add(selector);
- }
- tokenGroup.clear();
- }
- else {
- tokenGroup.add(tokens[i]);
- }
- }
- if (0 < tokenGroup.size()) {
- ICSSSelector selector = new CSSSelector(tokenGroup);
- if (selector != null) {
- fSelectors.add(selector);
- }
- }
- }
-
- /**
- *
- */
- public String toString() {
- return getString();
- }
-
- /**
- *
- */
- public Iterator getErrors() {
- List errors = new ArrayList();
- Iterator iSelector = getSelectors().iterator();
- while (iSelector.hasNext()) {
- Iterator iError = ((ICSSSelector) iSelector.next()).getErrors();
- while (iError.hasNext()) {
- errors.add(iError.next());
- }
- }
- return errors.iterator();
- }
-
- /**
- *
- */
- public int getErrorCount() {
- int nErrors = 0;
- Iterator i = getErrors();
- while (i.hasNext()) {
- nErrors++;
- i.next();
- }
- return nErrors;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java
deleted file mode 100644
index b605610a89..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSelectorParser.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorCombinator;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-
-
-/**
- *
- */
-public class CSSSelectorParser {
-
- private final static int IDLE = 0;
- private final static int ATTRIBUTE = 1;
- private final static int SIMPLE = 2;
-
- private List fTokens = null;
- private List fItems = null;
- private List fErrors = null;
-
- /**
- *
- */
- CSSSelectorParser(List tokens) {
- super();
- fTokens = new ArrayList(tokens);
- }
-
- /**
- *
- */
- List getSelector() {
- if (fItems == null) {
- parseSelector();
- }
- return fItems;
- }
-
- /**
- *
- */
- private void parseSelector() {
- fItems = new ArrayList();
-
- List attrBuf = null;
- CSSSimpleSelector item = null;
-
- int status = IDLE;
- Iterator i = fTokens.iterator();
- while (i.hasNext()) {
- CSSTextToken token = (CSSTextToken) i.next();
- if (token == null || token.kind == CSSRegionContexts.CSS_S || token.kind == CSSRegionContexts.CSS_COMMENT) {
- continue;
- }
- switch (status) {
- case IDLE :
- if (isTag(token)) {
- item = createSimple();
- appendTag(item, token);
- status = SIMPLE;
- }
- else if (isID(token)) {
- item = createSimple();
- appendID(item, token);
- status = SIMPLE;
- }
- else if (isClass(token)) {
- item = createSimple();
- appendClass(item, token);
- status = SIMPLE;
- }
- else if (isPseudo(token)) {
- item = createSimple();
- appendPseudo(item, token);
- status = SIMPLE;
- }
- else if (isAttributeBegin(token)) {
- item = createSimple();
- status = ATTRIBUTE;
- }
- else {
- addError(token);
- }
- break;
- case SIMPLE :
- if (isID(token)) {
- appendID(item, token);
- }
- else if (isClass(token)) {
- appendClass(item, token);
- }
- else if (isPseudo(token)) {
- appendPseudo(item, token);
- }
- else if (isAttributeBegin(token)) {
- status = ATTRIBUTE;
- }
- else if (isCombinator(token)) { // combinator
- closeItem(item);
- closeItem(createCombinator(token));
- status = IDLE;
- }
- else {
- addError(token);
- }
- break;
- case ATTRIBUTE :
- if (isAttributeEnd(token)) {
- appendAttribute(item, attrBuf);
- attrBuf = null;
- status = SIMPLE;
- }
- else {
- if (attrBuf == null) {
- attrBuf = new ArrayList();
- }
- attrBuf.add(token);
- if (!isAttributeContent(token)) {
- addError(token);
- }
- }
- break;
- default :
- break;
- }
- }
-
- closeItem(item);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isAttributeContent(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isAttributeEnd(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isAttributeBegin(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isCombinator(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_COMBINATOR);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isPseudo(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_PSEUDO);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isClass(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_CLASS);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isID(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ID);
- }
-
- /**
- * @param token
- * @return
- */
- private boolean isTag(CSSTextToken token) {
- String type = token.kind;
- return (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_UNKNOWN);
- }
-
- private CSSSimpleSelector createSimple() {
- return new CSSSimpleSelector();
- }
-
- /**
- * if " " or "+" or ">" appeared, close simpleselector and add new
- * combinator
- */
- private CSSSelectorCombinator createCombinator(CSSTextToken token) {
- char type = 0;
-
- String str = token.image;
- if (str.trim().length() == 0) { // space
- type = ICSSSelectorCombinator.DESCENDANT;
- }
- else if (str.equals("+")) { //$NON-NLS-1$
- type = ICSSSelectorCombinator.ADJACENT;
- }
- else if (str.equals(">")) { //$NON-NLS-1$
- type = ICSSSelectorCombinator.CHILD;
- }
-
- if (0 < type) {
- return new CSSSelectorCombinator(type);
- }
- else {
- return null;
- }
- }
-
- /**
- *
- */
- private void closeItem(ICSSSelectorItem item) {
- if (item != null) {
- fItems.add(item);
- }
- }
-
- private void appendTag(CSSSimpleSelector item, CSSTextToken token) {
- item.setName(token.image);
- if (token.kind == CSSRegionContexts.CSS_UNKNOWN) {
- addError(token);
- }
- }
-
- /**
- * if "#xxxx" appeared, add ID to current selector
- */
- private void appendID(CSSSimpleSelector item, CSSTextToken token) {
- String text = token.toString();
- String idContent = text.substring(1, text.length());
- item.addID(idContent);
- }
-
- /**
- * if ".xxxx" appeared, add Class to current selector
- */
- private void appendClass(CSSSimpleSelector item, CSSTextToken token) {
- String text = token.toString();
- String classContent = text.substring(1, text.length());
- item.addClass(classContent);
- if (Character.isDigit(classContent.charAt(0))) {
- addError(token);
- }
- }
-
- /**
- * if ":xxxx" appeared, add Pseudo(element/class) to current selector
- */
- private void appendPseudo(CSSSimpleSelector item, CSSTextToken token) {
- String text = token.toString();
- String pseudoContent = text.substring(1, text.length());
- item.addPseudoName(pseudoContent);
- }
-
- /**
- *
- */
- private void appendAttribute(CSSSimpleSelector item, List tokens) {
- StringBuffer buf = new StringBuffer();
-
- CSSTextToken token;
- Iterator i = tokens.iterator();
- while (i.hasNext()) {
- token = (CSSTextToken) i.next();
- buf.append(token.image);
- }
-
- item.addAttribute(buf.toString());
- }
-
- /**
- *
- */
- List getSelectorTags() {
- List tagList = new ArrayList();
- return tagList;
- }
-
- /**
- *
- */
- private void addError(CSSTextToken token) {
- if (fErrors == null) {
- fErrors = new ArrayList();
- }
- fErrors.add(token);
- }
-
- /**
- *
- */
- Iterator getErrors() {
- return (fErrors == null) ? Collections.EMPTY_LIST.iterator() : fErrors.iterator();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java
deleted file mode 100644
index 5928e90dfe..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSSimpleSelector.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-
-
-/**
- *
- */
-class CSSSimpleSelector extends CSSSelectorItem implements ICSSSimpleSelector {
-
- private String fName = null;
- private String fCachedString = null;
- private StringBuffer fStringBuf = null;
- private List fPseudoName = null;
- private List fAttribute = null;
- private List fClass = null;
- private List fID = null;
-
- /**
- * CSSSimpleSelector constructor comment.
- */
- public CSSSimpleSelector() {
- super();
- }
-
- /**
- *
- */
- void addAttribute(String attribute) {
- if (fAttribute == null) {
- fAttribute = new ArrayList();
- }
- fAttribute.add(attribute);
- addToBuf("[");//$NON-NLS-1$
- addToBuf(attribute);
- addToBuf("]");//$NON-NLS-1$
- fCachedString = null;
- }
-
- /**
- *
- */
- void addClass(String cls) {
- if (fClass == null) {
- fClass = new ArrayList();
- }
- fClass.add(cls);
- addToBuf(".");//$NON-NLS-1$
- addToBuf(cls);
- fCachedString = null;
- }
-
- /**
- *
- */
- void addID(String id) {
- if (fID == null) {
- fID = new ArrayList();
- }
- fID.add(id);
- addToBuf("#");//$NON-NLS-1$
- addToBuf(id);
- fCachedString = null;
- }
-
- /**
- *
- */
- void addPseudoName(String cls) {
- if (fPseudoName == null) {
- fPseudoName = new ArrayList();
- }
- fPseudoName.add(cls);
- addToBuf(":");//$NON-NLS-1$
- addToBuf(cls);
- fCachedString = null;
- }
-
- /**
- *
- */
- private void addToBuf(String str) {
- if (fStringBuf == null) {
- fStringBuf = new StringBuffer();
- }
- fStringBuf.append(str);
- }
-
- /**
- * @return boolean
- * @param obj
- * java.lang.Object
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
-
- if (obj == null || this.getClass() != obj.getClass())
- return false;
-
- CSSSimpleSelector foreign = (CSSSimpleSelector) obj;
-
- if (getName().compareToIgnoreCase(foreign.getName()) != 0)
- return false;
-
- int i;
-
- // compare pseudo-classes / pseudo-elements
- if (getNumOfPseudoNames() != foreign.getNumOfPseudoNames())
- return false;
- for (i = 0; i < getNumOfPseudoNames(); i++) {
- if (getPseudoName(i).compareToIgnoreCase(foreign.getPseudoName(i)) != 0)
- return false;
- }
-
- // compare classes
- if (getNumOfClasses() != foreign.getNumOfClasses())
- return false;
- for (i = 0; i < getNumOfClasses(); i++) {
- if (getClass(i).compareToIgnoreCase(foreign.getClass(i)) != 0)
- return false;
- }
-
- // compare IDs
- if (getNumOfIDs() != foreign.getNumOfIDs())
- return false;
- for (i = 0; i < getNumOfIDs(); i++) {
- if (getID(i).compareToIgnoreCase(foreign.getID(i)) != 0)
- return false;
- }
-
- // compare Attributes
- if (getNumOfAttributes() != foreign.getNumOfAttributes())
- return false;
- for (i = 0; i < getNumOfAttributes(); i++) {
- if (getAttribute(i).compareToIgnoreCase(foreign.getAttribute(i)) != 0)
- return false;
- }
- return true;
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getAttribute(int index) {
- if (fAttribute != null && 0 <= index && index < fAttribute.size()) {
- return (String) fAttribute.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getClass(int index) {
- if (fClass != null && 0 <= index && index < fClass.size()) {
- return (String) fClass.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getID(int index) {
- if (fID != null && 0 <= index && index < fID.size()) {
- return (String) fID.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return int
- */
- public int getItemType() {
- return SIMPLE;
- }
-
- /**
- * @return java.lang.String
- */
- public String getName() {
- return (fName != null) ? fName : "";//$NON-NLS-1$
- }
-
- /**
- * @return boolean
- */
- public int getNumOfAttributes() {
- return (fAttribute != null) ? fAttribute.size() : 0;
- }
-
- /**
- * @return boolean
- */
- public int getNumOfClasses() {
- return (fClass != null) ? fClass.size() : 0;
- }
-
- /**
- * @return boolean
- */
- public int getNumOfIDs() {
- return (fID != null) ? fID.size() : 0;
- }
-
- /**
- * @return boolean
- */
- public int getNumOfPseudoNames() {
- return (fPseudoName != null) ? fPseudoName.size() : 0;
- }
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- public String getPseudoName(int index) {
- if (fPseudoName != null && 0 <= index && index < fPseudoName.size()) {
- return (String) fPseudoName.get(index);
- }
- else {
- return "";//$NON-NLS-1$
- }
- }
-
- /**
- * @return java.lang.String
- */
- public String getString() {
- if (fCachedString == null) {
- StringBuffer buf = new StringBuffer(getName());
- if (fStringBuf != null) {
- buf.append(fStringBuf.toString());
- }
- fCachedString = buf.toString();
- }
- return fCachedString;
- }
-
- /**
- * @return boolean
- */
- public boolean isUniversal() {
- return (fName == null || fName.equals("*"));//$NON-NLS-1$
- }
-
- /**
- *
- */
- void setName(String name) {
- fName = name;
- fCachedString = null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java
deleted file mode 100644
index 07bf389b2b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStructuredDocumentRegionContainer.java
+++ /dev/null
@@ -1,229 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-
-/**
- * currently public but may be made default access protected in future.
- */
-public abstract class CSSStructuredDocumentRegionContainer extends CSSNodeImpl {
-
- private IStructuredDocumentRegion firstStructuredDocumentRegion = null;
- private IStructuredDocumentRegion lastStructuredDocumentRegion = null;
-
- /**
- * CSSContainer constructor comment.
- * currently public but may be made default access protected in future.
- */
- public CSSStructuredDocumentRegionContainer() {
- super();
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public CSSStructuredDocumentRegionContainer(CSSStructuredDocumentRegionContainer that) {
- super(that);
- }
-
- /**
- * @return java.lang.String
- */
- public String getCssText() {
- if (getFirstStructuredDocumentRegion() == null)
- return generateSource();
-
- StringBuffer str = new StringBuffer(getFirstStructuredDocumentRegion().getText());
- IStructuredDocumentRegion node = getFirstStructuredDocumentRegion();
-
- while (node != getLastStructuredDocumentRegion()) {
- node = node.getNext();
- str.append(node.getText());
- }
-
- return str.toString();
- }
-
- /**
- * @return int
- */
- public int getEndOffset() {
- IStructuredDocumentRegion flatNode = getLastStructuredDocumentRegion();
- if (flatNode != null)
- return flatNode.getEnd();
- return -1;
- }
-
- IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
- return firstStructuredDocumentRegion;
- }
-
- IStructuredDocumentRegion getStructuredDocumentRegion(int index) {
- IStructuredDocumentRegion node = firstStructuredDocumentRegion;
- for (int i = index; i > 0; i--) {
- if (node == null)
- return null;
- node = node.getNext();
- }
- return node;
- }
-
- /**
- * @return int
- */
- int getStructuredDocumentRegionCount() {
- if (firstStructuredDocumentRegion == null)
- return 0;
-
- IStructuredDocumentRegion node = firstStructuredDocumentRegion;
- int i = 0;
- for (; node != null; i++)
- node = node.getNext();
- return i;
- }
-
- IStructuredDocumentRegion getLastStructuredDocumentRegion() {
- return lastStructuredDocumentRegion;
- }
-
- /**
- * @return int
- */
- public int getStartOffset() {
- IStructuredDocumentRegion flatNode = getFirstStructuredDocumentRegion();
- if (flatNode != null)
- return flatNode.getStart();
- return -1;
- }
-
- boolean includeRangeStructuredDocumentRegion(IStructuredDocumentRegion first, IStructuredDocumentRegion last) {
- boolean bModified = false;
-
- // validate range of parameters
- if (first != null && last != null) {
- if (first.getStart() > last.getStart()) {
- IStructuredDocumentRegion node = first;
- first = last;
- last = node;
- }
- }
-
- // validate mine
- boolean b = validateRange();
- bModified = b || bModified;
-
- if (first != null) {
- if (getFirstStructuredDocumentRegion() == null || getFirstStructuredDocumentRegion().getStart() > first.getStart()) {
- setFirstStructuredDocumentRegion(first);
- bModified = true;
- }
- }
-
- if (last != null) {
- if (getLastStructuredDocumentRegion() == null || getLastStructuredDocumentRegion().getStart() < last.getStart()) {
- setLastStructuredDocumentRegion(last);
- bModified = true;
- }
- }
-
- // re-validate
- if (bModified)
- validateRange();
-
- return bModified;
- }
-
- /**
- *
- */
- public boolean propagateRangeStructuredDocumentRegion() {
- boolean bModified = false;
-
- CSSStructuredDocumentRegionContainer parent = (CSSStructuredDocumentRegionContainer) getParentNode();
- if (parent == null)
- return bModified;
-
- boolean b = parent.includeRangeStructuredDocumentRegion(getFirstStructuredDocumentRegion(), getLastStructuredDocumentRegion());
- bModified = b || bModified;
-
- if (b)
- parent.propagateRangeStructuredDocumentRegion();
- // else need not update range of ancestors
-
- return bModified;
- }
-
- /**
- * @param cssText
- * java.lang.String
- */
- public void setCssText(String cssText) {
- if (firstStructuredDocumentRegion != null) {
- getOwnerDocument().getModel().getStructuredDocument().replaceText(this, getStartOffset(), getEndOffset() - getStartOffset(), cssText);
- }
- else
- super.setCssText(cssText);
- }
-
- IStructuredDocumentRegion setFirstStructuredDocumentRegion(IStructuredDocumentRegion node) {
- firstStructuredDocumentRegion = node;
- return node;
- }
-
- IStructuredDocumentRegion setLastStructuredDocumentRegion(IStructuredDocumentRegion node) {
- lastStructuredDocumentRegion = node;
- return node;
- }
-
- public void setRangeStructuredDocumentRegion(IStructuredDocumentRegion firstNode, IStructuredDocumentRegion lastNode) {
- if (firstNode != null)
- setFirstStructuredDocumentRegion(firstNode);
- if (lastNode != null)
- setLastStructuredDocumentRegion(lastNode);
-
- if (firstNode == null && lastNode == null) {
- setFirstStructuredDocumentRegion(null);
- setLastStructuredDocumentRegion(null);
- }
- else { // range validation
- validateRange();
- }
- }
-
- /**
- * @return boolean
- */
- private boolean validateRange() {
- boolean bModified = false;
-
- if (firstStructuredDocumentRegion != null || lastStructuredDocumentRegion != null) {
- if (this.firstStructuredDocumentRegion == null) {
- this.firstStructuredDocumentRegion = this.lastStructuredDocumentRegion;
- bModified = true;
- }
- else if (this.lastStructuredDocumentRegion == null) {
- this.lastStructuredDocumentRegion = this.firstStructuredDocumentRegion;
- bModified = true;
- }
- else if (this.firstStructuredDocumentRegion.getStart() > this.lastStructuredDocumentRegion.getStart()) {
- // need to swap first for last
- IStructuredDocumentRegion node = firstStructuredDocumentRegion;
- firstStructuredDocumentRegion = lastStructuredDocumentRegion;
- lastStructuredDocumentRegion = node;
- bModified = true;
- }
- }
-
- return bModified;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
deleted file mode 100644
index 94a5cc60b3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclItemImpl.java
+++ /dev/null
@@ -1,272 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceGenerator;
-import org.eclipse.wst.css.core.internal.formatter.StyleDeclItemFormatter;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-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.ITextRegionList;
-import org.eclipse.wst.sse.core.internal.text.TextRegionListImpl;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- *
- */
-class CSSStyleDeclItemImpl extends CSSStructuredDocumentRegionContainer implements ICSSStyleDeclItem {
-
- private java.lang.String fPropertyName;
-
- /**
- * CSSStyleDeclItemImpl constructor comment.
- *
- */
- CSSStyleDeclItemImpl(CSSStyleDeclItemImpl that) {
- super(that);
- this.fPropertyName = that.fPropertyName;
- }
-
- /**
- * CSSStyleDeclItemImpl constructor comment.
- */
- CSSStyleDeclItemImpl(String propertyName) {
- super();
- this.fPropertyName = propertyName;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value) throws DOMException {
- return insertValueBefore(value, null);
- }
-
- /**
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleDeclItemImpl cloned = new CSSStyleDeclItemImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String generateValueSource() {
- CSSSourceGenerator formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(this);
- if (formatter != null && formatter instanceof StyleDeclItemFormatter)
- return ((StyleDeclItemFormatter) formatter).formatValue(this).toString();
- else
- return "";//$NON-NLS-1$
- }
-
- /**
- * @return org.w3c.dom.css.CSSValue
- */
- public CSSValue getCSSValue() {
- int nValue = getLength();
- if (nValue <= 0)
- return null;
- else if (nValue == 1)
- return item(0);
- else
- return this;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getCSSValueText() {
- if (getFirstChild() == null)
- return "";//$NON-NLS-1$
- // check whether children has flatnodes
- ICSSNode child = getFirstChild();
- while (child != null) {
- if (((IndexedRegion) child).getEndOffset() <= 0)
- return generateValueSource();
- child = child.getNextSibling();
- }
-
- IStructuredDocumentRegion node = getFirstStructuredDocumentRegion();
- int start = ((IndexedRegion) getFirstChild()).getStartOffset() - node.getStartOffset();
- int end = ((IndexedRegion) getLastChild()).getEndOffset() - node.getStartOffset();
- return node.getText().substring(start, end);
- }
-
- /**
- * @return short
- */
- public short getCssValueType() {
- return CSS_VALUE_LIST;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSPrimitiveValueImpl)
- i++;
- }
- return i;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLEDECLITEM_NODE;
- }
-
- /**
- * @return java.lang.String
- */
- public java.lang.String getPriority() {
- return getAttribute(IMPORTANT);
- }
-
- /**
- * @return java.lang.String
- */
- public String getPropertyName() {
- String name = fPropertyName.trim();
- return PropCMProperty.getInstanceOf(name) != null ? fPropertyName.trim().toLowerCase() : name;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param newValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @param refValue
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue insertValueBefore(ICSSPrimitiveValue newValue, ICSSPrimitiveValue refValue) {
- ICSSNode node = insertBefore((CSSNodeImpl) newValue, (CSSNodeImpl) refValue);
- return (ICSSPrimitiveValue) node;
- }
-
- /**
- * @return org.w3c.dom.css.CSSValue
- * @param index
- * int
- */
- public CSSValue item(int index) {
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSPrimitiveValueImpl) {
- if (i++ == index)
- return (CSSValue) node;
- }
- }
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value) throws DOMException {
- ICSSNode node = removeChild((CSSNodeImpl) value);
- return (ICSSPrimitiveValue) node;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param newValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @param oldValue
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- public ICSSPrimitiveValue replaceValue(ICSSPrimitiveValue newValue, ICSSPrimitiveValue oldValue) throws DOMException {
- if (oldValue == null)
- return newValue;
- if (newValue != null)
- insertValueBefore(newValue, oldValue);
- return removeValue(oldValue);
- }
-
- /**
- * @param value
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setCssValueText(String value) throws DOMException {
- ICSSNode child = getFirstChild();
- while (child != null) {
- ICSSNode next = child.getNextSibling();
- if (child instanceof ICSSPrimitiveValue) {
- removeChild((CSSNodeImpl) child);
- }
- child = next;
- }
- setCssValueTextCore(value);
- }
-
- private void setCssValueTextCore(String value) throws DOMException {
- // use temporary document
- synchronized (CSSStyleDeclarationImpl.class) {
- if (sharedStructuredDocument == null) {
- IDocumentLoader loader = new CSSDocumentLoader();
- sharedStructuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
- ((CSSSourceParser) sharedStructuredDocument.getParser()).setParserMode(CSSSourceParser.MODE_DECLARATION_VALUE);
-
- }
- sharedStructuredDocument.set(value);
- IStructuredDocumentRegion node = sharedStructuredDocument.getFirstStructuredDocumentRegion();
-
- if (node == null) {
- return;
- }
- if (node.getNext() != null) {
- throw new DOMException(DOMException.INVALID_MODIFICATION_ERR, "");//$NON-NLS-1$
- }
-
- CSSDeclarationItemParser itemParser = new CSSDeclarationItemParser(getOwnerDocument());
- itemParser.setStructuredDocumentTemporary(true);
- // make a copy of nodelist because setupValues will destroy list
- ITextRegionList nodeList = new TextRegionListImpl(node.getRegions());
- itemParser.setupValues(this, node, nodeList);
- }
- }
-
- private static IStructuredDocument sharedStructuredDocument;
-
- /**
- * @param newPriority
- * java.lang.String
- */
- public void setPriority(java.lang.String newPriority) throws DOMException {
- setAttribute(IMPORTANT, newPriority);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java
deleted file mode 100644
index 1d56480f10..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationFactoryContext.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-
-public abstract class CSSStyleDeclarationFactoryContext {
-
- protected ICSSDocument fOwnerDocument = null;
-
- /**
- *
- */
- protected void cloneChildNodes(ICSSNode src, ICSSNode dest) {
- if (fOwnerDocument == null) {
- return;
- }
- if (!(dest instanceof CSSNodeImpl)) {
- return;
- }
-
- CSSNodeImpl container = (CSSNodeImpl) dest;
- container.removeChildNodes();
-
- for (ICSSNode child = src.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof CSSStyleDeclItemImpl) {
- // extract shorthand property ..
- // --> Temp
- ICSSNode cloned = child.cloneNode(false);
- if (cloned instanceof CSSNodeImpl) {
- ((CSSNodeImpl) cloned).setOwnerDocument(fOwnerDocument);
- container.appendChild((CSSNodeImpl) cloned);
- cloneChildNodes(child, cloned);
- }
- // <-- Temp
- }
- else {
- ICSSNode cloned = child.cloneNode(false);
- if (cloned instanceof CSSNodeImpl) {
- ((CSSNodeImpl) cloned).setOwnerDocument(fOwnerDocument);
- container.appendChild((CSSNodeImpl) cloned);
- cloneChildNodes(child, cloned);
- }
- }
- }
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
- */
- public ICSSStyleDeclaration createStyleDeclaration() {
- CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(true);
- decl.setOwnerDocument(decl);
- return decl;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java
deleted file mode 100644
index 90aed46160..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleDeclarationImpl.java
+++ /dev/null
@@ -1,272 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- *
- */
-class CSSStyleDeclarationImpl extends CSSDocumentImpl implements ICSSStyleDeclaration {
-
- private boolean fIsDocument;
-
- CSSStyleDeclarationImpl(CSSStyleDeclarationImpl that) {
- super(that);
- this.fIsDocument = that.fIsDocument;
- if (fIsDocument) {
- setOwnerDocument(this);
- }
- }
-
- CSSStyleDeclarationImpl(boolean isDocument) {
- super();
- fIsDocument = isDocument;
- if (fIsDocument) {
- setOwnerDocument(this);
- }
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleDeclarationImpl cloned = new CSSStyleDeclarationImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- public ICSSStyleDeclItem getDeclItemNode(String propertyName) {
- ICSSNode node = getLastChild();
- propertyName = propertyName.trim();
- while (node != null) {
- if (node instanceof CSSStyleDeclItemImpl) {
- ICSSStyleDeclItem item = (ICSSStyleDeclItem) node;
- if (propertyName.compareToIgnoreCase(item.getPropertyName().trim()) == 0)
- return item;
- }
- node = node.getPreviousSibling();
- }
- return null;
- }
-
- /**
- * @return int
- */
- public int getLength() {
- int i = 0;
- ICSSNode node = getFirstChild();
- while (node != null) {
- if (node instanceof CSSStyleDeclItemImpl)
- i++;
- node = node.getNextSibling();
- }
- return i;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLEDECLARATION_NODE;
- }
-
- /**
- * The CSS rule that contains this declaration block or <code>null</code>
- * if this <code>CSSStyleDeclaration</code> is not attached to a
- * <code>CSSRule</code>.
- */
- public CSSRule getParentRule() {
- ICSSNode parent = getParentNode();
- if (parent instanceof CSSRule)
- return (CSSRule) parent;
- return null;
- }
-
- /**
- * Used to retrieve the object representation of the value of a CSS
- * property if it has been explicitly set within this declaration block.
- * This method returns <code>null</code> if the property is a shorthand
- * property. Shorthand property values can only be accessed and modified
- * as strings, using the <code>getPropertyValue</code> and
- * <code>setProperty</code> methods.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return Returns the value of the property if it has been explicitly set
- * for this declaration block. Returns <code>null</code> if the
- * property has not been set.
- */
- public CSSValue getPropertyCSSValue(String propertyName) {
- ICSSStyleDeclItem item = getDeclItemNode(propertyName);
- if (item != null)
- return item.getCSSValue();
- return null;
- }
-
- /**
- * Used to retrieve the priority of a CSS property (e.g. the
- * <code>"important"</code> qualifier) if the property has been
- * explicitly set in this declaration block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return A string representing the priority (e.g.
- * <code>"important"</code>) if one exists. The empty string if
- * none exists.
- */
- public String getPropertyPriority(String propertyName) {
- ICSSStyleDeclItem item = getDeclItemNode(propertyName);
- if (item != null)
- return item.getPriority();
- return null;
- }
-
- /**
- * Used to retrieve the value of a CSS property if it has been explicitly
- * set within this declaration block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return Returns the value of the property if it has been explicitly set
- * for this declaration block. Returns the empty string if the
- * property has not been set.
- */
- public String getPropertyValue(String propertyName) {
- CSSValue value = getPropertyCSSValue(propertyName);
- if (value != null)
- return ((ICSSValue) value).getCSSValueText();
- return null;
- }
-
- /**
- * @return boolean
- */
- public boolean isDocument() {
- return fIsDocument;
- }
-
- /**
- * Used to retrieve the properties that have been explicitly set in this
- * declaration block. The order of the properties retrieved using this
- * method does not have to be the order in which they were set. This
- * method can be used to iterate over all properties in this declaration
- * block.
- *
- * @param index
- * Index of the property name to retrieve.
- * @return The name of the property at this ordinal position. The empty
- * string if no property exists at this position.
- */
- public String item(int index) {
- if (index < 0)
- return null;
-
- int i = 0;
- ICSSNode node = getFirstChild();
- while (node != null) {
- if (node instanceof CSSStyleDeclItemImpl) {
- if (i != index)
- i++;
- else {
- CSSStyleDeclItemImpl item = (CSSStyleDeclItemImpl) node;
- return item.getPropertyName();
- }
- }
- node = node.getNextSibling();
- }
- return null;
- }
-
- public ICSSStyleDeclItem removeDeclItemNode(ICSSStyleDeclItem oldDecl) throws DOMException {
- return (ICSSStyleDeclItem) removeChild((CSSNodeImpl) oldDecl);
- }
-
- /**
- * Used to remove a CSS property if it has been explicitly set within this
- * declaration block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @return Returns the value of the property if it has been explicitly set
- * for this declaration block. Returns the empty string if the
- * property has not been set or the property name does not
- * correspond to a known CSS property.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
- * is readonly or the property is readonly.
- */
- public String removeProperty(String propertyName) throws DOMException {
- ICSSStyleDeclItem item = getDeclItemNode(propertyName);
- if (item != null) {
- removeChild((CSSNodeImpl) item);
- return item.getCssText();
- }
- return null;
- }
-
- public ICSSStyleDeclItem setDeclItemNode(ICSSStyleDeclItem newDecl) throws DOMException {
- if (newDecl == null)
- return null;
-
- ICSSStyleDeclItem item = getDeclItemNode(newDecl.getPropertyName());
- if (item != null)
- return (ICSSStyleDeclItem) replaceChild((CSSNodeImpl) newDecl, (CSSNodeImpl) item);
- else
- return (ICSSStyleDeclItem) appendChild((CSSNodeImpl) newDecl);
- }
-
- /**
- * Used to set a property value and priority within this declaration
- * block.
- *
- * @param propertyName
- * The name of the CSS property. See the CSS property index.
- * @param value
- * The new value of the property.
- * @param priority
- * The new priority of the property (e.g.
- * <code>"important"</code>).
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified value has a syntax
- * error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
- * is readonly or the property is readonly.
- */
- public void setProperty(String propertyName, String value, String priority) throws DOMException {
- if (propertyName.equals("")) //$NON-NLS-1$
- throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); //$NON-NLS-1$
-
- // You can use this only if CSSValue.setCssText() is implemented
- CSSStyleDeclItemImpl item = (CSSStyleDeclItemImpl) getDeclItemNode(propertyName);
- if (item == null) {
- item = (CSSStyleDeclItemImpl) getOwnerDocument().createCSSStyleDeclItem(propertyName);
- appendChild(item);
- }
-
- // ICSSNode next = item.getNextSibling();
- // removeChild(item);
-
- item.setCssValueText(value);
- item.setPriority(priority);
-
- // insertBefore(item, (CSSNodeImpl)next);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java
deleted file mode 100644
index 3366f09e5a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleRuleImpl.java
+++ /dev/null
@@ -1,98 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.w3c.dom.DOMException;
-
-
-/**
- *
- */
-class CSSStyleRuleImpl extends CSSRuleDeclContainer implements ICSSStyleRule {
-
- ICSSSelectorList fSelectorList = new CSSSelectorListImpl(null);
-
- /**
- *
- */
- CSSStyleRuleImpl() {
- super();
- }
-
- CSSStyleRuleImpl(CSSStyleRuleImpl that) {
- super(that);
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleRuleImpl cloned = new CSSStyleRuleImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return java.lang.String
- */
- String extractPreString() {
- return getSelectorText();
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLERULE_NODE;
- }
-
- public ICSSSelectorList getSelectors() {
- return fSelectorList;
- }
-
- /**
- * The textual representation of the selector for the rule set. The
- * implementation may have stripped out insignificant whitespace while
- * parsing the selector.
- *
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified CSS string value has
- * a syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is
- * readonly.
- */
- public String getSelectorText() {
- return getAttribute(SELECTOR);
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return STYLE_RULE;
- }
-
- /**
- *
- */
- public void setSelectorText(String selectorText) throws DOMException {
- setAttribute(SELECTOR, selectorText);
- fSelectorList = new CSSSelectorListImpl(selectorText);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
deleted file mode 100644
index ec31ff02d7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSStyleSheetImpl.java
+++ /dev/null
@@ -1,612 +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.css.core.internal.document;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.CSSCoreMessages;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-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.ICSSPageRule;
-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.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.ImportRuleCollector;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.util.Assert;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- *
- */
-class CSSStyleSheetImpl extends CSSDocumentImpl implements ICSSStyleSheet {
-
-
- class InternalNodeList implements NodeList {
-
- Vector nodes = new Vector();
-
- public int getLength() {
- if (nodes == null)
- return 0;
- else
- return nodes.size();
- }
-
- public Node item(int i) {
- if (nodes == null)
- return null;
- if (i < 0 || nodes.size() <= i)
- return null;
- return (Node) nodes.get(i);
- }
- }
-
- class InternalStyleSheetList extends AbstractCSSNodeList implements StyleSheetList {
-
- public ICSSNode appendNode(ICSSNode node) {
- if (nodes == null || !nodes.contains(node))
- return super.appendNode(node);
- else
- return node;
- }
-
- public StyleSheet item(int i) {
- return (StyleSheet) itemImpl(i);
- }
- }
-
- private boolean fDisabled = false;
-
- /**
- *
- */
- CSSStyleSheetImpl() {
- super();
- setOwnerDocument(this);
- }
-
- CSSStyleSheetImpl(CSSStyleSheetImpl that) {
- super(that);
- setOwnerDocument(this);
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule appendRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) appendChild((CSSNodeImpl) rule);
- return ret;
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSStyleSheetImpl cloned = new CSSStyleSheetImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * @return org.w3c.dom.css.CSSCharsetRule
- */
- public ICSSCharsetRule createCSSCharsetRule() {
- CSSCharsetRuleImpl rule = new CSSCharsetRuleImpl();
- rule.setOwnerDocument(this);
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSFontFaceRule
- */
- public CSSFontFaceRule createCSSFontFaceRule() {
- CSSFontFaceRuleImpl rule = new CSSFontFaceRuleImpl();
- CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
- rule.appendChild(style);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSImportRule
- */
- public ICSSImportRule createCSSImportRule() {
- CSSImportRuleImpl rule = new CSSImportRuleImpl();
- MediaListImpl media = (MediaListImpl) createMediaList();
-
- rule.appendChild(media);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.ICSSMediaRule
- */
- public ICSSMediaRule createCSSMediaRule() {
- CSSMediaRuleImpl rule = new CSSMediaRuleImpl();
- MediaListImpl media = (MediaListImpl) createMediaList();
-
- rule.insertBefore(media, (CSSNodeImpl) rule.getFirstChild()); // media
- // must
- // be
- // the
- // top
- // of
- // children
- // list
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSPageRule
- */
- public ICSSPageRule createCSSPageRule() {
- CSSPageRuleImpl rule = new CSSPageRuleImpl();
- CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
- rule.appendChild(style);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * java.lang.String
- */
- public CSSRule createCSSRule(String rule) {
- CSSDocumentLoader loader = new CSSDocumentLoader();
- IStructuredDocument structuredDocument = (IStructuredDocument) loader.createNewStructuredDocument();
- structuredDocument.set(rule);
-
- //CSSModelParser modelParser = new CSSModelParser((CSSDocumentImpl) getOwnerDocument());
- CSSModelParser modelParser = new CSSModelParser(getOwnerDocument());
- return modelParser.createCSSRule(structuredDocument.getRegionList());
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- public ICSSStyleDeclaration createCSSStyleDeclaration() {
- CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(false);
- decl.setOwnerDocument(this);
-
- return decl;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleRule
- */
- public ICSSStyleRule createCSSStyleRule() {
- CSSStyleRuleImpl rule = new CSSStyleRuleImpl();
- CSSStyleDeclarationImpl style = (CSSStyleDeclarationImpl) createCSSStyleDeclaration();
-
- rule.appendChild(style);
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.css.CSSUnknownRule
- */
- public CSSUnknownRule createCSSUnknownRule() {
- CSSUnknownRuleImpl rule = new CSSUnknownRuleImpl();
- rule.setOwnerDocument(this);
-
- return rule;
- }
-
- /**
- * @return org.w3c.dom.stylesheets.MediaList
- */
- public MediaList createMediaList() {
- MediaListImpl media = new MediaListImpl();
- media.setOwnerDocument(this);
-
- return media;
- }
-
- /**
- * Used to delete a rule from the style sheet.
- *
- * @param index
- * The index within the style sheet's rule list of the rule to
- * remove.
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not
- * correspond to a rule in the style sheet's rule list.
- * <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet
- * is readonly.
- */
- public void deleteRule(int index) throws DOMException {
- CSSNodeImpl node = getIndexedRule(index);
- if (node != null)
- removeChild(node);
- }
-
- /**
- * The list of all CSS rules contained within the style sheet. This
- * includes both rule sets and at-rules.
- */
- public CSSRuleList getCssRules() {
- CSSRuleListImpl list = new CSSRuleListImpl();
-
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule) {
- list.appendNode(node);
- }
- }
-
- return list;
- }
-
- /**
- * <code>false</code> if the style sheet is applied to the document.
- * <code>true</code> if it is not. Modifying this attribute may cause a
- * new resolution of style for the document. A stylesheet only applies if
- * both an appropriate medium definition is present and the disabled
- * attribute is false. So, if the media doesn't apply to the current user
- * agent, the <code>disabled</code> attribute is ignored.
- */
- public boolean getDisabled() {
- return fDisabled;
- }
-
- /**
- * If the style sheet is a linked style sheet, the value of its attribute
- * is its location. For inline style sheets, the value of this attribute
- * is <code>null</code>. See the href attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the href pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getHref() {
- ICSSModel model = getModel();
- if (model != null && model.getStyleSheetType() == ICSSModel.EXTERNAL) {
- return model.getBaseLocation();
- /*
- * Object id = model.getId(); if (id != null) { if (id instanceof
- * IResource) { // TODO: need to check whether this is correct or
- * not, later. return ((IResource)id).getFullPath().toString(); }
- * return id.toString(); }
- */}
- return null;
- }
-
- CSSRuleImpl getIndexedRule(int index) {
- if (index < 0)
- return null;
-
- int i = 0;
- for (ICSSNode node = getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node instanceof CSSRule) {
- if (i++ == index)
- return (CSSRuleImpl) node;
- }
- }
- return null;
- }
-
- /**
- * The intended destination media for style information. The media is
- * often specified in the <code>ownerNode</code>. If no media has been
- * specified, the <code>MediaList</code> will be empty. See the media
- * attribute definition for the <code>LINK</code> element in HTML 4.0,
- * and the media pseudo-attribute for the XML style sheet processing
- * instruction . Modifying the media list may cause a change to the
- * attribute <code>disabled</code>.
- */
- public MediaList getMedia() {
- return null;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return STYLESHEET_NODE;
- }
-
- /**
- * The node that associates this style sheet with the document. For HTML,
- * this may be the corresponding <code>LINK</code> or <code>STYLE</code>
- * element. For XML, it may be the linking processing instruction. For
- * style sheets that are included by other style sheets, the value of this
- * attribute is <code>null</code>.
- */
- public Node getOwnerNode() {
- // for <LINK> tag or <STYLE> tag
- ICSSModel model = getModel();
- if (model != null)
- return model.getOwnerDOMNode();
- return null;
- }
-
- /**
- * @return org.w3c.dom.NodeList
- */
- public org.w3c.dom.NodeList getOwnerNodes() {
- List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
- if (list == null)
- return null;
- InternalNodeList nodes = new InternalNodeList();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof IStyleSheetAdapter) {
- nodes.nodes.add(((IStyleSheetAdapter) obj).getElement());
- }
- }
- if (nodes.getLength() > 0)
- return nodes;
- else
- return null;
- }
-
- /**
- * @return org.w3c.dom.NodeList
- * @param doc
- * org.w3c.dom.Document
- */
- public NodeList getOwnerNodes(Document doc) {
- List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
- if (list == null)
- return null;
- InternalNodeList nodes = new InternalNodeList();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof IStyleSheetAdapter) {
- Element ele = ((IStyleSheetAdapter) obj).getElement();
- if (ele.getOwnerDocument() == doc)
- nodes.nodes.add(ele);
- }
- }
- if (nodes.getLength() > 0)
- return nodes;
- else
- return null;
- }
-
- /**
- * If this style sheet comes from an <code>@import</code> rule, the <code>ownerRule</code> attribute will
- * contain the <code>CSSImportRule</code>. In that case, the
- * <code>ownerNode</code> attribute in the
- * <code>StyleSheet</code> interface will be <code>null</code>.
- * If the style sheet comes from an element or a processing
- * instruction, the <code>ownerRule</code> attribute will be
- * <code>null</code> and the <code>ownerNode</code> attribute
- * will contain the <code>Node</code>.
- */
- public CSSRule getOwnerRule() {
- Assert.isTrue(false, CSSCoreMessages.You_cannot_use_CSSStyleShe_UI_); //$NON-NLS-1$ = "You cannot use CSSStyleSheet.getOwnerRule() because of many referencers of this rule\nPlease use getOnwerRules()"
- // for @import
- return null;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRuleList
- */
- public org.w3c.dom.css.CSSRuleList getOwnerRules() {
- StyleSheetList list = getParentStyleSheets();
- if (list == null)
- return null;
- CSSRuleListImpl ruleList = new CSSRuleListImpl();
- for (int i = 0; i < list.getLength(); i++) {
- ImportRuleCollector trav = new ImportRuleCollector(this);
- trav.apply((ICSSStyleSheet) list.item(i));
- ruleList.nodes.addAll(trav.getRules());
- }
- return ruleList;
- }
-
- /**
- * For style sheet languages that support the concept of style sheet
- * inclusion, this attribute represents the including style sheet, if one
- * exists. If the style sheet is a top-level style sheet, or the style
- * sheet language does not support inclusion, the value of this attribute
- * is <code>null</code>.
- */
- public StyleSheet getParentStyleSheet() {
- CSSRule owner = getOwnerRule();
- if (owner != null)
- return owner.getParentStyleSheet();
- return null;
- }
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheetList
- */
- public org.w3c.dom.stylesheets.StyleSheetList getParentStyleSheets() {
- List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
- if (list == null)
- return null;
- InternalStyleSheetList sheets = new InternalStyleSheetList();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj instanceof ICSSModel) {
- sheets.appendNode(((ICSSModel) obj).getDocument());
- }
- }
- if (sheets.getLength() > 0)
- return sheets;
- else
- return null;
- }
-
- /**
- * The advisory title. The title is often specified in the
- * <code>ownerNode</code>. See the title attribute definition for the
- * <code>LINK</code> element in HTML 4.0, and the title pseudo-attribute
- * for the XML style sheet processing instruction.
- */
- public String getTitle() {
- Node node = getOwnerNode();
- if (node instanceof Element) {
- return ((Element) node).getAttribute("TITLE");//$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * This specifies the style sheet language for this style sheet. The style
- * sheet language is specified as a content type (e.g. "text/css"). The
- * content type is often specified in the <code>ownerNode</code>. Also
- * see the type attribute definition for the <code>LINK</code> element
- * in HTML 4.0, and the type pseudo-attribute for the XML style sheet
- * processing instruction.
- */
- public String getType() {
- Node node = getOwnerNode();
- if (node instanceof Element) {
- return ((Element) node).getAttribute("TYPE");//$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Used to insert a new rule into the style sheet. The new rule now
- * becomes part of the cascade.
- *
- * @param rule
- * The parsable text representing the rule. For rule sets this
- * contains both the selector and the style declaration. For
- * at-rules, this specifies both the at-identifier and the rule
- * content.
- * @param index
- * The index within the style sheet's rule list of the rule
- * before which to insert the specified rule. If the specified
- * index is equal to the length of the style sheet's rule
- * collection, the rule will be added to the end of the style
- * sheet.
- * @return The index within the style sheet's rule collection of the newly
- * inserted rule.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be
- * inserted at the specified index e.g. if an
- * <code>@import</code> rule is inserted after a standard rule set or other
- * at-rule. <br>
- * INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly. <br>
- * SYNTAX_ERR: Raised if the specified rule has a syntax error and
- * is unparsable.
- */
- public int insertRule(String rule, int index) throws DOMException {
- int length = getCssRules().getLength();
- if (index < 0 || length < index)
- throw new DOMException(DOMException.INDEX_SIZE_ERR, "");//$NON-NLS-1$
-
- IStructuredDocument doc = getModel().getStructuredDocument();
- CSSRuleImpl refRule = (length != index) ? getIndexedRule(index) : null;
- int offset = (refRule != null) ? refRule.getStartOffset() : doc.getLength();
- doc.replaceText(this, offset, 0, rule);
-
- // insertBefore((CSSNodeImpl) createCSSRule(rule),refRule);
- return index;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newRule
- * org.w3c.dom.css.CSSRule
- * @param refRule
- * org.w3c.dom.css.CSSRule
- */
- public org.w3c.dom.css.CSSRule insertRuleBefore(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule refRule) throws org.w3c.dom.DOMException {
- if (newRule == null && refRule == null)
- return null;
-
- CSSRule ret = (CSSRule) insertBefore((CSSNodeImpl) newRule, (CSSNodeImpl) refRule);
- return ret;
- }
-
- /**
- * @return boolean
- */
- public boolean isDocument() {
- return true;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule removeRule(org.w3c.dom.css.CSSRule rule) throws org.w3c.dom.DOMException {
- if (rule == null)
- return null;
-
- CSSRule ret = (CSSRule) removeChild((CSSNodeImpl) rule);
- return ret;
- }
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newChild
- * org.w3c.dom.css.CSSRule
- * @param oldChild
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public org.w3c.dom.css.CSSRule replaceRule(org.w3c.dom.css.CSSRule newRule, org.w3c.dom.css.CSSRule oldRule) throws org.w3c.dom.DOMException {
- if (newRule == null && oldRule == null)
- return null;
-
- CSSRule ret = (CSSRule) replaceChild((CSSNodeImpl) newRule, (CSSNodeImpl) oldRule);
- return ret;
- }
-
- /**
- * setDisabled method comment.
- */
- public void setDisabled(boolean disabled) {
- this.fDisabled = disabled;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java
deleted file mode 100644
index a93ed7527d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSUnknownRuleImpl.java
+++ /dev/null
@@ -1,70 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSUnknownRule;
-
-
-/**
- *
- */
-class CSSUnknownRuleImpl extends CSSRuleImpl implements CSSUnknownRule {
-
- // TODO: This field is never read
- String fCssText = null;
-
- /**
- *
- */
- CSSUnknownRuleImpl() {
- super();
- }
-
- CSSUnknownRuleImpl(CSSUnknownRuleImpl that) {
- super(that);
- }
-
- public ICSSNode cloneNode(boolean deep) {
- CSSUnknownRuleImpl cloned = new CSSUnknownRuleImpl(this);
-
- return cloned;
- }
-
- /**
- * @return short
- */
- public short getNodeType() {
- return UNKNOWNRULE_NODE;
- }
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from an
- * instance of the <code>CSSRule</code> interface to the specific
- * derived interface implied by the <code>type</code>.
- */
- public short getType() {
- return UNKNOWN_RULE;
- }
-
- /**
- * @param cssText
- * java.lang.String
- */
- public void setCssText(String cssText) {
- this.fCssText = cssText;
-
- super.setCssText(cssText);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java
deleted file mode 100644
index 2b921f7bec..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CounterImpl.java
+++ /dev/null
@@ -1,124 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICounter;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.Counter;
-
-
-/**
- *
- */
-class CounterImpl extends CSSPrimitiveContainer implements ICounter {
-
- /**
- *
- */
- CounterImpl() {
- super(CSS_COUNTER);
- }
-
- CounterImpl(CounterImpl that) {
- super(that);
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- CounterImpl cloned = new CounterImpl(this);
-
- if (deep)
- cloneChildNodes(cloned, deep);
-
- return cloned;
- }
-
- /**
- * This method is used to get the Counter value. If this CSS value doesn't
- * contain a counter value, a <code>DOMException</code> is raised.
- * Modification to the corresponding style property can be achieved using
- * the <code>Counter</code> interface.
- *
- * @return The Counter value.
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raised if the CSS value doesn't
- * contain a Counter value (e.g. this is not
- * <code>CSS_COUNTER</code>).
- */
- public Counter getCounterValue() throws DOMException {
- return this;
- }
-
- /**
- * This attribute is used for the identifier of the counter.
- */
- public String getIdentifier() {
- return getAttribute(IDENTIFIER);
- }
-
- /**
- * This attribute is used for the style of the list.
- */
- public String getListStyle() {
- return getAttribute(LISTSTYLE);
- }
-
- /**
- * This attribute is used for the separator of the nested counters.
- */
- public String getSeparator() {
- return getAttribute(SEPARATOR);
- }
-
- /**
- *
- */
- protected void initPrimitives() {
- return;
- }
-
- /**
- * @param identifier
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setIdentifier(String identifier) throws DOMException {
- setAttribute(IDENTIFIER, identifier);
- }
-
- /**
- * @param listStyle
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setListStyle(String listStyle) throws DOMException {
- setAttribute(LISTSTYLE, listStyle);
- }
-
- /**
- * @param Separator
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public void setSeparator(String Separator) throws org.w3c.dom.DOMException {
- setAttribute(SEPARATOR, Separator);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java
deleted file mode 100644
index fb7907f815..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/DOMCSSImpl.java
+++ /dev/null
@@ -1,49 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleSheet;
-
-
-/**
- *
- */
-public class DOMCSSImpl {
-
- /**
- * DOMCSSImpl constructor comment.
- */
- public DOMCSSImpl() {
- super();
- }
-
- public static ICSSStyleDeclaration createCSSStyleDeclaration() throws org.w3c.dom.DOMException {
- CSSStyleDeclarationImpl document = new CSSStyleDeclarationImpl(true);
-
- return document;
- }
-
- /**
- * @return org.w3c.dom.css.CSSStyleSheet
- * @param title
- * java.lang.String
- * @param media
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public static CSSStyleSheet createCSSStyleSheet(String title, String media) throws org.w3c.dom.DOMException {
- return new CSSStyleSheetImpl();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java
deleted file mode 100644
index a84b3b1a02..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/MediaListImpl.java
+++ /dev/null
@@ -1,155 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-class MediaListImpl extends CSSRegionContainer implements MediaList {
-
- int mediumCounter;
-
- /**
- * MediaListImpl constructor comment.
- */
- MediaListImpl() {
- super();
- }
-
- /**
- * MediaListImpl constructor comment.
- */
- MediaListImpl(MediaListImpl that) {
- super(that);
- }
-
- /**
- * Adds the medium <code>newMedium</code> to the end of the list. If the
- * <code>newMedium</code> is already used, it is first removed.
- *
- * @param newMediumThe
- * new medium to add.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: If the medium contains characters
- * that are invalid in the underlying style language. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is
- * readonly.
- */
- public void appendMedium(String newMedium) throws DOMException {
- if (newMedium == null)
- return;
-
- CSSNodeListImpl m = getMedia();
- for (int i = 0; i != m.getLength(); i++) {
- if (newMedium.equals(item(i)))
- return;
- }
-
- setAttribute("medium" + Integer.toString(mediumCounter++), newMedium);//$NON-NLS-1$
- }
-
- public ICSSNode cloneNode(boolean deep) {
- MediaListImpl cloned = new MediaListImpl(this);
- return cloned;
- }
-
- /**
- * Deletes the medium indicated by <code>oldMedium</code> from the list.
- *
- * @param oldMediumThe
- * medium to delete in the media list.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is
- * readonly. <br>
- * NOT_FOUND_ERR: Raised if <code>oldMedium</code> is not
- * in the list.
- */
- public void deleteMedium(String oldMedium) throws DOMException {
- for (int i = 0; i != getLength(); i++) {
- if (oldMedium.equals(item(i))) {
- removeAttributeNode((CSSAttrImpl) fAttrs.item(i));
- }
- }
- }
-
- /**
- * The number of media in the list. The range of valid media is
- * <code>0</code> to <code>length-1</code> inclusive.
- */
- public int getLength() {
- return getMedia().getLength();
- }
-
- /**
- * @return CSSNodeListImpl
- */
- CSSNodeListImpl getMedia() {
- if (fAttrs == null)
- fAttrs = new CSSNamedNodeMapImpl();
- return fAttrs;
- }
-
- /**
- * The parsable textual representation of the media list. This is a
- * comma-separated list of media.
- *
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified string value has a
- * syntax error and is unparsable. <br>
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media list
- * is readonly.
- */
- public String getMediaText() {
- return getCssText();
- }
-
- /**
- * Insert the method's description here. Creation date: (2001/01/17
- * 18:50:29)
- *
- * @return short
- */
- public short getNodeType() {
- return MEDIALIST_NODE;
- }
-
- /**
- * Returns the <code>index</code> th in the list. If <code>index</code>
- * is greater than or equal to the number of media in the list, this
- * returns <code>null</code>.
- *
- * @param index
- * Index into the collection.
- * @return The medium at the <code>index</code> th position in the
- * <code>MediaList</code>, or <code>null</code> if that is
- * not a valid index.
- */
- public String item(int index) {
- if (index < 0 || getLength() <= index)
- return null;
-
- return ((CSSAttrImpl) getMedia().item(index)).getValue();
- }
-
- /**
- * setMediaText method comment.
- */
- public void setMediaText(String mediaText) throws DOMException {
- setCssText(mediaText);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java
deleted file mode 100644
index 25550275c1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RGBColorImpl.java
+++ /dev/null
@@ -1,104 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.RGBColor;
-
-
-/**
- *
- */
-class RGBColorImpl extends CSSPrimitiveContainer implements RGBColor {
-
- private CSSPrimitiveValueImpl fRed;
- private CSSPrimitiveValueImpl fGreen;
- private CSSPrimitiveValueImpl fBlue;
-
- /**
- *
- */
- RGBColorImpl() {
- super(CSS_RGBCOLOR);
- }
-
- RGBColorImpl(RGBColorImpl that) {
- super(that);
-
- fRed = new CSSPrimitiveValueImpl(that.fRed);
- appendChild(fRed);
-
- fGreen = new CSSPrimitiveValueImpl(that.fGreen);
- appendChild(fGreen);
-
- fBlue = new CSSPrimitiveValueImpl(that.fBlue);
- appendChild(fBlue);
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- RGBColorImpl cloned = new RGBColorImpl(this);
-
- return cloned;
- }
-
- /**
- * This attribute is used for the blue value of the RGB color.
- */
- public CSSPrimitiveValue getBlue() {
- return fBlue;
- }
-
- /**
- * This attribute is used for the green value of the RGB color.
- */
- public CSSPrimitiveValue getGreen() {
- return fGreen;
- }
-
- /**
- * This attribute is used for the red value of the RGB color.
- */
- public CSSPrimitiveValue getRed() {
- return fRed;
- }
-
- /**
- * @return org.w3c.dom.css.RGBColor
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public RGBColor getRGBColorValue() throws org.w3c.dom.DOMException {
- return this;
- }
-
- /**
- *
- */
- protected void initPrimitives() {
-
- fRed = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fRed);
-
- fGreen = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fGreen);
-
- fBlue = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fBlue);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java
deleted file mode 100644
index a295ea3c91..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/RectImpl.java
+++ /dev/null
@@ -1,118 +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.css.core.internal.document;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.Rect;
-
-
-/**
- *
- */
-class RectImpl extends CSSPrimitiveContainer implements Rect {
-
- private CSSPrimitiveValueImpl fTop;
- private CSSPrimitiveValueImpl fRight;
- private CSSPrimitiveValueImpl fBottom;
- private CSSPrimitiveValueImpl fLeft;
-
- /**
- *
- */
- RectImpl() {
- super(CSS_RECT);
- }
-
- RectImpl(RectImpl that) {
- super(that);
-
- fTop = new CSSPrimitiveValueImpl(that.fTop);
- appendChild(fTop);
-
- fRight = new CSSPrimitiveValueImpl(that.fRight);
- appendChild(fRight);
-
- fBottom = new CSSPrimitiveValueImpl(that.fBottom);
- appendChild(fBottom);
-
- fLeft = new CSSPrimitiveValueImpl(that.fLeft);
- appendChild(fLeft);
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param deep
- * boolean
- */
- public ICSSNode cloneNode(boolean deep) {
- RectImpl cloned = new RectImpl(this);
-
- return cloned;
- }
-
- /**
- * This attribute is used for the bottom of the rect.
- */
- public CSSPrimitiveValue getBottom() {
- return fBottom;
- }
-
- /**
- * This attribute is used for the left of the rect.
- */
- public CSSPrimitiveValue getLeft() {
- return fLeft;
- }
-
- /**
- * @return org.w3c.dom.css.Rect
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- public Rect getRectValue() throws org.w3c.dom.DOMException {
- return this;
- }
-
- /**
- * This attribute is used for the right of the rect.
- */
- public CSSPrimitiveValue getRight() {
- return fRight;
- }
-
- /**
- * This attribute is used for the top of the rect.
- */
- public CSSPrimitiveValue getTop() {
- return fTop;
- }
-
- /**
- *
- */
- protected void initPrimitives() {
-
- fTop = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fTop);
-
- fRight = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fRight);
-
- fBottom = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fBottom);
-
- fLeft = (CSSPrimitiveValueImpl) getOwnerDocument().createCSSPrimitiveValue(CSS_NUMBER);
- appendChild(fLeft);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.java
deleted file mode 100644
index fea1bfca15..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/StyleSheetListImpl.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.css.core.internal.document;
-
-
-
-import org.w3c.dom.stylesheets.StyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- *
- */
-class StyleSheetListImpl extends AbstractCSSNodeList implements StyleSheetList {
-
- /**
- * StyleSheetListImpl constructor comment.
- */
- StyleSheetListImpl() {
- super();
- }
-
- /**
- * Used to retrieve a style sheet by ordinal index. If index is greater
- * than or equal to the number of style sheets in the list, this returns
- * <code>null</code>.
- *
- * @param indexIndex
- * into the collection
- * @return The style sheet at the <code>index</code> position in the
- * <code>StyleSheetList</code>, or <code>null</code> if that
- * is not a valid index.
- */
- public StyleSheet item(int index) {
- return (StyleSheet) itemImpl(index);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
deleted file mode 100644
index 51a51e1f1f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentCharsetDetector.java
+++ /dev/null
@@ -1,126 +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.css.core.internal.encoding;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.internal.contenttype.CSSResourceEncodingDetector;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.sse.core.internal.document.DocumentReader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentCharsetDetector;
-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.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-
-
-public class CSSDocumentCharsetDetector extends CSSResourceEncodingDetector implements IDocumentCharsetDetector {
-
- public String getEncodingName(IStructuredDocument structuredDocument) {
- String result = null;
- // if the document is empty, then there will be no nodes,
- // so no need to continue.
- IStructuredDocumentRegionList nodes = structuredDocument.getRegionList();
- if (nodes.getLength() > 0) {
- IStructuredDocumentRegion node = null;
- // skip any initial whitespace
- // Note that @charset "encodingname";
- // must appear at very beginning of document,
- // to be valid.
- // May have to test with "damaged" files (e.g.
- // beginning EOLs, etc., to verify this works
- // as expected.
- for (int i = 0; i < nodes.getLength(); i++) {
- node = nodes.item(i);
- if (getType(node) != CSSRegionContexts.CSS_S) {
- break;
- }
- }
- Iterator regions = node.getRegions().iterator();
- ITextRegion region = getNextRegionOfType(CSSRegionContexts.CSS_CHARSET, regions);
- if (region != null) {
- ITextRegion valueRegion = getNextRegionOfType(CSSRegionContexts.CSS_STRING, regions);
- if (valueRegion == null) {
- // if didn't find the region, its probably due to ill
- // formed input, such as
- // @charset "ISO-8859-6;
- // so we'll try again for "unknown" region.
- // If that fails, we'll give up?
- regions = node.getRegions().iterator();
- region = getNextRegionOfType(CSSRegionContexts.CSS_CHARSET, regions);
- if (region != null) {
- valueRegion = getNextRegionOfType(CSSRegionContexts.CSS_UNKNOWN, regions);
- if (valueRegion != null) {
- result = node.getText(valueRegion);
- }
- }
- }
- else {
- result = node.getText(valueRegion);
- }
- result = StringUtils.stripNonLetterDigits(result);
- }
- }
- return result;
- }
-
- public String getEncodingName(IDocument document) {
- String enc = null;
- if (document instanceof IStructuredDocument) {
- enc = getEncodingName((IStructuredDocument) document);
- }
- else {
- // TODO Important: need to implement some "raw" parser for
- // IDocument level
- }
- return enc;
- }
-
- private String getType(IStructuredDocumentRegion node) {
- if (node == null)
- return null;
- ITextRegionList regions = node.getRegions();
- if (regions == null || regions.size() == 0)
- return null;
- ITextRegion region = regions.get(0);
- String result = region.getType();
- return result;
- }
-
- private ITextRegion getNextRegionOfType(String type, Iterator regions) {
- if (type == null)
- return null;
- if (regions == null)
- return null;
- ITextRegion result = null;
- while (regions.hasNext()) {
- ITextRegion region = (ITextRegion) regions.next();
- if (region.getType() == type) {
- result = region;
- break;
- }
- }
- return result;
- }
-
- /**
- *
- */
-
- public void set(IDocument document) {
- set(new DocumentReader(document, 0));
-
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java
deleted file mode 100644
index b46ff08f87..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java
+++ /dev/null
@@ -1,91 +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.css.core.internal.encoding;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.internal.contenttype.EncodingGuesser;
-import org.eclipse.wst.css.core.internal.parser.CSSSourceParser;
-import org.eclipse.wst.css.core.internal.provisional.contenttype.ContentTypeIdForCSS;
-import org.eclipse.wst.css.core.internal.text.CSSStructuredDocumentReParser;
-import org.eclipse.wst.css.core.internal.text.StructuredTextPartitionerForCSS;
-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.RegionParser;
-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;
-
-
-public class CSSDocumentLoader extends AbstractDocumentLoader {
- private final static String CSS_ID = ContentTypeIdForCSS.ContentTypeID_CSS;
- private IDocumentCharsetDetector documentEncodingDetector;
-
-
- public CSSDocumentLoader() {
- super();
- }
-
- protected String getEncodingNameByGuess(byte[] string, int length) {
- String ianaEnc = null;
- ianaEnc = EncodingGuesser.guessEncoding(string, length);
- return ianaEnc;
- }
-
- /**
- * Default encoding. For CSS there is no spec'd default.
- */
- protected String getSpecDefaultEncoding() {
- return null;
- }
-
- protected IEncodedDocument newEncodedDocument() {
- // DMW: I copied this from CSSModelImple ...
- // but am not sure its right
- IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
- CSSStructuredDocumentReParser reParser = new CSSStructuredDocumentReParser();
- reParser.setStructuredDocument(structuredDocument);
- ((BasicStructuredDocument) structuredDocument).setReParser(reParser);
- return structuredDocument;
- }
-
- public RegionParser getParser() {
- // return new CSSRegionParser();
- return new CSSSourceParser();
- }
-
- protected String getPreferredNewLineDelimiter(IFile file) {
- String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(CSS_ID);
- if (delimiter == null)
- delimiter = super.getPreferredNewLineDelimiter(file);
- return delimiter;
- }
-
- public IDocumentCharsetDetector getDocumentEncodingDetector() {
- if (documentEncodingDetector == null) {
- documentEncodingDetector = new CSSDocumentCharsetDetector();
- }
- return documentEncodingDetector;
- }
-
- public IDocumentPartitioner getDefaultDocumentPartitioner() {
- return new StructuredTextPartitionerForCSS();
- }
-
- public IDocumentLoader newInstance() {
- return new CSSDocumentLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java
deleted file mode 100644
index 0c77119003..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleListener.java
+++ /dev/null
@@ -1,32 +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.css.core.internal.event;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-
-
-
-/**
- *
- */
-public interface ICSSStyleListener {
-
- /**
- *
- */
- void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media);
-
- /**
- *
- */
- void styleUpdate(ICSSModel srcModel);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java
deleted file mode 100644
index ba49ee8d2f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/event/ICSSStyleNotifier.java
+++ /dev/null
@@ -1,40 +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.css.core.internal.event;
-
-
-
-import java.util.List;
-
-/**
- *
- */
-public interface ICSSStyleNotifier extends ICSSStyleListener {
-
- /**
- *
- */
- void addStyleListener(ICSSStyleListener listener);
-
- /**
- *
- */
- List getStyleListeners();
-
- /**
- */
- boolean isRecording();
-
- /**
- *
- */
- void removeStyleListener(ICSSStyleListener listener);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java
deleted file mode 100644
index e8031ba3de..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSEmbededStyleNotifyAdapter.java
+++ /dev/null
@@ -1,60 +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.css.core.internal.eventimpl;
-
-
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-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.ICSSSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-
-public class CSSEmbededStyleNotifyAdapter extends CSSStyleNotifyAdapter {
-
- /**
- * CSSEmbeddedStyleNotifyAdapter constructor comment.
- *
- * @param model
- * org.eclipse.wst.css.core.model.interfaces.ICSSModel
- */
- public CSSEmbededStyleNotifyAdapter(ICSSModel model) {
- super(model);
- }
-
- /**
- *
- */
- public void styleChanged(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- IDOMNode node = (IDOMNode) model.getOwnerDOMNode();
- if (node != null)
- return;
- INodeAdapter adapter = node.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter instanceof ICSSStyleListener) {
- ((ICSSStyleListener) adapter).styleChanged(srcModel, removed, added, media);
- }
- }
-
- /**
- *
- */
- public void styleUpdate(ICSSModel srcModel) {
- IDOMNode node = (IDOMNode) model.getOwnerDOMNode();
- if (node != null)
- return;
- INodeAdapter adapter = node.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter instanceof ICSSStyleListener) {
- ((ICSSStyleListener) adapter).styleUpdate(srcModel);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java
deleted file mode 100644
index 0760182eff..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleEventDeliverer.java
+++ /dev/null
@@ -1,155 +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.css.core.internal.eventimpl;
-
-
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.event.ICSSStyleNotifier;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-
-
-/**
- *
- */
-public class CSSStyleEventDeliverer {
-
- private Vector fVisited = new Vector();
- private ICSSModel fSrcModel;
- private ICSSSelector[] fRemoved;
- private ICSSSelector[] fAdded;
- private String fMedia;
-
- /**
- *
- */
- public CSSStyleEventDeliverer() {
- super();
- }
-
- /**
- *
- */
- public void fire(ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- if (srcModel == null || srcModel.getStyleListeners() == null)
- return;
-
- this.fSrcModel = srcModel;
- this.fRemoved = removed;
- this.fAdded = added;
- this.fMedia = media;
-
- // prohibit delivering to srcModel
- fVisited.clear();
- fVisited.add(srcModel);
- Object[] listeners = srcModel.getStyleListeners().toArray();
- for (int i = 0; i < listeners.length; i++) {
- visit((ICSSStyleListener) listeners[i]);
- }
- }
-
- /**
- *
- */
- public void fireTo(ICSSStyleListener listener, ICSSModel srcModel, ICSSSelector[] removed, ICSSSelector[] added, String media) {
- this.fSrcModel = srcModel;
- this.fRemoved = removed;
- this.fAdded = added;
- this.fMedia = media;
-
- // prohibit delivering to srcModel
- fVisited.clear();
- // visited.add(srcModel); : because looping problem
- visit(listener);
- }
-
- /**
- *
- */
- public void fireUpdate(ICSSModel srcModel) {
- if (srcModel == null || srcModel.getStyleListeners() == null)
- return;
-
- this.fSrcModel = srcModel;
-
- // prohibit delivering to srcModel
- fVisited.clear();
- fVisited.add(srcModel);
- Object[] listeners = srcModel.getStyleListeners().toArray();
- for (int i = 0; i < listeners.length; i++) {
- visitUpdate((ICSSStyleListener) listeners[i]);
- }
- }
-
- /**
- *
- */
- public void fireUpdateTo(ICSSStyleListener listener, ICSSModel srcModel) {
- if (srcModel == null || srcModel.getStyleListeners() == null)
- return;
-
- this.fSrcModel = srcModel;
-
- // prohibit delivering to srcModel
- fVisited.clear();
- // visited.add(srcModel);
- visitUpdate(listener);
- }
-
- /**
- *
- */
- protected void visit(ICSSStyleListener listener) {
- if (listener == null || fVisited.contains(listener))
- return;
-
- // fire event to listener
- listener.styleChanged(fSrcModel, fRemoved, fAdded, fMedia);
- fVisited.add(listener);
-
- // traverse notifier
- if (listener instanceof ICSSStyleNotifier) {
- ICSSStyleNotifier notifier = (ICSSStyleNotifier) listener;
- if (notifier.getStyleListeners() != null) {
- Object[] listeners = notifier.getStyleListeners().toArray();
- for (int i = 0; i < listeners.length; i++) {
- visit((ICSSStyleListener) listeners[i]);
- }
- }
- }
- }
-
- /**
- *
- */
- protected void visitUpdate(ICSSStyleListener listener) {
- if (listener == null || fVisited.contains(listener))
- return;
-
- // fire event to listener
- listener.styleUpdate(fSrcModel);
- fVisited.add(listener);
-
- // traverse notifier
- if (listener instanceof ICSSStyleNotifier) {
- ICSSStyleNotifier notifier = (ICSSStyleNotifier) listener;
- if (notifier.getStyleListeners() != null) {
- Object[] listeners = notifier.getStyleListeners().toArray();
- for (int i = 0; i < listeners.length; i++) {
- visitUpdate((ICSSStyleListener) listeners[i]);
- }
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java
deleted file mode 100644
index 0633b1029b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/eventimpl/CSSStyleNotifyAdapter.java
+++ /dev/null
@@ -1,174 +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.css.core.internal.eventimpl;
-
-
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleListener;
-import org.eclipse.wst.css.core.internal.event.ICSSStyleNotifier;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.ImportedCollector;
-import org.eclipse.wst.css.core.internal.util.SelectorsCollector;
-
-
-/**
- *
- */
-public class CSSStyleNotifyAdapter implements ICSSStyleNotifier {
-
- protected java.util.Vector listeners;
- protected final org.eclipse.wst.css.core.internal.provisional.document.ICSSModel model;
- protected boolean recording = false;
-
- /**
- *
- */
- public CSSStyleNotifyAdapter(ICSSModel model) {
- super();
- this.model = model;
- }
-
- /**
- *
- */
- public void addStyleListener(ICSSStyleListener listener) {
- if (listener == null)
- return;
-
- if (listeners == null)
- listeners = new Vector();
- if (!listeners.contains(listener)) {
-
- // send new selectors event to listener
- ImportedCollector trav = new ImportedCollector();
- trav.apply(model.getDocument());
- Iterator it = trav.getExternals().iterator();
- while (it.hasNext()) {
- ICSSStyleSheet sheet = (ICSSStyleSheet) it.next();
- // collect selectors
- SelectorsCollector selTrav = new SelectorsCollector();
- selTrav.apply(sheet);
- int nSel = selTrav.getSelectors().size();
- ICSSSelector[] added = new ICSSSelector[nSel];
- for (int i = 0; i < nSel; i++)
- added[i] = (ICSSSelector) selTrav.getSelectors().get(i);
-
- // fire event
- CSSStyleEventDeliverer deliverer = new CSSStyleEventDeliverer();
- deliverer.fireTo(listener, sheet.getModel(), null, added, null/*
- * media
- * will
- * be
- * implemented
- * in
- * the
- * future
- */);
- }
-
- // add listener
- listeners.add(listener);
- }
- }
-
- /**
- *
- */
- public void beginRecording() {
- recording = true;
- }
-
- /**
- *
- */
- public void endRecording() {
- recording = false;
- }
-
- /**
- *
- */
- public void fire(ICSSSelector[] removed, ICSSSelector[] added, String media) {
- // send selector changed event
- CSSStyleEventDeliverer deliv = new CSSStyleEventDeliverer();
- deliv.fire(model, removed, added, null);
-
- }
-
- /**
- *
- */
- public java.util.List getStyleListeners() {
- return listeners;
- }
-
- /**
- */
- public boolean isRecording() {
- return recording;
- }
-
- /**
- *
- */
- public void removeStyleListener(ICSSStyleListener listener) {
- if (listener == null)
- return;
-
- if (listeners.contains(listener)) {
- listeners.remove(listener);
-
- // send old selectors event to listener
- ImportedCollector trav = new ImportedCollector();
- trav.apply(model.getDocument());
- Iterator it = trav.getExternals().iterator();
- while (it.hasNext()) {
- ICSSStyleSheet sheet = (ICSSStyleSheet) it.next();
- // collect selectors
- SelectorsCollector selTrav = new SelectorsCollector();
- selTrav.apply(sheet);
- int nSel = selTrav.getSelectors().size();
- ICSSSelector[] removed = new ICSSSelector[nSel];
- for (int i = 0; i < nSel; i++)
- removed[i] = (ICSSSelector) selTrav.getSelectors().get(i);
-
- // fire event
- CSSStyleEventDeliverer deliverer = new CSSStyleEventDeliverer();
- deliverer.fireTo(listener, sheet.getModel(), removed, null, null/*
- * media
- * will
- * be
- * implemented
- * in
- * the
- * future
- */);
- }
- }
- }
-
- /**
- *
- */
- public void styleChanged(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel srcModel, org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector[] removed, org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector[] added, java.lang.String media) {
- }
-
- /**
- *
- */
- public void styleUpdate(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel srcModel) {
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java
deleted file mode 100644
index 797d07646f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/format/FormatProcessorCSS.java
+++ /dev/null
@@ -1,123 +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.css.core.internal.format;
-
-import java.util.List;
-
-import org.eclipse.jface.text.DocumentRewriteSession;
-import org.eclipse.jface.text.DocumentRewriteSessionType;
-import org.eclipse.jface.text.IDocumentExtension4;
-import org.eclipse.wst.css.core.internal.formatter.CSSFormatUtil;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter;
-import org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatterFactory;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-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.format.AbstractStructuredFormatProcessor;
-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.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-
-public class FormatProcessorCSS extends AbstractStructuredFormatProcessor {
- /*
- * Max length of text to be formatted to be considered a "small change"
- * Used for document rewrite session type.
- */
- private final int MAX_SMALL_FORMAT_SIZE = 1000;
-
- protected String getFileExtension() {
- return "css"; //$NON-NLS-1$
- }
-
- public void formatModel(IStructuredModel structuredModel, int start, int length) {
- CSSFormatUtil formatUtil = CSSFormatUtil.getInstance();
- if (structuredModel instanceof ICSSModel) {
- // BUG102822 take advantage of IDocumentExtension4
- IDocumentExtension4 docExt4 = null;
- if (structuredModel.getStructuredDocument() instanceof IDocumentExtension4) {
- docExt4 = (IDocumentExtension4) structuredModel.getStructuredDocument();
- }
- DocumentRewriteSession rewriteSession = null;
-
- try {
- DocumentRewriteSessionType rewriteType = (length > MAX_SMALL_FORMAT_SIZE) ? DocumentRewriteSessionType.UNRESTRICTED : DocumentRewriteSessionType.UNRESTRICTED_SMALL;
- rewriteSession = (docExt4 == null || docExt4.getActiveRewriteSession() != null) ? null : docExt4.startRewriteSession(rewriteType);
-
- ICSSDocument doc = ((ICSSModel) structuredModel).getDocument();
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) doc);
- StringBuffer buf = formatter.format(doc);
- if (buf != null) {
- int startOffset = ((IndexedRegion) doc).getStartOffset();
- int endOffset = ((IndexedRegion) doc).getEndOffset();
- formatUtil.replaceSource(doc.getModel(), startOffset, endOffset - startOffset, buf.toString());
- }
- }
- finally {
- // BUG102822 take advantage of IDocumentExtension4
- if (docExt4 != null && rewriteSession != null)
- docExt4.stopRewriteSession(rewriteSession);
- }
- }
- else if (structuredModel instanceof IDOMModel) {
- List cssnodes = formatUtil.collectCSSNodes(structuredModel, start, length);
- if (cssnodes != null && !cssnodes.isEmpty()) {
- ICSSModel model = null;
-
- // BUG102822 take advantage of IDocumentExtension4
- IDocumentExtension4 docExt4 = null;
- if (structuredModel.getStructuredDocument() instanceof IDocumentExtension4) {
- docExt4 = (IDocumentExtension4) structuredModel.getStructuredDocument();
- }
- DocumentRewriteSession rewriteSession = null;
-
- try {
- DocumentRewriteSessionType rewriteType = (length > MAX_SMALL_FORMAT_SIZE) ? DocumentRewriteSessionType.UNRESTRICTED : DocumentRewriteSessionType.UNRESTRICTED_SMALL;
- rewriteSession = (docExt4 == null || docExt4.getActiveRewriteSession() != null) ? null : docExt4.startRewriteSession(rewriteType);
-
- for (int i = 0; i < cssnodes.size(); i++) {
- ICSSNode node = (ICSSNode) cssnodes.get(i);
- CSSSourceFormatter formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) node);
- StringBuffer buf = formatter.format(node);
- if (buf != null) {
- int startOffset = ((IndexedRegion) node).getStartOffset();
- int endOffset = ((IndexedRegion) node).getEndOffset();
- if (model == null) {
- model = node.getOwnerDocument().getModel();
- }
- formatUtil.replaceSource(model, startOffset, endOffset - startOffset, buf.toString());
- }
- }
- }
- finally {
- // BUG102822 take advantage of IDocumentExtension4
- if (docExt4 != null && rewriteSession != null)
- docExt4.stopRewriteSession(rewriteSession);
- }
- }
- }
- }
-
- public IStructuredFormatPreferences getFormatPreferences() {
- return null;
- }
-
- protected IStructuredFormatter getFormatter(Node node) {
- return null;
- }
-
- protected void refreshFormatPreferences() {
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
deleted file mode 100644
index 7d6cf7933f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AbstractCSSSourceFormatter.java
+++ /dev/null
@@ -1,1003 +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.css.core.internal.formatter;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategyImpl;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
-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.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.css.core.internal.util.CSSLinkConverter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-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.core.internal.util.Assert;
-
-/**
- *
- */
-public abstract class AbstractCSSSourceFormatter implements CSSSourceGenerator {
-
- protected final static short GENERATE = 0;
- protected final static short FORMAT = 1;
- protected final static short CLEANUP = 2;
- protected static short strategy;
-
- /**
- *
- */
- AbstractCSSSourceFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void appendDelimBefore(ICSSNode node, CompoundRegion toAppend, StringBuffer source) {
- if (node == null || source == null)
- return;
- if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
- return; // for not formatting case on cleanup action
- String delim = getLineDelimiter(node);
-
- boolean needIndent = !(node instanceof ICSSStyleSheet);
- if (toAppend == null) {
- source.append(delim);
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- else {
- String type = toAppend.getType();
- if (type == CSSRegionContexts.CSS_COMMENT) {
- RegionIterator it = new RegionIterator(toAppend.getDocumentRegion(), toAppend.getTextRegion());
- it.prev();
- ITextRegion prev = it.prev();
- if (prev == null || (prev.getType() == CSSRegionContexts.CSS_S && TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0)) {
- source.append(delim);
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- else {
- appendSpaceBefore(node, toAppend.getText(), source);
- }
- }
- else if (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- RegionIterator it = new RegionIterator(toAppend.getDocumentRegion(), toAppend.getTextRegion());
- it.prev();
- ITextRegion prev = it.prev();
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- if (prev.getType() == CSSRegionContexts.CSS_S && TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0) {
- source.append(delim);
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- else if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- int length = getLastLineLength(node, source);
- int append = 1;
- if (length + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- }
- }
- else if (type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_LBRACE) {
- source.append(delim);
- source.append(getIndent(node));
- }
- else {
- source.append(delim);
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- }
- }
-
- /**
- *
- */
- protected void appendSpaceBefore(ICSSNode node, CompoundRegion toAppend, StringBuffer source) {
- if (node == null || toAppend == null || source == null)
- return;
- if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
- return; // for not formatting case on cleanup action
- String type = toAppend.getType();
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- boolean needIndent = !(node instanceof ICSSStyleSheet);
- if (type == CSSRegionContexts.CSS_COMMENT) {
- // check whether previous region is 'S' and has CR-LF
- String delim = getLineDelimiter(node);
- RegionIterator it = new RegionIterator(toAppend.getDocumentRegion(), toAppend.getTextRegion());
- it.prev();
- ITextRegion prev = it.prev();
- if (prev.getType() == CSSRegionContexts.CSS_S && TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, it.getStructuredDocumentRegion().getText(prev), 0)[0] >= 0) {
- source.append(delim);
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- else {
- appendSpaceBefore(node, toAppend.getText(), source);
- }
- }
- else if (type == CSSRegionContexts.CSS_LBRACE && preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {
- String delim = getLineDelimiter(node);
- source.append(delim);
- source.append(getIndent(node));
- // } else if (type == CSSRegionContexts.CSS_CURLY_BRACE_CLOSE) {
- // } else if (type == CSSRegionContexts.CSS_INCLUDES || type ==
- // CSSRegionContexts.CSS_DASHMATCH) {
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR && node instanceof ICSSStyleDeclItem) {
- int n = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
- if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- int length = getLastLineLength(node, source);
- int append = 1;
- if (length + n + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- n = 0; // no space is necessary
- }
- }
- // no delimiter case
- while (n-- > 0)
- source.append(" ");//$NON-NLS-1$
- }
- else if (type == CSSRegionContexts.CSS_DECLARATION_DELIMITER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE) {
- if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- int length = getLastLineLength(node, source);
- int append = 1;
- if (length + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- if (needIndent)
- source.append(getIndentString());
- }
- }
- }
- else if (CSSRegionContexts.CSS_FOREIGN_ELEMENT == type) {
- return;
- }
- else
- appendSpaceBefore(node, toAppend.getText(), source);
- }
-
- /**
- *
- */
- protected void appendSpaceBefore(ICSSNode node, String toAppend, StringBuffer source) {
- if (node == null || source == null)
- return;
- if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
- return; // for not formatting case on cleanup action
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (toAppend != null && toAppend.startsWith("{") && preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE)) {//$NON-NLS-1$
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- return;
- }
- else if (/* ! mgr.isOnePropertyPerLine() && */preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- int n = getLastLineLength(node, source);
- int append = (toAppend != null) ? TextUtilities.indexOf(DefaultLineTracker.DELIMITERS, toAppend, 0)[0] : 0;
- if (toAppend != null)
- append = (append < 0) ? toAppend.length() : append;
- if (n + append + 1 > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- source.append(getIndentString());
- return;
- }
- }
- source.append(" ");//$NON-NLS-1$
- }
-
- /**
- *
- */
- public final StringBuffer cleanup(ICSSNode node) {
- short oldStrategy = strategy;
- strategy = CLEANUP;
- StringBuffer source = formatProc(node);
- strategy = oldStrategy;
-
- return source;
- }
-
- /**
- *
- */
- public final StringBuffer cleanup(ICSSNode node, IRegion region) {
- short oldStrategy = strategy;
- strategy = CLEANUP;
- StringBuffer source = formatProc(node, region);
- strategy = oldStrategy;
-
- return source;
- }
-
- /**
- *
- */
- protected String decoratedIdentRegion(CompoundRegion region, CSSCleanupStrategy stgy) {
- if (isFormat())
- return region.getText();
-
- String text = null;
- if (!stgy.isFormatSource())
- text = region.getFullText();
- else
- text = region.getText();
-
- if (region.getType() == CSSRegionContexts.CSS_STRING || region.getType() == CSSRegionContexts.CSS_URI)
- return decoratedRegion(region, 0, stgy);
-
- if (isCleanup()) {
- if (stgy.getIdentCase() == CSSCleanupStrategy.ASIS || region.getType() == CSSRegionContexts.CSS_COMMENT)
- return text;
- else if (stgy.getIdentCase() == CSSCleanupStrategy.UPPER)
- return text.toUpperCase();
- else
- return text.toLowerCase();
- }
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (region.getType() == CSSRegionContexts.CSS_COMMENT)
- return text;
- else if (preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- return text.toUpperCase();
- else
- return text.toLowerCase();
- }
-
- /**
- *
- */
- protected String decoratedPropNameRegion(CompoundRegion region, CSSCleanupStrategy stgy) {
- if (isFormat())
- return region.getText();
-
- String text = null;
- if (!stgy.isFormatSource())
- text = region.getFullText();
- else
- text = region.getText();
-
- if (region.getType() == CSSRegionContexts.CSS_STRING || region.getType() == CSSRegionContexts.CSS_URI)
- return decoratedRegion(region, 1, stgy);
- if (isCleanup()) {
- if (stgy.getPropNameCase() == CSSCleanupStrategy.ASIS || region.getType() != CSSRegionContexts.CSS_DECLARATION_PROPERTY)
- return text;
- else if (stgy.getPropNameCase() == CSSCleanupStrategy.UPPER)
- return text.toUpperCase();
- else
- return text.toLowerCase();
- }
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- if (region.getType() != CSSRegionContexts.CSS_DECLARATION_PROPERTY)
- return text;
- else if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER)
- return text.toUpperCase();
- else
- return text.toLowerCase();
- }
-
- /**
- *
- */
- protected String decoratedPropValueRegion(CompoundRegion region, CSSCleanupStrategy stgy) {
- if (isFormat())
- return region.getText();
-
- String text = null;
- if (!stgy.isFormatSource())
- text = region.getFullText();
- else
- text = region.getText();
-
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_STRING || type == CSSRegionContexts.CSS_URI || type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI)
- return decoratedRegion(region, 2, stgy);
- if (isCleanup()) {
- if (stgy.getPropValueCase() != CSSCleanupStrategy.ASIS) {
- if (type == CSSRegionContexts.CSS_COMMENT) {
- }
- else {
- if (stgy.getPropValueCase() == CSSCleanupStrategy.UPPER)
- text = text.toUpperCase();
- else
- text = text.toLowerCase();
- }
- }
- }
- return text;
- }
-
- /**
- *
- */
- protected String decoratedRegion(CompoundRegion region, int type, CSSCleanupStrategy stgy) {
- if (isFormat())
- return region.getText();
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- String text = null;
- if (!stgy.isFormatSource())
- text = region.getFullText();
- else
- text = region.getText();
-
- String regionType = region.getType();
- if (regionType == CSSRegionContexts.CSS_URI || regionType == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- String uri = CSSLinkConverter.stripFunc(text);
-
- boolean prefIsUpper = preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER;
- boolean upper = (type == 0) ? prefIsUpper : ((type == 1) ? preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER : preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER);
- String func = text.substring(0, 4);
- if (isCleanup()) {
- upper = ((type == 0) ? stgy.getIdentCase() : ((type == 1) ? stgy.getPropNameCase() : stgy.getPropValueCase())) == CSSCleanupStrategy.UPPER;
- func = ((type == 0) ? stgy.getIdentCase() : ((type == 1) ? stgy.getPropNameCase() : stgy.getPropValueCase())) == CSSCleanupStrategy.ASIS ? text.substring(0, 4) : (upper ? "URL(" : "url(");//$NON-NLS-2$//$NON-NLS-1$
- }
- if ((!isCleanup() && preferences.getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI)) || (isCleanup() && stgy.isQuoteValues())) {
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- quote = CSSUtil.detectQuote(uri, quote);
- text = func + quote + uri + quote + ")";//$NON-NLS-1$
- }
- else if (isCleanup() && !stgy.isQuoteValues()) {
- text = func + CSSLinkConverter.removeFunc(text) + ")";//$NON-NLS-1$
- }
- else {
- text = func + uri + ")";//$NON-NLS-1$
- }
- }
- else if (region.getType() == CSSRegionContexts.CSS_STRING && (!isCleanup() || stgy.isQuoteValues())) {
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- // begginning
- if (!text.startsWith(quote)) {
- if (text.startsWith("\"") || text.startsWith("\'")) //$NON-NLS-1$ //$NON-NLS-2$
- text = quote + text.substring(1);
- else
- text = quote + text;
- }
- // ending
- if (!text.endsWith(quote)) {
- if (text.endsWith("\"") || text.endsWith("\'")) //$NON-NLS-1$ //$NON-NLS-2$
- text = text.substring(0, text.length() - 1) + quote;
- else
- text = text + quote;
- }
- }
- return text;
- }
-
- /**
- *
- */
- public final StringBuffer format(ICSSNode node) {
- short oldStrategy = strategy;
- strategy = FORMAT;
- StringBuffer source = formatProc(node);
- strategy = oldStrategy;
-
- return source;
- }
-
- /**
- *
- */
- public final StringBuffer format(ICSSNode node, IRegion region) {
- short oldStrategy = strategy;
- strategy = FORMAT;
- StringBuffer source = formatProc(node, region);
- strategy = oldStrategy;
-
- return source;
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- return new StringBuffer(insert && (attr != null) ? attr.getValue() : "");//$NON-NLS-1$
- }
-
- /**
- * Generate or format source between children('child' and its previous
- * sibling) and append to string buffer
- */
- abstract protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor);
-
- /**
- * Generate or format source between children('child' and its previous
- * sibling) and append to string buffer
- */
- public final StringBuffer formatBefore(ICSSNode node, ICSSNode child, IRegion exceptFor) {
- Assert.isTrue(child == null || child.getParentNode() == node);
- StringBuffer buf = new StringBuffer();
- formatBefore(node, child, /* (child != null) ? (child.getCssText()) : */"", buf, exceptFor);//$NON-NLS-1$
- return buf;
- }
-
- /**
- * Generate or format source between children('child' and its previous
- * sibling) and append to string buffer
- */
- protected abstract void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source);
-
- /**
- *
- */
- protected final void formatChildren(ICSSNode node, StringBuffer source) {
- ICSSNode child = node.getFirstChild();
- boolean first = true;
- while (child != null) {
- // append child
- CSSSourceFormatter formatter = (CSSSourceFormatter) ((INodeNotifier) child).getAdapterFor(CSSSourceFormatter.class);
- if (formatter == null) {
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) child);
- }
- StringBuffer childSource = ((AbstractCSSSourceFormatter) formatter).formatProc(child);
- if (!first) {
- formatBefore(node, child, new String(childSource), source, null);
- }
- source.append(childSource);
- // append between children
- child = child.getNextSibling();
- first = false;
- }
- }
-
- /**
- *
- */
- protected final void formatChildren(ICSSNode node, IRegion region, StringBuffer source) {
- ICSSNode child = node.getFirstChild();
- int start = region.getOffset();
- int end = region.getOffset() + region.getLength();
- boolean first = true;
- while (child != null) {
- int curEnd = ((IndexedRegion) child).getEndOffset();
- StringBuffer childSource = null;
- boolean toFinish = false;
- if (start < curEnd) {
- int curStart = ((IndexedRegion) child).getStartOffset();
- if (curStart < end) {
- // append child
- CSSSourceFormatter formatter = (CSSSourceFormatter) ((INodeNotifier) child).getAdapterFor(CSSSourceFormatter.class);
- if (formatter == null) {
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) child);
- }
- if (includes(region, curStart, curEnd))
- childSource = ((AbstractCSSSourceFormatter) formatter).formatProc(child);
- else
- childSource = ((AbstractCSSSourceFormatter) formatter).formatProc(child, overlappedRegion(region, curStart, curEnd));
- }
- else
- toFinish = true;
- }
- // append between children
- if (!first) {
- curEnd = ((IndexedRegion) child).getStartOffset(); // change
- // only
- // start
- if (start < curEnd) {
- int curStart = ((IndexedRegion) child.getPreviousSibling()).getEndOffset();
- if (curStart < end) {
- String toAppend = (childSource != null) ? new String(childSource) : "";//$NON-NLS-1$
- if (includes(region, curStart, curEnd))
- formatBefore(node, child, toAppend, source, null);
- else
- formatBefore(node, child, overlappedRegion(region, curStart, curEnd), toAppend, source);
- }
- }
- }
- if (childSource != null) {
- source.append(childSource);
- }
- first = false;
- if (toFinish)
- break;
- child = child.getNextSibling();
- }
- }
-
- /**
- * Generate or format source after the last child and append to string
- * buffer
- */
- protected abstract void formatPost(ICSSNode node, StringBuffer source);
-
- /**
- * Generate or format source after the last child and append to string
- * buffer
- */
- protected abstract void formatPost(ICSSNode node, IRegion region, StringBuffer source);
-
- /**
- * Generate or format source before the first child and append to string
- * buffer
- */
- protected abstract void formatPre(ICSSNode node, StringBuffer source);
-
- /**
- * Generate or format source before the first child and append to string
- * buffer
- */
- abstract protected void formatPre(ICSSNode node, IRegion region, StringBuffer source);
-
- /**
- *
- * @return java.lang.StringBuffer
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- protected final StringBuffer formatProc(ICSSNode node) {
- StringBuffer source = new StringBuffer();
- formatPre(node, source);
- formatChildren(node, source);
- formatPost(node, source);
- return source;
- }
-
- /**
- *
- * @return java.lang.StringBuffer
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param region
- * org.eclipse.jface.text.IRegion
- */
- protected final StringBuffer formatProc(ICSSNode node, IRegion region) {
- StringBuffer source = new StringBuffer();
- int curStart = ((IndexedRegion) node).getStartOffset();
- int curEnd = ((IndexedRegion) node).getEndOffset();
- if (node.getChildNodes().getLength() > 0) {
- curEnd = ((IndexedRegion) node.getFirstChild()).getStartOffset();
- if (overlaps(region, curStart, curEnd)) {
- if (includes(region, curStart, curEnd))
- formatPre(node, source);
- else
- formatPre(node, overlappedRegion(region, curStart, curEnd), source);
- }
- curStart = curEnd;
- curEnd = ((IndexedRegion) node.getLastChild()).getEndOffset();
- if (overlaps(region, curStart, curEnd)) {
- if (includes(region, curStart, curEnd))
- formatChildren(node, source);
- else
- formatChildren(node, overlappedRegion(region, curStart, curEnd), source);
- }
- curStart = curEnd;
- curEnd = ((IndexedRegion) node).getEndOffset();
- if (overlaps(region, curStart, curEnd)) {
- if (includes(region, curStart, curEnd))
- formatPost(node, source);
- else
- formatPost(node, overlappedRegion(region, curStart, curEnd), source);
- }
- }
- else {
- curEnd = getChildInsertPos(node);
- if (overlaps(region, curStart, curEnd)) {
- if (includes(region, curStart, curEnd))
- formatPre(node, source);
- else
- formatPre(node, overlappedRegion(region, curStart, curEnd), source);
- }
- curStart = curEnd;
- curEnd = ((IndexedRegion) node).getEndOffset();
- if (overlaps(region, curStart, curEnd)) {
- if (includes(region, curStart, curEnd))
- formatPost(node, source);
- else
- formatPost(node, overlappedRegion(region, curStart, curEnd), source);
- }
- }
- return source;
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- return -1;
- }
-
- /**
- * Insert the method's description here.
- *
- * @return org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- protected CSSCleanupStrategy getCleanupStrategy(ICSSNode node) {
- CSSCleanupStrategy currentStrategy = CSSCleanupStrategyImpl.getInstance();
- ICSSDocument doc = node.getOwnerDocument();
- if (doc == null)
- return currentStrategy;
- ICSSModel model = doc.getModel();
- if (model == null)
- return currentStrategy;
- if (model.getStyleSheetType() != ICSSModel.EXTERNAL) {
- // TODO - TRANSITION Nakamori-san, or Kit, how can we move to
- // "HTML" plugin?
- // can we subclass?
- // currentStrategy = CSSInHTMLCleanupStrategyImpl.getInstance();
- }
- return currentStrategy;
- }
-
- /**
- *
- */
- protected String getIndent(ICSSNode node) {
- if (node == null)
- return "";//$NON-NLS-1$
- ICSSNode parent = node.getParentNode();
- if (node instanceof ICSSAttr)
- parent = ((ICSSAttr) node).getOwnerCSSNode();
- if (parent == null)
- return "";//$NON-NLS-1$
- if (node instanceof org.w3c.dom.css.CSSStyleDeclaration)
- parent = parent.getParentNode();
- if (parent == null)
- return "";//$NON-NLS-1$
-
- String parentIndent = getIndent(parent);
- if (parent instanceof org.w3c.dom.css.CSSRule)
- return parentIndent + getIndentString();
- if (node.getParentNode() instanceof ICSSStyleDeclaration)
- return parentIndent + getIndentString();
- return parentIndent;
- }
-
- /**
- *
- */
- protected int getLastLineLength(ICSSNode node, StringBuffer source) {
- if (node == null || source == null)
- return 0;
- String delim = getLineDelimiter(node);
- String str = new String(source);
- int n = str.lastIndexOf(delim);
- if (n < 0)
- return str.length();
-
- return str.length() - n - delim.length();
- }
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- public int getLengthToReformatAfter(ICSSNode node, int insertPos) {
- if (node == null)
- return 0;
- IndexedRegion nnode = (IndexedRegion) node;
- if (insertPos < 0 || !nnode.contains(insertPos))
- return 0;
-
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos);
- if (flatNode == null)
- return 0;
- ITextRegion region = flatNode.getRegionAtCharacterOffset(insertPos);
- if (region == null)
- return 0;
- RegionIterator it = new RegionIterator(flatNode, region);
- boolean found = false;
- while (it.hasNext()) {
- region = it.next();
- // if (region.getType() != CSSRegionContexts.CSS_S &&
- // region.getType() != CSSRegionContexts.CSS_DELIMITER &&
- // region.getType() !=
- // CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- if (region.getType() != CSSRegionContexts.CSS_S) {
- found = true;
- break;
- }
- }
- int pos = (found ? it.getStructuredDocumentRegion().getStartOffset(region) : it.getStructuredDocumentRegion().getTextEndOffset(region)) - insertPos;
- return (pos >= 0) ? pos : 0;
- }
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- public int getLengthToReformatBefore(ICSSNode node, int insertPos) {
- if (node == null)
- return 0;
- IndexedRegion nnode = (IndexedRegion) node;
- if (insertPos <= 0 || !nnode.contains(insertPos - 1))
- return 0;
-
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos - 1);
- if (flatNode == null)
- return 0;
- ITextRegion region = flatNode.getRegionAtCharacterOffset(insertPos - 1);
- if (region == null)
- return 0;
- RegionIterator it = new RegionIterator(flatNode, region);
- boolean found = false;
- while (it.hasPrev()) {
- region = it.prev();
- // if (region.getType() != CSSRegionContexts.CSS_S &&
- // region.getType() != CSSRegionContexts.CSS_DELIMITER &&
- // region.getType() !=
- // CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- if (region.getType() != CSSRegionContexts.CSS_S) {
- found = true;
- break;
- }
- }
- int pos = insertPos - (found ? it.getStructuredDocumentRegion().getTextEndOffset(region) : it.getStructuredDocumentRegion().getStartOffset(region));
- // flatNode = it.getStructuredDocumentRegion();
- // if (found) {
- // if (region.getLength() != region.getTextLength()) {
- // pos = insertPos - flatNode.getTextEndOffset(region);
- // } else {
- // pos = insertPos - flatNode.getEndOffset(region);
- // }
- // } else {
- // pos = insertPos - flatNode.getStartOffset(region);
- // }
- return (pos >= 0) ? pos : 0;
- }
-
- /**
- *
- */
- String getLineDelimiter(ICSSNode node) {
- ICSSModel model = (node != null) ? node.getOwnerDocument().getModel() : null;
- return (model != null) ? model.getStructuredDocument().getLineDelimiter() : "\n"; //$NON-NLS-1$
-
- // TODO : check whether to use model.getLineDelimiter() or
- // model.getStructuredDocument().getLineDelimiter()
- }
-
- /**
- *
- */
- protected CompoundRegion[] getOutsideRegions(IStructuredDocument model, IRegion reg) {
- CompoundRegion[] ret = new CompoundRegion[2];
- RegionIterator it = new RegionIterator(model, reg.getOffset());
- it.prev();
- if (it.hasPrev()) {
- ITextRegion textRegion = it.prev();
- IStructuredDocumentRegion documentRegion = it.getStructuredDocumentRegion();
- ret[0] = new CompoundRegion(documentRegion, textRegion);
- }
- else {
- ret[0] = null;
- }
- it.reset(model, reg.getOffset() + reg.getLength());
- if (it.hasNext()) {
- ITextRegion textRegion = it.next();
- IStructuredDocumentRegion documentRegion = it.getStructuredDocumentRegion();
- ret[1] = new CompoundRegion(documentRegion, textRegion);
- }
- else {
- ret[1] = null;
- }
- return ret;
- }
-
- /**
- */
- protected CSSSourceGenerator getParentFormatter(ICSSNode node) {
- ICSSNode parent = node.getParentNode();
- if (parent != null) {
- CSSSourceGenerator formatter = (CSSSourceGenerator) ((INodeNotifier) parent).getAdapterFor(CSSSourceFormatter.class);
- if (formatter == null) {
- formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter((INodeNotifier) parent);
- }
- return formatter;
- }
- return null;
- }
-
- /**
- *
- */
- protected CompoundRegion[] getRegions(IStructuredDocument model, IRegion reg, IRegion exceptFor, String pickupType) {
- int start = reg.getOffset();
- int end = reg.getOffset() + reg.getLength();
- int startE = (exceptFor != null) ? exceptFor.getOffset() : -1;
- int endE = (exceptFor != null) ? exceptFor.getOffset() + exceptFor.getLength() : 0;
-
- ArrayList list = new ArrayList();
- IStructuredDocumentRegion flatNode = model.getRegionAtCharacterOffset(start);
- boolean pickuped = false;
- while (flatNode != null && flatNode.getStartOffset() < end) {
- ITextRegionList regionList = flatNode.getRegions();
- Iterator it = regionList.iterator();
- while (it.hasNext()) {
- ITextRegion region = (ITextRegion) it.next();
- if (flatNode.getStartOffset(region) < start)
- continue;
- if (end <= flatNode.getStartOffset(region))
- break;
- if (startE >= 0 && startE <= flatNode.getStartOffset(region) && flatNode.getEndOffset(region) <= endE)
- continue;
- if (region.getType() == CSSRegionContexts.CSS_COMMENT || region.getType() == CSSRegionContexts.CSS_CDC || region.getType() == CSSRegionContexts.CSS_CDO)
- list.add(new CompoundRegion(flatNode, region));
- else if (!pickuped && region.getType() == pickupType) {
- list.add(new CompoundRegion(flatNode, region));
- pickuped = true;
- }
- }
- flatNode = flatNode.getNext();
- }
- if (list.size() > 0) {
- CompoundRegion[] regions = new CompoundRegion[list.size()];
- list.toArray(regions);
- return regions;
- }
- return new CompoundRegion[0];
- }
-
- /**
- *
- */
- protected CompoundRegion[] getRegionsWithoutWhiteSpaces(IStructuredDocument model, IRegion reg, CSSCleanupStrategy stgy) {
- int start = reg.getOffset();
- int end = reg.getOffset() + reg.getLength() - 1;
- ArrayList list = new ArrayList();
- IStructuredDocumentRegion flatNode = model.getRegionAtCharacterOffset(start);
- while (flatNode != null && flatNode.getStartOffset() <= end) {
- ITextRegionList regionList = flatNode.getRegions();
- Iterator it = regionList.iterator();
- while (it.hasNext()) {
- ITextRegion region = (ITextRegion) it.next();
- if (flatNode.getStartOffset(region) < start)
- continue;
- if (end < flatNode.getStartOffset(region))
- break;
- if (region.getType() != CSSRegionContexts.CSS_S || (isCleanup() && !stgy.isFormatSource())) // for
- // not
- // formatting
- // case
- // on
- // cleanup
- // action
- list.add(new CompoundRegion(flatNode, region));
- }
- flatNode = flatNode.getNext();
- }
- if (list.size() > 0) {
- CompoundRegion[] regions = new CompoundRegion[list.size()];
- list.toArray(regions);
- return regions;
- }
- return new CompoundRegion[0];
- }
-
- /**
- *
- */
- public static boolean includes(IRegion region, int start, int end) {
- if (region == null)
- return false;
-
- return (region.getOffset() <= start) && (end <= region.getOffset() + region.getLength());
- }
-
- /**
- *
- * @return boolean
- */
- protected static boolean isCleanup() {
- return strategy == CLEANUP;
- }
-
- /**
- *
- * @return boolean
- */
- protected static boolean isFormat() {
- return strategy == FORMAT;
- }
-
- /**
- *
- */
- protected boolean isIncludesPreEnd(ICSSNode node, IRegion region) {
- return (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getStartOffset() == (region.getOffset() + region.getLength()));
- }
-
- /**
- *
- */
- static protected boolean needS(CompoundRegion region) {
- return (region != null && region.getType() != CSSRegionContexts.CSS_S);
- }
-
- /**
- *
- */
- public static IRegion overlappedRegion(IRegion region, int start, int end) {
- if (overlaps(region, start, end)) {
- int offset = (region.getOffset() <= start) ? start : region.getOffset();
- int length = ((end <= region.getOffset() + region.getLength()) ? end : region.getOffset() + region.getLength()) - offset;
- return new FormatRegion(offset, length);
- }
- return null;
- }
-
- /**
- *
- */
- public static boolean overlaps(IRegion region, int start, int end) {
- if (region == null)
- return false;
-
- return (start < region.getOffset() + region.getLength()) && (region.getOffset() < end);
- }
-
- private String getIndentString() {
- StringBuffer indent = new StringBuffer();
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- char indentChar = ' ';
- String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
- if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- }
- return indent.toString();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java
deleted file mode 100644
index 924a73e7b6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrChangeContext.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.css.core.internal.formatter;
-
-
-
-/**
- *
- */
-public class AttrChangeContext {
-
- public int start, end;
-
- /**
- *
- */
- public AttrChangeContext() {
- super();
- start = end = 0;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java
deleted file mode 100644
index 141a9d49d7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/AttrFormatter.java
+++ /dev/null
@@ -1,168 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- *
- */
-public class AttrFormatter extends DefaultCSSSourceFormatter {
-
- private static AttrFormatter instance;
-
- /**
- *
- */
- AttrFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- ICSSAttr attr = (ICSSAttr) node;
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int end = ((IndexedRegion) node).getEndOffset();
- if (end > 0) { // format source
- int start = ((IndexedRegion) node).getStartOffset();
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
-
- if (attr.getName().equals(ICSSStyleRule.SELECTOR) || attr.getName().equals(ICSSPageRule.SELECTOR)) {
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBetween(node, regions[i - 1], regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- }
- else if (attr.getName().equals(ICSSImportRule.HREF)) {
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- }
- else if (attr.getName().equals(ICSSCharsetRule.ENCODING)) {
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- }
- else if (attr.getName().equals(ICSSStyleDeclItem.IMPORTANT)) {
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- }
- else if (attr.getName() == null || attr.getName().length() == 0) {
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- }
- else {
- // counter attributes
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- }
- }
- else { // generate source
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- String value = attr.getValue();
- if (value == null)
- value = "";//$NON-NLS-1$
- if (attr.getName().equals(ICSSStyleRule.SELECTOR) || attr.getName().equals(ICSSPageRule.SELECTOR)) {
- }
- else if (attr.getName().equals(ICSSImportRule.HREF)) {
- String uri = org.eclipse.wst.css.core.internal.util.CSSLinkConverter.stripFunc(value);
- String func = preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER ? "URL(" : "url(";//$NON-NLS-2$//$NON-NLS-1$
- if (preferences.getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI)) {
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- quote = CSSUtil.detectQuote(uri, quote);
- value = func + quote + uri + quote + ")";//$NON-NLS-1$
- }
- else {
- value = func + uri + ")";//$NON-NLS-1$
- }
- }
- else if (attr.getName().equals(ICSSCharsetRule.ENCODING)) {
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- if (!value.startsWith("\"") && !value.startsWith("\'"))//$NON-NLS-2$//$NON-NLS-1$
- value = quote + value;
- if (!value.endsWith("\"") && !value.endsWith("\'"))//$NON-NLS-2$//$NON-NLS-1$
- value = value + quote;
- }
- else if (attr.getName().equals(ICSSStyleDeclItem.IMPORTANT)) {
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- value = value.toUpperCase();
- else
- value = value.toLowerCase();
- }
- else if (attr.getName() == null || attr.getName().length() == 0) {
- if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- value = value.toUpperCase();
- else
- value = value.toLowerCase();
- }
- else {
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- value = value.toUpperCase();
- else
- value = value.toLowerCase();
- }
- source.append(value);
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- formatPre(node, source);
- }
-
- /**
- *
- */
- public synchronized static AttrFormatter getInstance() {
- if (instance == null) {
- instance = new AttrFormatter();
- }
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java
deleted file mode 100644
index 880851941c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSFormatUtil.java
+++ /dev/null
@@ -1,165 +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.css.core.internal.formatter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.ICSSModelAdapter;
-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.document.ICSSModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-
-public class CSSFormatUtil {
- public List collectCSSNodes(IStructuredModel model, int start, int length) {
- List nodes = new ArrayList();
-
- IndexedRegion startNode = model.getIndexedRegion(start);
- IndexedRegion endNode = model.getIndexedRegion(start + length - 1);
-
- if (startNode == null || endNode == null) {
- return nodes;
- }
-
- if (model instanceof ICSSModel && startNode instanceof ICSSNode && endNode instanceof ICSSNode) {
- // CSS model
- ICSSNode ca = getCommonAncestor((ICSSNode) startNode, (ICSSNode) endNode);
- if (ca != null) {
- for (ICSSNode node = ca.getFirstChild(); node != null && start + length < ((IndexedRegion) node).getStartOffset(); node = node.getNextSibling()) {
- if (start < ((IndexedRegion) node).getEndOffset()) {
- nodes.add(node);
- }
- }
- }
- }
- else if (model instanceof IDOMModel && startNode instanceof IDOMNode && endNode instanceof IDOMNode) {
- if (startNode instanceof Text) {
- startNode = (IndexedRegion) ((Text) startNode).getParentNode();
- }
- if (endNode instanceof Text) {
- endNode = (IndexedRegion) ((Text) endNode).getParentNode();
- }
- // HTML model, maybe
- IDOMNode ca = (IDOMNode) getCommonAncestor((Node) startNode, (Node) endNode);
- findCSS(nodes, ca);
- }
-
- return nodes;
- }
-
- /**
- * getCommonAncestor method
- *
- * @return org.w3c.dom.Node
- * @param node
- * org.w3c.dom.Node
- */
- private Node getCommonAncestor(Node node1, Node node2) {
- if (node1 == null || node2 == null)
- return null;
-
- for (Node na = node2; na != null; na = na.getParentNode()) {
- for (Node ta = node1; ta != null; ta = ta.getParentNode()) {
- if (ta == na)
- return ta;
- }
- }
- return null; // not found
- }
-
- private void findCSS(List cssNodes, IDOMNode node) {
- ICSSModelAdapter adapter;
- adapter = (ICSSModelAdapter) node.getAdapterFor(IStyleSheetAdapter.class);
- if (adapter != null) {
- ICSSModel model = adapter.getModel();
- if (model != null && model.getStyleSheetType() == ICSSModel.EMBEDDED) {
- cssNodes.add(model.getDocument());
- }
- }
- else {
- adapter = (ICSSModelAdapter) node.getAdapterFor(IStyleDeclarationAdapter.class);
- if (adapter != null) {
- ICSSModel model = adapter.getModel();
- if (model != null && model.getStyleSheetType() == ICSSModel.INLINE) {
- cssNodes.add(model.getDocument());
- }
- }
- }
-
- for (IDOMNode child = (IDOMNode) node.getFirstChild(); child != null; child = (IDOMNode) child.getNextSibling()) {
- findCSS(cssNodes, child);
- }
- }
-
- private ICSSNode getCommonAncestor(ICSSNode nodeA, ICSSNode nodeB) {
- if (nodeA == null || nodeB == null) {
- return null;
- }
-
- for (ICSSNode na = nodeA; na != null; na = na.getParentNode()) {
- for (ICSSNode ta = nodeB; ta != null; ta = ta.getParentNode()) {
- if (ta == na) {
- return ta;
- }
- }
- }
-
- return null; // not found
- }
-
- /**
- */
- public void replaceSource(IStructuredModel model, int offset, int length, String source) {
- if (model == null)
- return;
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (structuredDocument == null)
- return;
- if (offset >= 0 && length >= 0 && offset + length <= structuredDocument.getLength()) {
- if (structuredDocument.containsReadOnly(offset, length))
- return;
- if (source == null)
- source = new String();
- // 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);
- }
- }
-
- public synchronized static CSSFormatUtil getInstance() {
- if (fInstance == null) {
- fInstance = new CSSFormatUtil();
- }
- return fInstance;
- }
-
- private CSSFormatUtil() {
- super();
- }
-
- private static CSSFormatUtil fInstance;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java
deleted file mode 100644
index 04473a0234..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatter.java
+++ /dev/null
@@ -1,48 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- *
- */
-public interface CSSSourceFormatter {
-
- /**
- *
- */
- StringBuffer cleanup(ICSSNode node);
-
- /**
- *
- * @return java.lang.StringBuffer
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param region
- * org.eclipse.jface.text.IRegion
- */
- StringBuffer cleanup(ICSSNode node, IRegion region);
-
- /**
- *
- */
- StringBuffer format(ICSSNode node);
-
- /**
- *
- */
- StringBuffer format(ICSSNode node, IRegion region);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java
deleted file mode 100644
index 2f689c4af4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceFormatterFactory.java
+++ /dev/null
@@ -1,81 +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.css.core.internal.formatter;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-
-
-/**
- *
- */
-public class CSSSourceFormatterFactory {
- /**
- *
- */
- private CSSSourceFormatterFactory() {
- super();
- }
-
- /**
- *
- */
- public CSSSourceGenerator getSourceFormatter(INodeNotifier target) {
- ICSSNode node = (ICSSNode) target;
- short type = node.getNodeType();
- switch (type) {
- case ICSSNode.CHARSETRULE_NODE :
- return CharsetRuleFormatter.getInstance();
- case ICSSNode.FONTFACERULE_NODE :
- return FontFaceRuleFormatter.getInstance();
- case ICSSNode.IMPORTRULE_NODE :
- return ImportRuleFormatter.getInstance();
- case ICSSNode.MEDIALIST_NODE :
- return MediaListFormatter.getInstance();
- case ICSSNode.MEDIARULE_NODE :
- return MediaRuleFormatter.getInstance();
- case ICSSNode.PRIMITIVEVALUE_NODE :
- ICSSPrimitiveValue value = (ICSSPrimitiveValue) node;
- if (value.getPrimitiveType() == org.w3c.dom.css.CSSPrimitiveValue.CSS_COUNTER)
- return CounterFormatter.getInstance();
- else if (value.getPrimitiveType() == org.w3c.dom.css.CSSPrimitiveValue.CSS_RECT)
- return RectFormatter.getInstance();
- else if (value.getPrimitiveType() == org.w3c.dom.css.CSSPrimitiveValue.CSS_RGBCOLOR)
- return RGBFormatter.getInstance();
- else
- return PrimitiveValueFormatter.getInstance();
- case ICSSNode.PAGERULE_NODE :
- return PageRuleFormatter.getInstance();
- case ICSSNode.STYLEDECLARATION_NODE :
- return StyleDeclarationFormatter.getInstance();
- case ICSSNode.STYLEDECLITEM_NODE :
- return StyleDeclItemFormatter.getInstance();
- case ICSSNode.STYLERULE_NODE :
- return StyleRuleFormatter.getInstance();
- case ICSSNode.STYLESHEET_NODE :
- return StyleSheetFormatter.getInstance();
- case ICSSNode.ATTR_NODE :
- return AttrFormatter.getInstance();
- default :
- return UnknownRuleFormatter.getInstance();
- }
- }
-
- public synchronized static CSSSourceFormatterFactory getInstance() {
- if (fInstance == null) {
- fInstance = new CSSSourceFormatterFactory();
- }
- return fInstance;
- }
-
- private static CSSSourceFormatterFactory fInstance;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java
deleted file mode 100644
index 992e8afdf3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CSSSourceGenerator.java
+++ /dev/null
@@ -1,61 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-public interface CSSSourceGenerator extends CSSSourceFormatter {
-
- /**
- *
- */
- StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext region);
-
- /**
- *
- */
- StringBuffer formatBefore(ICSSNode node, ICSSNode child, IRegion exceptFor);
-
- /**
- *
- */
- int getAttrInsertPos(ICSSNode node, String attrName);
-
- /**
- *
- */
- int getChildInsertPos(ICSSNode node);
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- int getLengthToReformatAfter(ICSSNode node, int insertPos);
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- int getLengthToReformatBefore(ICSSNode node, int insertPos);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java
deleted file mode 100644
index 744eedc450..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CharsetRuleFormatter.java
+++ /dev/null
@@ -1,184 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSCharsetRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class CharsetRuleFormatter extends DefaultCSSSourceFormatter {
-
- public final static java.lang.String CHARSET = "@charset";//$NON-NLS-1$
- private static CharsetRuleFormatter instance;
-
- /**
- *
- */
- CharsetRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- StringBuffer buf = new StringBuffer();
- if (node == null || attr == null)
- return buf;
-
- if (!ICSSCharsetRule.ENCODING.equalsIgnoreCase(attr.getName()))
- return buf;
-
- // get region to replace
- if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- RegionIterator it = new RegionIterator(flatNode, region);
- it.prev();
- if (it.hasPrev()) {
- ITextRegion prev = it.prev();
- if (prev.getType() == CSSRegionContexts.CSS_S)
- context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
- else
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- } else
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- } else {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- if (region.getType() == CSSRegionContexts.CSS_S) {
- context.start = flatNode.getStartOffset(region);
- context.end = flatNode.getStartOffset(region);
- } else {
- context.start = flatNode.getEndOffset() + 1;
- context.end = flatNode.getEndOffset();
- }
- }
- }
- // generate text
- if (insert) {
- appendSpaceBefore(node, attr.getValue(), buf);
- buf.append(attr.getValue());
- }
- return buf;
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int end = ((IndexedRegion) node).getEndOffset();
- if (end > 0) { // format source
- int start = ((IndexedRegion) node).getStartOffset();
- formatPre(node, new FormatRegion(start, end - start), source);
- } else { // generate source
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- String str = CHARSET;
- if (preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- str = CHARSET.toUpperCase();
- source.append(str);
- String enc = ((ICSSCharsetRule) node).getEncoding();
- quote = CSSUtil.detectQuote(enc, quote);
- str = quote + ((enc != null) ? enc : "") + quote + ";";//$NON-NLS-1$ //$NON-NLS-2$
- appendSpaceBefore(node, str, source);
- source.append(str);
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if ((i != 0 || needS(outside[0])) && !regions[i].getType().equals(CSSRegionContexts.CSS_DELIMITER))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- if (!ICSSCharsetRule.ENCODING.equalsIgnoreCase(attrName))
- return -1;
-
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSCharsetRule.ENCODING);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- IndexedRegion iNode = (IndexedRegion) node;
- if (iNode.getEndOffset() <= 0)
- return -1;
-
- CompoundRegion regions[] = getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(), new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() - iNode.getStartOffset()), stgy);
- for (int i = regions.length - 1; i >= 0; i--) {
- if (regions[i].getType() != CSSRegionContexts.CSS_COMMENT)
- return regions[i].getStartOffset();
- }
- return iNode.getEndOffset();
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_DELIMITER)
- return n - 1;
- return n;
- }
- return -1;
- }
-
- /**
- *
- */
- public synchronized static CharsetRuleFormatter getInstance() {
- if (instance == null)
- instance = new CharsetRuleFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java
deleted file mode 100644
index 0662feb19e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CompoundRegion.java
+++ /dev/null
@@ -1,58 +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.css.core.internal.formatter;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-class CompoundRegion {
-
- CompoundRegion(IStructuredDocumentRegion documentRegion, ITextRegion textRegion) {
- super();
- this.fDocumentRegion = documentRegion;
- this.fTextRegion = textRegion;
- }
-
- IStructuredDocumentRegion getDocumentRegion() {
- return fDocumentRegion;
- }
-
- ITextRegion getTextRegion() {
- return fTextRegion;
- }
-
- String getType() {
- return fTextRegion.getType();
- }
-
- String getText() {
- return fDocumentRegion.getText(fTextRegion);
- }
-
- // Bug 218993: Added to get text with whitespace for cleanup
- // without formatting
- String getFullText() {
- return fDocumentRegion.getFullText(fTextRegion);
- }
-
- int getStartOffset() {
- return fDocumentRegion.getStartOffset(fTextRegion);
- }
-
- int getEndOffset() {
- return fDocumentRegion.getEndOffset(fTextRegion);
- }
-
-
- private IStructuredDocumentRegion fDocumentRegion;
- private ITextRegion fTextRegion;
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java
deleted file mode 100644
index c31725b66e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/CounterFormatter.java
+++ /dev/null
@@ -1,319 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICounter;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class CounterFormatter extends DefaultCSSSourceFormatter {
-
- private static CounterFormatter instance;
-
- /**
- *
- */
- CounterFormatter() {
- super();
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- StringBuffer source = new StringBuffer();
- if (node == null || attr == null)
- return source;
-
- if (!ICounter.IDENTIFIER.equalsIgnoreCase(attr.getName()) && !ICounter.LISTSTYLE.equalsIgnoreCase(attr.getName()) && !ICounter.SEPARATOR.equalsIgnoreCase(attr.getName()))
- return source;
-
- // get region to replace
- IndexedRegion iNode = (IndexedRegion) node;
- context.start = iNode.getStartOffset();
- context.end = iNode.getEndOffset();
-
- ICounter counter = (ICounter) node;
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- String sep = counter.getSeparator();
- String ident = counter.getIdentifier();
- String style = counter.getListStyle();
-
- if (ICounter.IDENTIFIER.equalsIgnoreCase(attr.getName())) {
- if (insert)
- ident = attr.getValue();
- else
- ident = "";//$NON-NLS-1$
- }
- else if (ICounter.LISTSTYLE.equalsIgnoreCase(attr.getName())) {
- if (insert)
- style = attr.getValue();
- else
- style = null;
- }
- else if (ICounter.SEPARATOR.equalsIgnoreCase(attr.getName())) {
- if (insert)
- sep = attr.getValue();
- else
- sep = null;
- }
-
- quote = CSSUtil.detectQuote(sep, quote);
- sep = (sep == null || sep.length() == 0) ? null : (quote + sep + quote);
-
- String func = (sep == null || sep.length() == 0) ? "counter(" : "counters(";//$NON-NLS-2$//$NON-NLS-1$
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER) {
- ident = ident.toUpperCase();
- style = style.toUpperCase();
- func = func.toUpperCase();
- }
- else {
- ident = ident.toLowerCase();
- style = style.toLowerCase();
- }
- if (sep == null || sep.length() == 0) {
- source.append(func);
- appendSpaceBefore(node, ident, source);
- source.append(ident);
- }
- else {
- source.append(func);
- appendSpaceBefore(node, ident, source);
- source.append(ident);
- source.append(",");//$NON-NLS-1$
- appendSpaceBefore(node, sep, source);
- source.append(sep);
- }
-
- if (style != null && style.length() != 0) {
- source.append(",");//$NON-NLS-1$
- appendSpaceBefore(node, style, source);
- }
- source.append(")");//$NON-NLS-1$
-
- /*
- * IStructuredDocument structuredDocument =
- * node.getOwnerDocument().getModel().getStructuredDocument();
- * ITextRegion[] regions =
- * getRegionsWithoutWhiteSpaces(structuredDocument, new
- * FormatRegion(context.start, context.end - context.start + 1)); int
- * commas[2]; int numComma = 0; for(int j = 0; j <regions.length; j++) {
- * if (regions[j].getType() == CSSRegionContexts.COMMA) {
- * commas[numComma++] = j; if (numComma > 1) break; } }
- *
- * if (ICounter.IDENTIFIER.equalsIgnoreCase(attr.getName())) { } else
- * if (ICounter.LISTSTYLE.equalsIgnoreCase(attr.getName())) { } else
- * if (ICounter.SEPARATOR.equalsIgnoreCase(attr.getName())) { boolean
- * skipSpace = false; String func = insert ? "counters(" : "counter(";
- * if (mgr.isPropValueUpperCase()) func = func.toUpperCase();
- *
- * for(int i=0; i <regions.length; i++) { if (regions[i].getType() ==
- * CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- * source.append(func); else { if (numComma == 2 && commas[1] < i) {
- * } else if (numComma == 1 && commas[0] < i && insert) {
- * } else if (numComma == 1 && commas[0] < i && ! insert) { } else if
- * (numComma == 0 && insert && regions[i].getType ==
- * CSSRegionContexts.PARENTHESIS_CLOSE) { source.append(",");
- * appendSpaceBefore(node,attr.getValue(),source);
- * source.append(attr.getValue()); }
- *
- * if (i != 0 && !skipSpace)
- * appendSpaceBefore(node,regions[i],source);
- * source.append(decoratedPropValueRegion(regions[i])); } skipSpace =
- * false;
- *
- * if (regions[i].getType() ==
- * CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) skipSpace = true; } }
- */
- return source;
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = ((IndexedRegion) node).getEndOffset();
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- if (end > 0) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- boolean skipSpace = false;
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 && !skipSpace)
- appendSpaceBefore(node, regions[i], source);
- skipSpace = false;
- source.append(decoratedPropValueRegion(regions[i], stgy));
- if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- skipSpace = true;
- }
- }
- else { // generate source
- ICounter counter = (ICounter) node;
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- String separator = counter.getSeparator();
- quote = CSSUtil.detectQuote(separator, quote);
- String sep = (separator == null || separator.length() == 0) ? null : (quote + separator + quote);
- String ident = counter.getIdentifier();
- String style = counter.getListStyle();
- String func = (sep == null || sep.length() == 0) ? "counter(" : "counters(";//$NON-NLS-2$//$NON-NLS-1$
- // normalize
- if (ident == null)
- ident = "";//$NON-NLS-1$
- if (style == null)
- style = "";//$NON-NLS-1$
-
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER) {
- ident = ident.toUpperCase();
- style = style.toUpperCase();
- func = func.toUpperCase();
- }
- else {
- ident = ident.toLowerCase();
- style = style.toLowerCase();
- }
- if (sep == null || sep.length() == 0) {
- source.append(func);
- appendSpaceBefore(node, ident, source);
- source.append(ident);
- }
- else {
- source.append(func);
- appendSpaceBefore(node, ident, source);
- source.append(ident);
- source.append(",");//$NON-NLS-1$
- appendSpaceBefore(node, sep, source);
- source.append(sep);
- }
-
- if (style != null && style.length() != 0) {
- source.append(",");//$NON-NLS-1$
- appendSpaceBefore(node, style, source);
- }
- source.append(")");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
-
- IndexedRegion iNode = (IndexedRegion) node;
- if (ICounter.IDENTIFIER.equalsIgnoreCase(attrName)) {
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICounter.IDENTIFIER);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- if (iNode.getEndOffset() <= 0)
- return -1;
-
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(iNode.getEndOffset() - 1);
- RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(iNode.getEndOffset() - 1));
- while (it.hasPrev()) {
- ITextRegion region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- return it.getStructuredDocumentRegion().getEndOffset(region);
- }
- return ((IndexedRegion) node).getEndOffset();
- }
- else if (ICounter.LISTSTYLE.equalsIgnoreCase(attrName)) {
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICounter.LISTSTYLE);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
-
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(iNode.getEndOffset() - 1);
- RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(iNode.getEndOffset() - 1));
- while (it.hasPrev()) {
- ITextRegion region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR)
- return it.getStructuredDocumentRegion().getEndOffset(region);
- else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- return it.getStructuredDocumentRegion().getEndOffset(region);
- }
- return ((IndexedRegion) node).getEndOffset();
- }
- else if (ICounter.SEPARATOR.equalsIgnoreCase(attrName)) {
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICounter.SEPARATOR);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
-
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(iNode.getEndOffset() - 1);
- RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(iNode.getEndOffset() - 1));
- boolean hasComma = false;
- while (it.hasPrev()) {
- ITextRegion region = it.prev();
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR) {
- if (!hasComma)
- hasComma = true;
- else
- return it.getStructuredDocumentRegion().getEndOffset(region);
- }
- else if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- return it.getStructuredDocumentRegion().getEndOffset(region);
- }
- return ((IndexedRegion) node).getEndOffset();
- }
- else
- return -1;
- }
-
- /**
- *
- */
- public synchronized static CounterFormatter getInstance() {
- if (instance == null)
- instance = new CounterFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java
deleted file mode 100644
index ea799966f6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DeclContainerFormatter.java
+++ /dev/null
@@ -1,119 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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;
-
-
-/**
- *
- */
-public class DeclContainerFormatter extends DefaultCSSSourceFormatter {
-
- /**
- *
- */
- DeclContainerFormatter() {
- super();
- }
-
- /**
- *
- * @return java.lang.String
- */
- protected String decoratedSelectorRegion(CompoundRegion region, CompoundRegion prevRegion, CSSCleanupStrategy stgy) {
- if (isFormat())
- return region.getText();
-
- String text = null;
- if (!stgy.isFormatSource())
- text = region.getFullText();
- else
- text = region.getText();
-
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO) {
- short selCase = stgy.getSelectorTagCase();
- if (selCase == org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy.UPPER) {
- return text.toUpperCase();
- }
- else if (selCase == org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy.LOWER) {
- return text.toLowerCase();
- }
- return text;
- }
-
- return decoratedRegion(region, 0, stgy);
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int end = ((IndexedRegion) node).getEndOffset();
- int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
- if (end > 0 && start < end) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- }
- else { // generate source
- String delim = getLineDelimiter(node);
- source.append(delim);
- source.append(getIndent(node));
- source.append("}");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_RBRACE)
- return n - 1;
- else
- return n;
- }
- return -1;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
deleted file mode 100644
index 04a6730316..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/DefaultCSSSourceFormatter.java
+++ /dev/null
@@ -1,126 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-
-/**
- *
- */
-public class DefaultCSSSourceFormatter extends AbstractCSSSourceFormatter {
-
- /**
- *
- */
- DefaultCSSSourceFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void appendSpaceBetween(ICSSNode node, CompoundRegion prev, CompoundRegion next, StringBuffer source) {
- if (isCleanup() && !getCleanupStrategy(node).isFormatSource())
- return; // for not formatting case on cleanup action
-
- // in selector
- String prevType = prev.getType();
- String nextType = next.getType();
- if (CSSRegionUtil.isSelectorBegginingType(prevType) && CSSRegionUtil.isSelectorBegginingType(nextType)) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=73990
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=110539
- // Formatting CSS file splits element.class into element . class
- if (((prevType == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || prevType == CSSRegionContexts.CSS_SELECTOR_CLASS || prevType == CSSRegionContexts.CSS_SELECTOR_ID) && (nextType == CSSRegionContexts.CSS_SELECTOR_CLASS || nextType == CSSRegionContexts.CSS_SELECTOR_ID)) || ((prevType == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || prevType == CSSRegionContexts.CSS_SELECTOR_CLASS) && nextType == CSSRegionContexts.CSS_SELECTOR_PSEUDO) || (nextType == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)) {
- // Individually, SELECTOR_ELEMENT_NAME, SELECTOR_CLASS, and SELECTOR_ID can all be beginning types.
- // But, we should not insert a space in between when they are followed by SELECTOR_CLASS or SELECTOR_ID.
- // For example: H1.pastoral and H1#z98y and .pastoral.other and #myid.myclass
- //
- // Also, space is now not inserted in between when SELECTOR_ELEMENT_NAME is followed by SELECTOR_PSEUDO, or when
- // SELECTOR_CLASS is followed by SELECTOR_PSEUDO.
- // For example: P:first-letter and A.external:visited
- }
- else
- appendSpaceBefore(node, next, source);
- return;
- }
-
- if (prevType == CSSRegionContexts.CSS_PAGE || prevType == CSSRegionContexts.CSS_CHARSET || prevType == CSSRegionContexts.CSS_ATKEYWORD || prevType == CSSRegionContexts.CSS_FONT_FACE || prevType == CSSRegionContexts.CSS_IMPORT || prevType == CSSRegionContexts.CSS_MEDIA) {
- appendSpaceBefore(node, next, source);
- return;
- }
-
- if (prevType == CSSRegionContexts.CSS_UNKNOWN && nextType != CSSRegionContexts.CSS_COMMENT) {
- if (prev.getEndOffset() != next.getStartOffset()) { // not
- // sequential
- appendSpaceBefore(node, next, source);
- }
- return;
- }
-
- if (prevType == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || prevType == CSSRegionContexts.CSS_COMMENT || nextType == CSSRegionContexts.CSS_COMMENT || nextType == CSSRegionContexts.CSS_LBRACE || nextType == CSSRegionContexts.CSS_UNKNOWN) {
- appendSpaceBefore(node, next, source);
- return;
- }
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, StringBuffer source) {
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0)
- return n;
- return -1;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java
deleted file mode 100644
index ee46eed456..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FontFaceRuleFormatter.java
+++ /dev/null
@@ -1,97 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- *
- */
-public class FontFaceRuleFormatter extends DeclContainerFormatter {
-
- public final static java.lang.String FONT_FACE = "@font-face";//$NON-NLS-1$
- private static FontFaceRuleFormatter instance;
-
- /**
- *
- */
- FontFaceRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatPre(org.eclipse.wst.css.core.internal.provisional.document.ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
- if (end > 0) {
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- }
- else {
- String str = FONT_FACE;
- if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- str = FONT_FACE.toUpperCase();
- source.append(str);
- appendSpaceBefore(node, "{", source);//$NON-NLS-1$
- source.append("{");//$NON-NLS-1$
- }
- appendDelimBefore(node, null, source);
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- if (needS(outside[1])) {
- if (isIncludesPreEnd(node, region))
- appendDelimBefore(node, null, source);
- else
- appendSpaceBefore(node, outside[1], source);
- }
- }
-
- /**
- *
- */
- public synchronized static FontFaceRuleFormatter getInstance() {
- if (instance == null)
- instance = new FontFaceRuleFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.java
deleted file mode 100644
index ff0c9d322a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FormatRegion.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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-
-/**
- *
- */
-class FormatRegion implements IRegion {
-
- private int fOffset, fLength;
-
- /**
- *
- */
- FormatRegion(int offset, int length) {
- super();
- set(offset, length);
- }
-
- /**
- * Returns the length of the region.
- *
- * @return the length of the region
- */
- public int getLength() {
- return fLength;
- }
-
- /**
- * Returns the offset of the region.
- *
- * @return the offset of the region
- */
- public int getOffset() {
- return fOffset;
- }
-
- /**
- *
- */
- void set(int offset, int length) {
- this.fOffset = offset;
- this.fLength = length;
- }
-
- /**
- *
- */
- void setLength(int newLength) {
- fLength = newLength;
- }
-
- /**
- *
- */
- void setOffset(int newOffset) {
- fOffset = newOffset;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java
deleted file mode 100644
index 8c47f0e994..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/FunctionFormatter.java
+++ /dev/null
@@ -1,184 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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;
-
-
-/**
- *
- */
-abstract public class FunctionFormatter extends AbstractCSSSourceFormatter {
-
- /**
- *
- */
- FunctionFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
- int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
- if (start > 0 && start < end) { // format source
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- // get meaning regions
- CompoundRegion[] regions = null;
- if (exceptFor == null)
- regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- else {
- String pickupType = CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR;
- if (prev == null || child == null)
- pickupType = null;
- regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
- }
- // extract source
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 2, stgy));
- }
- } else if (prev != null && child != null) { // generate source between
- // parameters
- source.append(",");//$NON-NLS-1$
- }
- appendSpaceBefore(node, toAppend, source);
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 2, stgy));
- }
- }
-
- /**
- *
- */
- protected void formatPost(org.eclipse.wst.css.core.internal.provisional.document.ICSSNode node, java.lang.StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int end = ((IndexedRegion) node).getEndOffset();
- int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
- if (end > 0 && start < end) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 2, stgy));
- }
- } else { // generate source
- source.append(")");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 2, stgy));
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
- if (end > 0) { // format source
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- } else { // generate source
- String func = getFunc();
- if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- func = func.toUpperCase();
- source.append(func);
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- return n - 1;
- return n;
- }
- return -1;
- }
-
- /**
- *
- */
- protected abstract String getFunc();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java
deleted file mode 100644
index fc758520be..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/ImportRuleFormatter.java
+++ /dev/null
@@ -1,339 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class ImportRuleFormatter extends AbstractCSSSourceFormatter {
-
- public final static java.lang.String IMPORT = "@import";//$NON-NLS-1$
- private static ImportRuleFormatter instance;
-
- /**
- *
- */
- ImportRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- StringBuffer buf = new StringBuffer();
- if (node == null || attr == null)
- return buf;
-
- if (!ICSSImportRule.HREF.equalsIgnoreCase(attr.getName()))
- return buf;
-
- // get region to replace
- if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- RegionIterator it = new RegionIterator(flatNode, region);
- it.prev();
- if (it.hasPrev()) {
- ITextRegion prev = it.prev();
- if (prev.getType() == CSSRegionContexts.CSS_S)
- context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
- else
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- it.next();
- } else
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- it.next();
- it.next();
- if (it.hasNext()) {
- ITextRegion next = it.next();
- if (next.getType() == CSSRegionContexts.CSS_S)
- context.end = it.getStructuredDocumentRegion().getEndOffset(next);
- else
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- } else
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- } else {
- ICSSNode child = node.getFirstChild();
- IStructuredDocumentRegion flatNode = null;
- ITextRegion region = null;
- if (child == null) {
- flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- } else {
- flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) child).getStartOffset() - 1);
- region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) child).getStartOffset() - 1);
- }
- if (region.getType() == CSSRegionContexts.CSS_S) {
- context.start = flatNode.getStartOffset(region);
- context.end = flatNode.getEndOffset(region);
- } else {
- context.start = flatNode.getEndOffset();
- context.end = flatNode.getEndOffset();
- }
- }
- }
- // generate text
- if (insert && attr.getValue() != null && attr.getValue().length() > 0) {
- appendSpaceBefore(node, attr.getValue(), buf);
- buf.append(attr.getValue());
- appendSpaceBefore(node, "", buf);//$NON-NLS-1$
- }
- return buf;
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- // for media-type
- ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
- int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
- if (start > 0 && start < end) { // format source
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- // get meaning regions
- CompoundRegion[] regions = null;
- if (exceptFor == null)
- regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- else {
- String pickupType = CSSRegionContexts.CSS_MEDIA_SEPARATOR;
- if (prev == null || child == null)
- pickupType = null;
- regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
- }
- // extract source
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- appendSpaceBefore(node, toAppend, source);
- } else if (prev != null && child != null) { // generate source : ????
- source.append(",");//$NON-NLS-1$
- appendSpaceBefore(node, toAppend, source);
- } else if (child != null) { // generate source : between 'url()' and
- // media types
- appendSpaceBefore(node, toAppend, source);
- }
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must be
- // comments
- }
- if (needS(outside[1])) {
- if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength())
- appendSpaceBefore(node, toAppend, source);
- else
- appendSpaceBefore(node, outside[1], source);
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int end = ((IndexedRegion) node).getEndOffset();
- int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
- if (end > 0 && start < end) {
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- } else {
- source.append(";"); //$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if ((i != 0 || needS(outside[0])) && !regions[i].getType().equals(CSSRegionContexts.CSS_DELIMITER))
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
- if (end > 0) { // format source
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- String str = regions[i].getText();
- if (regions[i].getType() == CSSRegionContexts.CSS_IMPORT)
- str = decoratedIdentRegion(regions[i], stgy);
- else
- str = decoratedPropValueRegion(regions[i], stgy);
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(str);
- }
- } else { // generate source
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- String str = IMPORT;
- if (preferences.getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- str = IMPORT.toUpperCase();
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- source.append(str);
- str = "url(";//$NON-NLS-1$
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- str = str.toUpperCase();
- String href = ((ICSSImportRule) node).getHref();
- quote = CSSUtil.detectQuote(href, quote);
- str = str + quote + href + quote + ")";//$NON-NLS-1$
- appendSpaceBefore(node, str, source);
- source.append(str);
- }
- ICSSNode child = node.getFirstChild();
- if (child != null && (child instanceof org.w3c.dom.stylesheets.MediaList) && ((org.w3c.dom.stylesheets.MediaList) child).getLength() > 0) {
- appendSpaceBefore(node, "", source);//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- String str = regions[i].getText();
- if (regions[i].getType() == CSSRegionContexts.CSS_IMPORT)
- str = decoratedIdentRegion(regions[i], stgy);
- else
- str = decoratedPropValueRegion(regions[i], stgy);
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(str);
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
-
- if (!ICSSImportRule.HREF.equalsIgnoreCase(attrName))
- return -1;
-
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSImportRule.HREF);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- IndexedRegion iNode = (IndexedRegion) node;
- if (iNode.getEndOffset() <= 0)
- return -1;
-
- FormatRegion formatRegion = null;
- ICSSNode child = node.getFirstChild();
- if (child != null && ((IndexedRegion) child).getEndOffset() > 0)
- formatRegion = new FormatRegion(iNode.getStartOffset(), ((IndexedRegion) child).getStartOffset() - iNode.getStartOffset());
- else
- formatRegion = new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() - iNode.getStartOffset());
- CompoundRegion regions[] = getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(), formatRegion, getCleanupStrategy(node));
-
- boolean atrule = false;
- for (int i = 0; i < regions.length; i++) {
- if (regions[i].getType() == CSSRegionContexts.CSS_IMPORT) {
- atrule = true;
- continue;
- } else if (!atrule)
- continue;
- if (regions[i].getType() != CSSRegionContexts.CSS_COMMENT)
- return regions[i].getStartOffset();
- }
- return (child != null && ((IndexedRegion) child).getEndOffset() > 0) ? ((IndexedRegion) child).getStartOffset() : iNode.getEndOffset();
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_DELIMITER)
- return n - 1;
- return n;
- }
- return -1;
- }
-
- /**
- *
- */
- public synchronized static ImportRuleFormatter getInstance() {
- if (instance == null)
- instance = new ImportRuleFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java
deleted file mode 100644
index f44eb3494d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaListFormatter.java
+++ /dev/null
@@ -1,211 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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.w3c.dom.stylesheets.MediaList;
-
-
-/**
- *
- */
-public class MediaListFormatter extends DefaultCSSSourceFormatter {
-
- private static MediaListFormatter instance;
-
- /**
- *
- */
- MediaListFormatter() {
- super();
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- StringBuffer buf = new StringBuffer();
- if (node == null || attr == null)
- return buf;
-
- boolean first = false, last = false;
- // get region to replace
- if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- RegionIterator it = new RegionIterator(flatNode, region);
- it.prev();
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- while (it.hasPrev()) {
- ITextRegion prev = it.prev();
- if (prev.getType() == CSSRegionContexts.CSS_S || prev.getType() == CSSRegionContexts.CSS_MEDIA_SEPARATOR || prev.getType() == CSSRegionContexts.CSS_COMMENT)
- context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
- else
- break;
- }
- if (context.start < ((IndexedRegion) node).getStartOffset()) {
- context.start = ((IndexedRegion) node).getStartOffset();
- first = true;
-
- }
- it.reset(flatNode, region);
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- while (it.hasNext()) {
- ITextRegion next = it.next();
- if (next.getType() == CSSRegionContexts.CSS_S || next.getType() == CSSRegionContexts.CSS_MEDIA_SEPARATOR || next.getType() == CSSRegionContexts.CSS_COMMENT)
- context.end = it.getStructuredDocumentRegion().getEndOffset(next);
- else
- break;
- }
- if (((IndexedRegion) node).getEndOffset() < context.end) {
- context.end = ((IndexedRegion) node).getEndOffset();
- last = true;
- }
- } else {
- last = true;
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- RegionIterator it = new RegionIterator(flatNode, region);
- context.start = it.getStructuredDocumentRegion().getEndOffset(region);
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- while (it.hasPrev()) {
- ITextRegion prev = it.prev();
- if (prev.getType() == CSSRegionContexts.CSS_S || prev.getType() == CSSRegionContexts.CSS_MEDIA_SEPARATOR || prev.getType() == CSSRegionContexts.CSS_COMMENT)
- context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
- else
- break;
- }
- if (context.start < ((IndexedRegion) node).getStartOffset()) {
- context.start = ((IndexedRegion) node).getStartOffset();
- first = true;
- }
- }
- }
- // generate text
- if (insert && attr.getValue() != null && attr.getValue().length() > 0) {
- if (!first)
- buf.append(","); //$NON-NLS-1$
- appendSpaceBefore(node, attr.getValue(), buf);
- buf.append(attr.getValue());
- if (!last) {
- buf.append(","); //$NON-NLS-1$
- appendSpaceBefore(node, "", buf); //$NON-NLS-1$
- }
- } else if (!first && !last) {
- buf.append(","); //$NON-NLS-1$
- appendSpaceBefore(node, "", buf); //$NON-NLS-1$
- }
- return buf;
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int start = ((IndexedRegion) node).getStartOffset();
- int end = ((IndexedRegion) node).getEndOffset();
-
- if (end > 0) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- } else { // generate source
- MediaList list = (MediaList) node;
- int n = list.getLength();
- for (int i = 0; i < n; i++) {
- String medium = list.item(i);
- if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- medium = medium.toUpperCase();
- else
- medium = medium.toLowerCase();
-
- if (i != 0) {
- source.append(","); //$NON-NLS-1$
- appendSpaceBefore(node, medium, source);
- }
- source.append(medium);
- }
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
-
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(attrName);
-
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- IndexedRegion iNode = (IndexedRegion) node;
- if (iNode.getEndOffset() <= 0)
- return -1;
-
- /*
- * ITextRegion regions[] =
- * getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(),
- * new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() -
- * iNode.getStartOffset() + 1)); for(int i=regions.length - 1; i >= 0;
- * i--) { if (regions[i].getType() == CSSRegionContexts.IMPORTANT_SYM)
- * return regions[i].getStartOffset(); }
- */
- return iNode.getEndOffset();
- }
-
- /**
- *
- */
- public synchronized static MediaListFormatter getInstance() {
- if (instance == null)
- instance = new MediaListFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
deleted file mode 100644
index 059f56a450..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/MediaRuleFormatter.java
+++ /dev/null
@@ -1,383 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class MediaRuleFormatter extends AbstractCSSSourceFormatter {
-
- public final static java.lang.String MEDIA = "@media";//$NON-NLS-1$
- private static MediaRuleFormatter instance;
-
- /**
- *
- */
- MediaRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
- int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
- if (start > 0 && start < end) { // source formatting
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- // get meaning regions
- CompoundRegion[] regions = null;
- if (exceptFor == null)
- regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- else {
- String pickupType = null;
- if ((prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE) || (prev == null && (child == null || child.getNodeType() != ICSSNode.MEDIALIST_NODE))) {
- pickupType = CSSRegionContexts.CSS_LBRACE;
- }
- regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
- }
- // extract source
- if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
- // "@media"
- // and
- // mediatype
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- appendSpaceBefore(node, toAppend, source);
- } else if (child != null && (child.getPreviousSibling() == null || child.getPreviousSibling().getNodeType() == ICSSNode.MEDIALIST_NODE)) { // between
- // mediatype
- // and
- // the
- // first
- // style
- // rule
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- appendDelimBefore(node, null, source);
- } else { // between styles
- for (int i = 0; i < regions.length; i++) {
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- appendDelimBefore(node, null, source);
- }
- } else { // source generation
- if (child == null && prev != null && prev.getNodeType() != ICSSNode.MEDIALIST_NODE) { // after
- // the
- // last
- // style
- // rule
- appendDelimBefore(node.getParentNode(), null, source);
- } else if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
- // "@media"
- // and
- // mediatype
- appendSpaceBefore(node, toAppend, source);
- } else if (prev != null && prev.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
- // mediatype
- // and
- // the
- // first
- // style
- // rule
- appendSpaceBefore(node, "{", source);//$NON-NLS-1$
- source.append("{");//$NON-NLS-1$
- if (child != null)
- appendDelimBefore(node, null, source);
- else
- appendDelimBefore(node.getParentNode(), null, source);
- } else { // normal case
- appendDelimBefore(node, null, source);
- }
- }
-
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- if (child != null && child.getNodeType() == ICSSNode.MEDIALIST_NODE) { // between
- // "@media"
- // and
- // mediatype
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
- appendSpaceBefore(node, toAppend, source);
- }
- } else if (child != null && (child.getPreviousSibling() == null || child.getPreviousSibling().getNodeType() == ICSSNode.MEDIALIST_NODE)) { // between
- // mediatype
- // and
- // the
- // first
- // style
- // rule
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
- appendDelimBefore(node, null, source);
- }
- } else { // between styles
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- if (needS(outside[1]) && ((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
- appendDelimBefore(node, null, source);
- }
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, StringBuffer source) {
- int end = ((IndexedRegion) node).getEndOffset();
- int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
- if (end > 0 && start < end) { // source formatting
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- if (node.getLastChild() == null || node.getLastChild().getNodeType() != ICSSNode.MEDIALIST_NODE) {
- for (int i = 0; i < regions.length; i++) {
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- } else {
- boolean bInCurlyBrace = false;
- for (int i = 0; i < regions.length; i++) {
- if (!bInCurlyBrace)
- appendSpaceBefore(node, regions[i], source);
- else
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- if (regions[i].getType() == CSSRegionContexts.CSS_LBRACE)
- bInCurlyBrace = true;
- }
- }
- } else { // source generation
- String delim = getLineDelimiter(node);
- if (node.getLastChild() != null && node.getLastChild().getNodeType() == ICSSNode.MEDIALIST_NODE) {
- appendSpaceBefore(node, "{", source);//$NON-NLS-1$
- source.append("{");//$NON-NLS-1$
- }
-
- source.append(delim);
- source.append(getIndent(node));
- source.append("}");//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
- if (end > 0) { // source formatting
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- } else { // source generation
- String str = MEDIA;
- if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- str = MEDIA.toUpperCase();
- source.append(str);
- }
- ICSSNode child = node.getFirstChild();
- if (child != null && (child instanceof org.w3c.dom.stylesheets.MediaList) && ((org.w3c.dom.stylesheets.MediaList) child).getLength() > 0) {
- appendSpaceBefore(node, "", source);//$NON-NLS-1$
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- if (flatNode.getRegionAtCharacterOffset(n - 1).getType() == CSSRegionContexts.CSS_LBRACE)
- return n - 1;
- return n;
- }
- return -1;
- }
-
- /**
- *
- */
- public synchronized static MediaRuleFormatter getInstance() {
- if (instance == null)
- instance = new MediaRuleFormatter();
- return instance;
- }
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- public int getLengthToReformatAfter(ICSSNode node, int insertPos) {
- if (node == null)
- return 0;
- IndexedRegion nnode = (IndexedRegion) node;
- if (insertPos <= 0 || !nnode.contains(insertPos - 1))
- return 0;
-
- if (node.getFirstChild().getNextSibling() == node.getLastChild()) { // inserted
- // first
- // style
- // rule
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(insertPos);
- if (flatNode == null)
- return 0;
- ITextRegion region = flatNode.getRegionAtCharacterOffset(insertPos);
- if (region == null)
- return 0;
- RegionIterator it = new RegionIterator(flatNode, region);
- while (it.hasNext()) {
- region = it.next();
- if (region.getType() == CSSRegionContexts.CSS_LBRACE)
- break;
- if (nnode.getEndOffset() <= it.getStructuredDocumentRegion().getEndOffset(region))
- break;
- }
- int pos = it.getStructuredDocumentRegion().getStartOffset(region) - insertPos;
- return (pos >= 0) ? pos : 0;
-
- }
- return super.getLengthToReformatAfter(node, insertPos);
- }
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- public int getLengthToReformatBefore(ICSSNode node, int insertPos) {
- if (node == null)
- return 0;
- IndexedRegion nnode = (IndexedRegion) node;
- if (insertPos <= 0 || !nnode.contains(insertPos - 1))
- return 0;
-
- if (node.getFirstChild().getNextSibling() == node.getLastChild()) { // inserted
- // first
- // style
- // rule
- int pos = ((IndexedRegion) node.getFirstChild()).getEndOffset();
- if (pos <= 0)
- pos = ((IndexedRegion) node).getStartOffset() + 6 /*
- * length
- * of
- * "@media"
- */;
- return insertPos - pos;
- }
- return super.getLengthToReformatBefore(node, insertPos);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java
deleted file mode 100644
index fa1f7a37fa..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PageRuleFormatter.java
+++ /dev/null
@@ -1,194 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPageRule;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class PageRuleFormatter extends DeclContainerFormatter {
-
- public final static java.lang.String PAGE = "@page";//$NON-NLS-1$
- private static PageRuleFormatter instance;
-
- /**
- *
- */
- PageRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- StringBuffer buf = new StringBuffer();
- if (node == null || attr == null)
- return buf;
-
- if (!ICSSPageRule.SELECTOR.equalsIgnoreCase(attr.getName()))
- return buf;
-
- // get region to replace
- if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
- RegionIterator it = new RegionIterator(flatNode, region);
- it.next();
- if (it.hasNext()) {
- ITextRegion next = it.next();
- if (next.getType() == CSSRegionContexts.CSS_S)
- context.end = it.getStructuredDocumentRegion().getEndOffset(next);
- else
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- }
- else
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- }
- else {
- int pos = getAttrInsertPos(node, attr.getName());
- context.start = pos;
- context.end = pos;
- /*
- * IStructuredDocumentRegion flatNode =
- * node.getOwnerDocument().getModel().getStructuredDocument().getNodeAtCharacterOffset(((IndexedRegion)node).getStartOffset());
- * ITextRegion region =
- * flatNode.getRegionAtCharacterOffset(((IndexedRegion)node).getStartOffset());
- * if (region.getType() == CSSRegionContexts.S) {
- * context.start = region.getStartOffset(); context.end =
- * region.getEndOffset(); } else { context.start =
- * flatNode.getEndOffset() + 1; context.end =
- * flatNode.getEndOffset(); }
- */}
- }
- // generate text
- if (insert) {
- String val = attr.getValue();
- if (val != null && val.length() > 0) {
- buf.append(val);
- appendSpaceBefore(node, "", buf);//$NON-NLS-1$
- }
- }
- return buf;
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
-
- if (end > 0) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBetween(node, regions[i - 1], regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- }
- else { // generate source
- String str = PAGE;
- if (CSSCorePlugin.getDefault().getPluginPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- str = PAGE.toUpperCase();
- source.append(str);
- str = ((ICSSPageRule) node).getSelectorText();
- if (str != null && str.length() > 0) {
- appendSpaceBefore(node, str, source);
- source.append(str);
- }
- appendSpaceBefore(node, "{", source);//$NON-NLS-1$
- source.append("{");//$NON-NLS-1$
- }
- appendDelimBefore(node, null, source);
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBetween(node, (i == 0) ? outside[0] : regions[i - 1], regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- if (needS(outside[1])) {
- if (isIncludesPreEnd(node, region))
- appendDelimBefore(node, null, source);
- else
- appendSpaceBetween(node, regions[regions.length - 1], outside[1], source);
- }
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
-
- if (!ICSSPageRule.SELECTOR.equalsIgnoreCase(attrName))
- return -1;
-
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSPageRule.SELECTOR);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- else if (((IndexedRegion) node).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
- RegionIterator it = new RegionIterator(flatNode, region);
- while (it.hasNext()) {
- region = it.next();
- if (region.getType() == CSSRegionContexts.CSS_LBRACE) {
- return it.getStructuredDocumentRegion().getStartOffset(region);
- }
- if (it.getStructuredDocumentRegion().getEndOffset(region) >= ((IndexedRegion) node).getEndOffset())
- break;
- }
- }
- return ((IndexedRegion) node).getStartOffset();
- }
-
- /**
- *
- */
- public synchronized static PageRuleFormatter getInstance() {
- if (instance == null)
- instance = new PageRuleFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java
deleted file mode 100644
index b215c9dc8d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/PrimitiveValueFormatter.java
+++ /dev/null
@@ -1,273 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-
-/**
- *
- */
-public class PrimitiveValueFormatter extends DefaultCSSSourceFormatter {
-
- private static PrimitiveValueFormatter instance;
-
- /**
- *
- */
- PrimitiveValueFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = ((IndexedRegion) node).getEndOffset();
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- if (end > 0) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- boolean appendQuote = regions.length > 1 && node.getParentNode() instanceof ICSSStyleDeclItem && isCleanup() && getCleanupStrategy(node).isQuoteValues() && (((ICSSStyleDeclItem) node.getParentNode()).getPropertyName().equals(PropCMProperty.P_FONT) || ((ICSSStyleDeclItem) node.getParentNode()).getPropertyName().equals(PropCMProperty.P_FONT_FAMILY) || ((ICSSStyleDeclItem) node.getParentNode()).getPropertyName().equals(PropCMProperty.P_VOICE_FAMILY));
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-
- StringBuffer strBuf = new StringBuffer();
- boolean skipSpace = false;
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 && !skipSpace)
- appendSpaceBefore(node, regions[i], strBuf);
- skipSpace = false;
- strBuf.append(decoratedPropValueRegion(regions[i], stgy));
- if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION)
- skipSpace = true;
- }
-
- if (appendQuote) {
- source.append(quote);
- String str = strBuf.toString();
- str = str.replace('\'', ' ');
- str = str.replace('\"', ' ');
- str = str.trim();
- source.append(str);
- source.append(quote);
- }
- else {
- source.append(strBuf);
- }
- }
- else { // generate source
- ICSSPrimitiveValue value = (ICSSPrimitiveValue) node;
- short type = value.getPrimitiveType();
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
-
- String str = null;
- switch (type) {
- case CSSPrimitiveValue.CSS_NUMBER :
- case CSSPrimitiveValue.CSS_PERCENTAGE :
- case CSSPrimitiveValue.CSS_EMS :
- case CSSPrimitiveValue.CSS_EXS :
- case CSSPrimitiveValue.CSS_PX :
- case CSSPrimitiveValue.CSS_CM :
- case CSSPrimitiveValue.CSS_MM :
- case CSSPrimitiveValue.CSS_IN :
- case CSSPrimitiveValue.CSS_PT :
- case CSSPrimitiveValue.CSS_PC :
- case CSSPrimitiveValue.CSS_DEG :
- case CSSPrimitiveValue.CSS_RAD :
- case CSSPrimitiveValue.CSS_GRAD :
- case CSSPrimitiveValue.CSS_MS :
- case CSSPrimitiveValue.CSS_S :
- case CSSPrimitiveValue.CSS_HZ :
- case CSSPrimitiveValue.CSS_KHZ :
- case CSSPrimitiveValue.CSS_DIMENSION :
- case ICSSPrimitiveValue.CSS_INTEGER :
- if (value.getFloatValue(type) == ((int) value.getFloatValue(type))) {
- str = Integer.toString((int) value.getFloatValue(type));
- }
- else {
- str = Float.toString(value.getFloatValue(type));
- }
- break;
- case CSSPrimitiveValue.CSS_IDENT :
- case ICSSPrimitiveValue.CSS_HASH :
- case ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE :
- str = value.getStringValue();
- if (str != null) {
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- str = str.toUpperCase();
- else
- str.toLowerCase();
- }
- break;
- case CSSPrimitiveValue.CSS_STRING :
- case CSSPrimitiveValue.CSS_URI :
- case CSSPrimitiveValue.CSS_ATTR :
- case ICSSPrimitiveValue.CSS_URANGE :
- case ICSSPrimitiveValue.CSS_FORMAT :
- case ICSSPrimitiveValue.CSS_LOCAL :
- case ICSSPrimitiveValue.CSS_COMMA :
- case ICSSPrimitiveValue.CSS_SLASH :
- str = value.getStringValue();
- }
-
- String preStr = null, postStr = null;
- switch (type) {
- case CSSPrimitiveValue.CSS_ATTR :
- preStr = "attr(";//$NON-NLS-1$
- postStr = ")";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_CM :
- postStr = "cm";//$NON-NLS-1$
- break;
- // case ICSSPrimitiveValue.CSS_COUNTER:
- case CSSPrimitiveValue.CSS_DEG :
- postStr = "deg";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_EMS :
- postStr = "em";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_EXS :
- postStr = "ex";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_GRAD :
- postStr = "grad";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_HZ :
- postStr = "Hz";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_IN :
- postStr = "in";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_KHZ :
- postStr = "kHz";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_MM :
- postStr = "mm";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_MS :
- postStr = "ms";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_PC :
- postStr = "pc";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_PERCENTAGE :
- postStr = "%";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_PT :
- postStr = "pt";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_PX :
- postStr = "px";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_RAD :
- postStr = "rad";//$NON-NLS-1$
- break;
- // case ICSSPrimitiveValue.CSS_RECT:
- // case ICSSPrimitiveValue.CSS_RGBCOLOR:
- case CSSPrimitiveValue.CSS_S :
- postStr = "s";//$NON-NLS-1$
- break;
- case CSSPrimitiveValue.CSS_STRING :
- quote = CSSUtil.detectQuote(str, quote);
- preStr = quote;
- postStr = quote;
- break;
- case CSSPrimitiveValue.CSS_URI :
- quote = CSSUtil.detectQuote(str, quote);
- preStr = "url(" + quote;//$NON-NLS-1$
- postStr = quote + ")";//$NON-NLS-1$
- break;
- // the followings are original primitive values
- case CSSPrimitiveValue.CSS_IDENT :
- case CSSPrimitiveValue.CSS_UNKNOWN :
- // use str
- case ICSSPrimitiveValue.CSS_INTEGER :
- case ICSSPrimitiveValue.CSS_HASH :
- case ICSSPrimitiveValue.CSS_SLASH :
- case ICSSPrimitiveValue.CSS_COMMA :
- case CSSPrimitiveValue.CSS_DIMENSION :
- case CSSPrimitiveValue.CSS_NUMBER :
- case ICSSPrimitiveValue.CSS_INHERIT_PRIMITIVE :
- break;
- case ICSSPrimitiveValue.CSS_URANGE :
- preStr = "U+";//$NON-NLS-1$
- break;
- case ICSSPrimitiveValue.CSS_FORMAT :
- quote = CSSUtil.detectQuote(str, quote);
- preStr = "format(" + quote;//$NON-NLS-1$
- postStr = quote + ")";//$NON-NLS-1$
- break;
- case ICSSPrimitiveValue.CSS_LOCAL :
- quote = CSSUtil.detectQuote(str, quote);
- preStr = "local(" + quote;//$NON-NLS-1$
- postStr = quote + ")";//$NON-NLS-1$
- break;
- }
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER) {
- if (preStr != null)
- preStr = preStr.toUpperCase();
- if (postStr != null)
- postStr = postStr.toUpperCase();
- }
- if (preStr != null)
- source.append(preStr);
- if (str != null)
- source.append(str);
- if (postStr != null)
- source.append(postStr);
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public synchronized static PrimitiveValueFormatter getInstance() {
- if (instance == null)
- instance = new PrimitiveValueFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.java
deleted file mode 100644
index a6909db3fe..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RGBFormatter.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.css.core.internal.formatter;
-
-
-
-/**
- *
- */
-public class RGBFormatter extends FunctionFormatter {
-
- private static RGBFormatter instance;
-
- /**
- *
- */
- RGBFormatter() {
- super();
- }
-
- /**
- *
- */
- protected String getFunc() {
- return "rgb(";//$NON-NLS-1$
- }
-
- /**
- *
- */
- public synchronized static RGBFormatter getInstance() {
- if (instance == null)
- instance = new RGBFormatter();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.java
deleted file mode 100644
index f3ec832dfc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/RectFormatter.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.css.core.internal.formatter;
-
-
-
-/**
- *
- */
-public class RectFormatter extends FunctionFormatter {
-
- private static RectFormatter instance;
-
- /**
- *
- */
- RectFormatter() {
- super();
- }
-
- /**
- *
- */
- protected String getFunc() {
- return "rect(";//$NON-NLS-1$
- }
-
- /**
- *
- */
- public synchronized static RectFormatter getInstance() {
- if (instance == null)
- instance = new RectFormatter();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
deleted file mode 100644
index bf9c042ef9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclItemFormatter.java
+++ /dev/null
@@ -1,399 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclItem;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class StyleDeclItemFormatter extends DefaultCSSSourceFormatter {
-
- private static StyleDeclItemFormatter instance;
-
- /**
- *
- */
- StyleDeclItemFormatter() {
- super();
- }
-
- /**
- *
- */
- private void appendAfterColonSpace(ICSSNode node, StringBuffer source) {
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- int n = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM);
-
- if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- int length = getLastLineLength(node, source);
- int append = getFirstChildRegionLength(node);
- if (length + n + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- source.append(getIndentString());
- n = 0; // no space is necessary
- }
- }
- // no delimiter case
- while (n-- > 0)
- source.append(" ");//$NON-NLS-1$
- }
-
- /**
- *
- */
- private int getFirstChildRegionLength(ICSSNode node) {
- ICSSNode firstChild = node.getFirstChild();
- if (firstChild == null)
- return 1;
- int start = ((IndexedRegion) firstChild).getStartOffset();
- RegionIterator itr = new RegionIterator(node.getOwnerDocument().getModel().getStructuredDocument(), start);
- while (itr.hasNext()) {
- ITextRegion reg = itr.next();
- if (reg != null && reg.getType() != CSSRegionContexts.CSS_S)
- return reg.getTextLength();
- }
- return 1;
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- StringBuffer buf = new StringBuffer();
- if (node == null || attr == null)
- return buf;
-
- if (!ICSSStyleDeclItem.IMPORTANT.equalsIgnoreCase(attr.getName()))
- return buf;
-
- // get region to replace
- if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getStartOffset());
- RegionIterator it = new RegionIterator(flatNode, region);
- it.prev();
- if (it.hasPrev()) {
- ITextRegion prev = it.prev();
- if (prev.getType() == CSSRegionContexts.CSS_S)
- context.start = it.getStructuredDocumentRegion().getStartOffset(prev);
- else
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- } else
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- } else {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getEndOffset() - 1);
- if (region.getType() == CSSRegionContexts.CSS_S) {
- context.start = flatNode.getStartOffset(region);
- context.end = flatNode.getEndOffset(region);
- } else {
- context.start = flatNode.getEndOffset();
- context.end = flatNode.getEndOffset();
- }
- }
- }
- // generate text
- if (insert && attr.getValue() != null && attr.getValue().length() > 0) {
- appendSpaceBefore(node, attr.getValue(), buf);
- buf.append(attr.getValue());
- }
- return buf;
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
- int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
- if (start > 0 && start < end) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- // get meaning regions
- CompoundRegion[] regions = null;
- if (exceptFor == null)
- regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- else {
- regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, null);
- }
- // generate source
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 2, stgy)); // must
- // be
- // comments
- }
- }
- if (child != null && child instanceof ICSSPrimitiveValue) {
- if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_COMMA)
- toAppend = ",";//$NON-NLS-1$
- else if (((ICSSPrimitiveValue) child).getPrimitiveType() == ICSSPrimitiveValue.CSS_SLASH)
- toAppend = "/";//$NON-NLS-1$
- }
- if (child != null && toAppend != null && !toAppend.equals(",") && !toAppend.equals("/")) //$NON-NLS-1$ //$NON-NLS-2$
- appendSpaceBefore(node, toAppend, source);
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 2, stgy)); // must be
- // comments
- }
- if (needS(outside[1])) {
- if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength()) {
- if (toAppend != "," && toAppend != "/") //$NON-NLS-1$ //$NON-NLS-2$
- appendSpaceBefore(node, toAppend, source);
- }
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int end = ((IndexedRegion) node).getEndOffset();
- int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
- if (end > 0 && start < end) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- } else { // generate source
- // append "!important"
- String priority = ((ICSSStyleDeclItem) node).getPriority();
- if (priority != null && priority.length() > 0) {
- appendSpaceBefore(node, priority, source);
- source.append(priority);
- }
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedIdentRegion(regions[i], stgy));
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (end > 0) { // format source
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropNameRegion(regions[i], stgy));
- }
- } else { // generatoe source
- ICSSStyleDeclItem item = (ICSSStyleDeclItem) node;
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER)
- source.append(item.getPropertyName().toUpperCase());
- else
- source.append(item.getPropertyName());
-
- int k = preferences.getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
- if (preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH) > 0 && (!preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR) || node.getOwnerDocument().getNodeType() != ICSSNode.STYLEDECLARATION_NODE)) {
- int length = getLastLineLength(node, source);
- int append = 1;
- if (length + k + append > preferences.getInt(CSSCorePreferenceNames.LINE_WIDTH)) {
- source.append(getLineDelimiter(node));
- source.append(getIndent(node));
- source.append(getIndentString());
- k = 0; // no space is necessary
- }
- }
- // no delimiter case
- while (k-- > 0)
- source.append(" ");//$NON-NLS-1$
- source.append(":");//$NON-NLS-1$
- }
- if (!isCleanup() || getCleanupStrategy(node).isFormatSource()) {
- appendAfterColonSpace(node, source);
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropNameRegion(regions[i], stgy));
- }
- if (needS(outside[1])) {
- if (isIncludesPreEnd(node, region) && (!isCleanup() || getCleanupStrategy(node).isFormatSource())) {
- appendAfterColonSpace(node, source);
- } else
- appendSpaceBefore(node, outside[1], source);
- }
- }
-
- /**
- *
- */
- public StringBuffer formatValue(ICSSNode node) {
- StringBuffer source = new StringBuffer();
- formatChildren(node, source);
-
- return source;
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
-
- if (!ICSSStyleDeclItem.IMPORTANT.equalsIgnoreCase(attrName))
- return -1;
-
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSStyleDeclItem.IMPORTANT);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- IndexedRegion iNode = (IndexedRegion) node;
- if (iNode.getEndOffset() <= 0)
- return -1;
-
- CompoundRegion regions[] = getRegionsWithoutWhiteSpaces(node.getOwnerDocument().getModel().getStructuredDocument(), new FormatRegion(iNode.getStartOffset(), iNode.getEndOffset() - iNode.getStartOffset()), getCleanupStrategy(node));
- for (int i = regions.length - 1; i >= 0; i--) {
- if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT)
- return regions[i].getStartOffset();
- }
- return iNode.getEndOffset();
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n < 0) {
- return -1;
- }
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- if (flatNode != null && flatNode.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER) {
- n -= flatNode.getLength();
- }
- if (n > 0) {
- String important = ((ICSSStyleDeclItem) node).getPriority();
- if (important != null && important.length() > 0) {
- // find before "!important" position
- flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- RegionIterator it = new RegionIterator(flatNode, flatNode.getRegionAtCharacterOffset(n - 1));
- while (it.hasPrev()) {
- ITextRegion region = it.prev();
- if (it.getStructuredDocumentRegion() != flatNode)
- break;
- if (region.getType() == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT)
- return it.getStructuredDocumentRegion().getStartOffset(region);
- }
- }
- // skip last space
- flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(n - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(n - 1);
- if (region != null) {
- n -= region.getLength() - region.getTextLength();
- }
-
- return n;
- }
- return -1;
- }
-
- /**
- *
- */
- public synchronized static StyleDeclItemFormatter getInstance() {
- if (instance == null)
- instance = new StyleDeclItemFormatter();
- return instance;
- }
-
- private String getIndentString() {
- StringBuffer indent = new StringBuffer();
-
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (preferences != null) {
- char indentChar = ' ';
- String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
- if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- }
- return indent.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java
deleted file mode 100644
index 56c928769c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleDeclarationFormatter.java
+++ /dev/null
@@ -1,325 +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.css.core.internal.formatter;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-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.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;
-
-/**
- *
- */
-public class StyleDeclarationFormatter extends DefaultCSSSourceFormatter {
-
- private static StyleDeclarationFormatter instance;
-
- /**
- *
- */
- StyleDeclarationFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
- int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
-
- // check no child
- if (child == null && prev == null)
- return;
-
- if (start > 0 && start < end) { // format source
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration with no
- // model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- // get meaning regions
- CompoundRegion[] regions = null;
- if (exceptFor == null)
- regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- else {
- String pickupType = CSSRegionContexts.CSS_DECLARATION_DELIMITER;
- if (prev == null || child == null)
- pickupType = null;
- regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
- }
- // extract source
- for (int i = 0; i < regions.length; i++) {
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be comments
- }
- }
- }
- } else if (prev != null && child != null) { // generate source :
- // between two declarations
- // BUG93037-properties view adds extra ; when add new property
- boolean semicolonFound = false;
-
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration with no
- // model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- int prevStart = (prev != null) ? ((IndexedRegion) prev).getStartOffset() : 0;
- int prevEnd = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(prevStart, prevEnd - prevStart), stgy);
- int i = regions.length - 1;
- while (i >= 0 && !semicolonFound) {
- if (regions[i].getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
- semicolonFound = true;
- --i;
- }
- }
- }
- if (!semicolonFound)
- source.append(";");//$NON-NLS-1$
- } else if (prev == null) { // generate source : before the first
- // declaration
- org.eclipse.wst.css.core.internal.util.RegionIterator it = null;
- if (end > 0) {
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration with
- // no model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, end - 1);
- }
- }
- } else {
- int pos = getChildInsertPos(node);
- if (pos >= 0) {
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration
- // with no model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, pos - 1);
- }
- }
- }
- }
- if (it != null) {
- int limit = ((IndexedRegion) ((node.getParentNode() != null) ? node.getParentNode() : node)).getStartOffset();
- while (it.hasPrev()) {
- ITextRegion curReg = it.prev();
- if (curReg.getType() == CSSRegionContexts.CSS_LBRACE || curReg.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
- break;
- if (curReg.getType() != CSSRegionContexts.CSS_S && curReg.getType() != CSSRegionContexts.CSS_COMMENT) {
- source.append(";");//$NON-NLS-1$
- break;
- }
- if (it.getStructuredDocumentRegion().getStartOffset(curReg) <= limit)
- break;
- }
- }
- } else if (child == null) { // generate source : after the last
- // declaration
- org.eclipse.wst.css.core.internal.util.RegionIterator it = null;
- if (start > 0) {
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration with
- // no model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, start);
- }
- }
- } else {
- int pos = getChildInsertPos(node);
- if (pos >= 0) {
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration
- // with no model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- it = new org.eclipse.wst.css.core.internal.util.RegionIterator(structuredDocument, pos);
- }
- }
- }
- }
- if (it != null) {
- int limit = ((IndexedRegion) ((node.getParentNode() != null) ? node.getParentNode() : node)).getEndOffset();
- while (it.hasNext()) {
- ITextRegion curReg = it.next();
- if (curReg.getType() == CSSRegionContexts.CSS_RBRACE || curReg.getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
- break;
- if (curReg.getType() != CSSRegionContexts.CSS_S && curReg.getType() != CSSRegionContexts.CSS_COMMENT) {
- // Bug 219004 - Before appending a ;, make sure that there
- // isn't one already
- boolean semicolonFound = false;
- while(it.hasNext() && !semicolonFound) {
- if(it.next().getType() == CSSRegionContexts.CSS_DECLARATION_DELIMITER)
- semicolonFound = true;
- }
-
- if(!semicolonFound)
- source.append(";");//$NON-NLS-1$
- break;
- }
- if (limit <= it.getStructuredDocumentRegion().getEndOffset(curReg))
- break;
- }
- }
- }
- if (child == null) {
- if (((IndexedRegion) node).getEndOffset() <= 0) {
- // get next region
- int pos = getChildInsertPos(node);
- CompoundRegion toAppendRegion = null;
- if (pos >= 0) {
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration
- // with no model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(pos);
- toAppendRegion = new CompoundRegion(flatNode, flatNode.getRegionAtCharacterOffset(pos));
- }
- }
- }
- appendDelimBefore(node.getParentNode(), toAppendRegion, source);
- }
- } else if ((prev != null || ((IndexedRegion) node).getEndOffset() <= 0)) {
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- if (preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE) && (node.getOwnerDocument() != node || !preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR)))
- appendDelimBefore(node, null, source);
- else if (prev != null || node.getOwnerDocument() != node)
- appendSpaceBefore(node, toAppend, source);
- }
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- ICSSModel cssModel = node.getOwnerDocument().getModel();
- // BUG202615 - it is possible to have a style declaration
- // with no model associated with it
- if (cssModel != null) {
- IStructuredDocument structuredDocument = cssModel.getStructuredDocument();
- if (structuredDocument != null) {
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
-
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- }
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
- if (needS(outside[1])) {
- if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength() && preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE) && (node.getOwnerDocument() != node || !preferences.getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR))) {
- appendDelimBefore(node, null, source);
- } else
- appendSpaceBefore(node, toAppend, source);
- }
- }
- }
- }
-
- /**
- * Insert the method's description here.
- */
- public int getChildInsertPos(ICSSNode node) {
- if (node == null)
- return -1;
- int pos = super.getChildInsertPos(node);
- if (pos < 0) {
- CSSSourceGenerator formatter = getParentFormatter(node);
- return (formatter != null) ? formatter.getChildInsertPos(node.getParentNode()) : -1;
- }
- return pos;
- }
-
- /**
- *
- */
- public synchronized static StyleDeclarationFormatter getInstance() {
- if (instance == null)
- instance = new StyleDeclarationFormatter();
- return instance;
- }
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- public int getLengthToReformatAfter(ICSSNode node, int insertPos) {
- if (node == null)
- return 0;
- IndexedRegion nnode = (IndexedRegion) node;
- if (insertPos < 0 || !nnode.contains(insertPos)) {
- if (node.getParentNode() != null && nnode.getEndOffset() <= 0) {
- CSSSourceGenerator pntFormatter = getParentFormatter(node);
- if (pntFormatter != null)
- return pntFormatter.getLengthToReformatAfter(node.getParentNode(), insertPos);
- }
- return 0;
- }
- return super.getLengthToReformatAfter(node, insertPos);
- }
-
- /**
- *
- * @return int
- * @param node
- * org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param insertPos
- * int
- */
- public int getLengthToReformatBefore(ICSSNode node, int insertPos) {
- if (node == null)
- return 0;
- IndexedRegion nnode = (IndexedRegion) node;
- if (insertPos <= 0 || !nnode.contains(insertPos - 1)) {
- if (node.getParentNode() != null && nnode.getEndOffset() <= 0) {
- CSSSourceGenerator pntFormatter = getParentFormatter(node);
- if (pntFormatter != null)
- return pntFormatter.getLengthToReformatBefore(node.getParentNode(), insertPos);
- }
- return 0;
- }
- return super.getLengthToReformatBefore(node, insertPos);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java
deleted file mode 100644
index fca98b4463..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleRuleFormatter.java
+++ /dev/null
@@ -1,166 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSAttr;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class StyleRuleFormatter extends DeclContainerFormatter {
-
- private static StyleRuleFormatter instance;
-
- /**
- *
- */
- StyleRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- public StringBuffer formatAttrChanged(ICSSNode node, ICSSAttr attr, boolean insert, AttrChangeContext context) {
- StringBuffer buf = new StringBuffer();
- if (node == null || attr == null)
- return buf;
-
- if (!ICSSStyleRule.SELECTOR.equalsIgnoreCase(attr.getName()))
- return buf;
-
- // get region to replace
- if (context != null && ((IndexedRegion) node).getEndOffset() > 0) {
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0) {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) attr).getEndOffset() - 1);
- RegionIterator it = new RegionIterator(flatNode, region);
- it.next();
- if (it.hasNext()) {
- ITextRegion next = it.next();
- if (next.getType() == CSSRegionContexts.CSS_S)
- context.end = it.getStructuredDocumentRegion().getEndOffset(next);
- else
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- }
- else
- context.end = it.getStructuredDocumentRegion().getEndOffset(region);
- context.start = it.getStructuredDocumentRegion().getStartOffset(region);
- }
- else {
- IStructuredDocumentRegion flatNode = node.getOwnerDocument().getModel().getStructuredDocument().getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
- ITextRegion region = flatNode.getRegionAtCharacterOffset(((IndexedRegion) node).getStartOffset());
- if (region.getType() == CSSRegionContexts.CSS_S) {
- context.start = flatNode.getStartOffset(region);
- context.end = flatNode.getEndOffset(region);
- }
- else {
- context.start = flatNode.getEndOffset();
- context.end = flatNode.getEndOffset();
- }
- }
- }
- // generate text
- if (insert) {
- buf.append(attr.getValue());
- appendSpaceBefore(node, "", buf);//$NON-NLS-1$
- }
- return buf;
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
- if (end > 0) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBetween(node, regions[i - 1], regions[i], source);
- source.append(decoratedSelectorRegion(regions[i], (i != 0) ? regions[i - 1] : null, stgy));
- }
- }
- else { // generate source
- String str = ((ICSSStyleRule) node).getSelectorText();
- // appendSpaceBefore(node,str,source);
- source.append(str);
- appendSpaceBefore(node, "{", source);//$NON-NLS-1$
- source.append("{");//$NON-NLS-1$
- }
- appendDelimBefore(node, null, source);
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBetween(node, (i == 0) ? outside[0] : regions[i - 1], regions[i], source);
- source.append(decoratedSelectorRegion(regions[i], (i != 0) ? regions[i - 1] : null, stgy));
- }
- if (needS(outside[1])) {
- if (isIncludesPreEnd(node, region))
- appendDelimBefore(node, null, source);
- else
- appendSpaceBetween(node, regions[regions.length - 1], outside[1], source);
- }
- }
-
- /**
- *
- */
- public int getAttrInsertPos(ICSSNode node, String attrName) {
- if (node == null || attrName == null || attrName.length() == 0)
- return -1;
-
- if (!ICSSStyleRule.SELECTOR.equalsIgnoreCase(attrName))
- return -1;
-
- ICSSAttr attr = (ICSSAttr) node.getAttributes().getNamedItem(ICSSStyleRule.SELECTOR);
- if (attr != null && ((IndexedRegion) attr).getEndOffset() > 0)
- return ((IndexedRegion) attr).getStartOffset();
- else
- return ((IndexedRegion) node).getStartOffset();
- }
-
- /**
- *
- */
- public synchronized static StyleRuleFormatter getInstance() {
- if (instance == null)
- instance = new StyleRuleFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java
deleted file mode 100644
index 0d83caa211..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/StyleSheetFormatter.java
+++ /dev/null
@@ -1,260 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-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.RegionIterator;
-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;
-
-
-/**
- *
- */
-public class StyleSheetFormatter extends AbstractCSSSourceFormatter {
-
- private static StyleSheetFormatter instance;
-
- /**
- *
- */
- StyleSheetFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, String toAppend, StringBuffer source, IRegion exceptFor) {
- String delim = getLineDelimiter(node);
- ICSSNode prev = (child != null) ? child.getPreviousSibling() : node.getLastChild();
- if (prev == null && child == null)
- return;
- int start = (prev != null) ? ((IndexedRegion) prev).getEndOffset() : 0;
- int end = (child != null) ? ((IndexedRegion) child).getStartOffset() : 0;
- if (start > 0 && start < end) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- // get meaning regions
- CompoundRegion[] regions = null;
- if (exceptFor == null)
- regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- else {
- String pickupType = CSSRegionContexts.CSS_DELIMITER;
- if (prev == null)
- pickupType = null;
- regions = getRegions(structuredDocument, new FormatRegion(start, end - start), exceptFor, pickupType);
- }
- // generate source
- if (prev != null) {
- appendDelimBefore(node, (regions.length > 0) ? regions[0] : null, source);
- }
- for (int i = 0; i < regions.length; i++) {
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must
- // be
- // comments
- // or
- // semi_colon
- if (regions[i].getType() == CSSRegionContexts.CSS_DELIMITER) {
- // append delim after
- appendDelimBefore(node, null, source);
- }
- }
- if (prev != null)
- appendDelimBefore(node, null, source);
- }
- else if (prev != null && child != null) { // source generation :
- // between two rules
- source.append(delim);
- source.append(delim);
- }
- else if (((IndexedRegion) node).getEndOffset() > 0) {
- if (prev == null) { // source formatting : before the first rule
- ICSSNode next = child.getNextSibling();
- int pos = getChildInsertPos(node);
- if (next != null && ((IndexedRegion) next).getEndOffset() > 0)
- pos = ((IndexedRegion) next).getStartOffset();
- if (pos != 0) {
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] prevRegions = getRegions(structuredDocument, new FormatRegion(0, pos), null, null);
- if (prevRegions != null && prevRegions.length > 0)
- appendDelimBefore(node, null, source);
- }
- }
- else if (child == null) { // source formatting : after the last
- // rule
- if (start > 0 && start <= ((IndexedRegion) node).getEndOffset()) {
- appendDelimBefore(node, null, source);
- }
- else if (start <= 0) {
- int pos = getChildInsertPos(node);
- if (pos < ((IndexedRegion) node).getEndOffset()) {
- appendDelimBefore(node, null, source);
- }
- }
- }
- }
- }
-
- /**
- *
- */
- protected void formatBefore(ICSSNode node, ICSSNode child, IRegion region, String toAppend, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy)); // must be
- // comments
- }
- if (needS(outside[1])) {
- if (((IndexedRegion) child).getStartOffset() == region.getOffset() + region.getLength())
- appendDelimBefore(node, null, source);
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, StringBuffer source) {
- int end = ((IndexedRegion) node).getEndOffset();
- int start = (node.getLastChild() != null && ((IndexedRegion) node.getLastChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getLastChild()).getEndOffset() : getChildInsertPos(node);
- if (end > 0 && start < end) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- if ((regions != null && regions.length > 0 && regions[regions.length - 1].getType() == CSSRegionContexts.CSS_CDC) || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
- appendDelimBefore(node, null, source);
- }
- else { // source generation
- if (node.getOwnerDocument().getModel() != null && node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
- appendDelimBefore(node, null, source);
- return; // nothing
- }
- }
-
- /**
- *
- */
- protected void formatPost(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- }
-
- /**
- *
- */
- protected void formatPre(org.eclipse.wst.css.core.internal.provisional.document.ICSSNode node, java.lang.StringBuffer source) {
- int start = ((IndexedRegion) node).getStartOffset();
- int end = (node.getFirstChild() != null && ((IndexedRegion) node.getFirstChild()).getEndOffset() > 0) ? ((IndexedRegion) node.getFirstChild()).getStartOffset() : getChildInsertPos(node);
- if (end > 0) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || regions[i].getType() == CSSRegionContexts.CSS_CDO || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- if (node.getLastChild() != null && (source.length() > 0 || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)) {
- appendDelimBefore(node, null, source);
- }
- }
- else if (node.getOwnerDocument().getModel() != null && node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
- appendDelimBefore(node, null, source);
- // source.append("<!--");
- // appendDelimBefore(node,null, source);
- }
- else
- return; // nothing
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, java.lang.StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]) || regions[i].getType() == CSSRegionContexts.CSS_CDO || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED)
- appendDelimBefore(node, regions[i], source);
- source.append(decoratedRegion(regions[i], 0, stgy));
- }
- if (needS(outside[1])) {
- if (isIncludesPreEnd(node, region)) {
- if (source.length() > 0 || node.getOwnerDocument().getModel().getStyleSheetType() == ICSSModel.EMBEDDED) {
- String delim = getLineDelimiter(node);
- source.append(delim);
- }
- }
- }
- }
-
- /**
- *
- */
- public int getChildInsertPos(ICSSNode node) {
- int n = ((IndexedRegion) node).getEndOffset();
- if (n > 0) {
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- IStructuredDocumentRegion flatNode = structuredDocument.getRegionAtCharacterOffset(n - 1);
- ITextRegion region = flatNode.getRegionAtCharacterOffset(n - 1);
- RegionIterator it = new RegionIterator(flatNode, region);
- while (it.hasPrev()) {
- ITextRegion reg = it.prev();
- if (reg.getType() == CSSRegionContexts.CSS_CDC)
- return it.getStructuredDocumentRegion().getStartOffset(reg);
- }
- return n;
- }
- return -1;
- }
-
- /**
- *
- */
- public synchronized static StyleSheetFormatter getInstance() {
- if (instance == null)
- instance = new StyleSheetFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java
deleted file mode 100644
index 81abef8adc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/formatter/UnknownRuleFormatter.java
+++ /dev/null
@@ -1,86 +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.css.core.internal.formatter;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.cleanup.CSSCleanupStrategy;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.css.CSSUnknownRule;
-
-
-/**
- *
- */
-public class UnknownRuleFormatter extends DefaultCSSSourceFormatter {
-
- private static UnknownRuleFormatter instance;
-
- /**
- *
- */
- UnknownRuleFormatter() {
- super();
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- int start = ((IndexedRegion) node).getStartOffset();
- int end = ((IndexedRegion) node).getEndOffset();
- if (end > 0) { // format source
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, new FormatRegion(start, end - start), stgy);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0)
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- }
- else { // generate source
- CSSUnknownRule rule = (CSSUnknownRule) node;
- source.append(rule.getCssText());
- }
- }
-
- /**
- *
- */
- protected void formatPre(ICSSNode node, IRegion region, StringBuffer source) {
- CSSCleanupStrategy stgy = getCleanupStrategy(node);
-
- IStructuredDocument structuredDocument = node.getOwnerDocument().getModel().getStructuredDocument();
- CompoundRegion[] regions = getRegionsWithoutWhiteSpaces(structuredDocument, region, stgy);
- CompoundRegion[] outside = getOutsideRegions(structuredDocument, region);
- for (int i = 0; i < regions.length; i++) {
- if (i != 0 || needS(outside[0]))
- appendSpaceBefore(node, regions[i], source);
- source.append(decoratedPropValueRegion(regions[i], stgy));
- }
- if (needS(outside[1]) && !isIncludesPreEnd(node, region))
- appendSpaceBefore(node, outside[1], source);
- }
-
- /**
- *
- */
- public synchronized static UnknownRuleFormatter getInstance() {
- if (instance == null)
- instance = new UnknownRuleFormatter();
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java
deleted file mode 100644
index 12ac146214..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCategory.java
+++ /dev/null
@@ -1,16 +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.css.core.internal.metamodel;
-
-public interface CSSMMCategory extends CSSMMNode {
-
- String getCaption();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java
deleted file mode 100644
index d86d46960e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMCharsetRule.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMCharsetRule extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java
deleted file mode 100644
index cedb5d5040..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMContainer.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMContainer extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java
deleted file mode 100644
index 88797925f2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMDescriptor.java
+++ /dev/null
@@ -1,20 +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.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMMDescriptor extends CSSMMNode {
-
- Iterator getValues();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java
deleted file mode 100644
index 0e8dff2506..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFontFaceRule.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMFontFaceRule extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java
deleted file mode 100644
index 9be706e34a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMFunction.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMFunction extends CSSMMNode {
-
- String getFunctionString();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java
deleted file mode 100644
index c6bd2afc42..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMImportRule.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMImportRule extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java
deleted file mode 100644
index 60837fff2b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMKeyword.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMKeyword extends CSSMMNode {
-
- String getKeywordString();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java
deleted file mode 100644
index e16b7d9c4e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMMediaRule.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMMediaRule extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.java
deleted file mode 100644
index c6a5866d75..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNode.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.wst.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMMNode {
- String getType();
-
- String getName();
-
- String getDescription();
-
- String getAttribute(String name);
-
- Iterator getChildNodes();
-
- Iterator getDescendants();
-
-
- static final String _PREFIX = "CSSMM."; //$NON-NLS-1$
- static final String TYPE_KEYWORD = _PREFIX + "Keyword"; //$NON-NLS-1$
- static final String TYPE_UNIT = _PREFIX + "Unit"; //$NON-NLS-1$
- static final String TYPE_FUNCTION = _PREFIX + "Function"; //$NON-NLS-1$
- static final String TYPE_STRING = _PREFIX + "String"; //$NON-NLS-1$
- static final String TYPE_STYLE_SHEET = _PREFIX + "StyleSheet"; //$NON-NLS-1$
- static final String TYPE_PROPERTY = _PREFIX + "Property"; //$NON-NLS-1$
- static final String TYPE_DESCRIPTOR = _PREFIX + "Descriptor"; //$NON-NLS-1$
- static final String TYPE_CONTAINER = _PREFIX + "Container"; //$NON-NLS-1$
- static final String TYPE_NUMBER = _PREFIX + "Number"; //$NON-NLS-1$
- static final String TYPE_SEPARATOR = _PREFIX + "Separator"; //$NON-NLS-1$
- static final String TYPE_CHARSET_RULE = _PREFIX + "CharsetRule"; //$NON-NLS-1$
- static final String TYPE_IMPORT_RULE = _PREFIX + "ImportRule"; //$NON-NLS-1$
- static final String TYPE_STYLE_RULE = _PREFIX + "StyleRule"; //$NON-NLS-1$
- static final String TYPE_MEDIA_RULE = _PREFIX + "MediaRule"; //$NON-NLS-1$
- static final String TYPE_PAGE_RULE = _PREFIX + "PageRule"; //$NON-NLS-1$
- static final String TYPE_FONT_FACE_RULE = _PREFIX + "FontFaceRule"; //$NON-NLS-1$
- static final String TYPE_CATEGORY = _PREFIX + "Category"; //$NON-NLS-1$
- static final String TYPE_META_MODEL = _PREFIX + "MetaModel"; //$NON-NLS-1$
- static final String TYPE_SELECTOR = _PREFIX + "Selector"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java
deleted file mode 100644
index d3c0f5599a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMNumber.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMNumber extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java
deleted file mode 100644
index 57a084535e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMPageRule.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMPageRule extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java
deleted file mode 100644
index c92f7282a3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMProperty.java
+++ /dev/null
@@ -1,22 +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.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMMProperty extends CSSMMNode {
-
- String getCategoryName();
-
- Iterator getValues();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java
deleted file mode 100644
index 543bbcce8c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMSelector.java
+++ /dev/null
@@ -1,29 +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.css.core.internal.metamodel;
-
-public interface CSSMMSelector extends CSSMMNode {
- String getSelectorType();
-
- String getSelectorString();
-
-
- static final String TYPE_EXPRESSION = "Expression"; //$NON-NLS-1$
- static final String TYPE_PSEUDO_CLASS = "PseudoClass"; //$NON-NLS-1$
- static final String TYPE_PSEUDO_ELEMENT = "PseudoElement"; //$NON-NLS-1$
-
- // embedded expression type
- static final String EXPRESSION_DESCENDANT = "descendant"; //$NON-NLS-1$
- static final String EXPRESSION_CHILD = "child"; //$NON-NLS-1$
- static final String EXPRESSION_ADJACENT = "adjacent"; //$NON-NLS-1$
- static final String EXPRESSION_UNIVERSAL = "universal"; //$NON-NLS-1$
- static final String EXPRESSION_ATTRIBUTE = "attribute"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java
deleted file mode 100644
index 6d8374d835..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMString.java
+++ /dev/null
@@ -1,17 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMString extends CSSMMNode {
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java
deleted file mode 100644
index 1ad749b691..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleRule.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMStyleRule extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java
deleted file mode 100644
index 3f8b2a3686..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMStyleSheet.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMStyleSheet extends CSSMMNode {
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java
deleted file mode 100644
index 047d109134..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMMUnit.java
+++ /dev/null
@@ -1,18 +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.css.core.internal.metamodel;
-
-
-
-public interface CSSMMUnit extends CSSMMNode {
-
- String getUnitString();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java
deleted file mode 100644
index 337048de1c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSMetaModel.java
+++ /dev/null
@@ -1,37 +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.css.core.internal.metamodel;
-
-
-
-import java.util.Iterator;
-
-public interface CSSMetaModel extends CSSMMNode {
-
- // public interface CSSMetaModel {
- CSSMMStyleSheet getStyleSheet();
-
- /*
- * Shortcut to access property node
- */
- // Iterator getProperties();
- // Iterator getDescriptors();
- // CSSMMProperty getProperty(String propertyName);
- /*
- * access to category information
- */
- Iterator getCategories();
-
- /*
- * Utilities
- */
- // Iterator collectNodesByType(String type);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java
deleted file mode 100644
index ebdc9fa9f4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfile.java
+++ /dev/null
@@ -1,31 +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.css.core.internal.metamodel;
-
-
-
-import java.net.URL;
-
-
-public interface CSSProfile {
-
- String getProfileID();
-
- String getProfileName();
-
- URL getProfileURL();
-
- CSSMetaModel getMetaModel();
-
- boolean isDefault();
-
- String getOwnerPluginID();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
deleted file mode 100644
index c000cb304d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/CSSProfileRegistry.java
+++ /dev/null
@@ -1,69 +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.css.core.internal.metamodel;
-
-
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodelimpl.RegistryReader;
-
-
-
-public class CSSProfileRegistry {
- public synchronized static CSSProfileRegistry getInstance() {
- if (fInstance == null) {
- fInstance = new CSSProfileRegistry();
- }
- return fInstance;
- }
-
- public Iterator getProfiles() {
- return Collections.unmodifiableCollection(fProfiles.values()).iterator();
- }
-
- public CSSProfile getProfile(String profileID) {
- return (CSSProfile) fProfiles.get(profileID);
- }
-
- public CSSProfile getDefaultProfile() {
- Iterator i = getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- if (profile.isDefault()) {
- return profile;
- }
- }
- return null;
- }
-
- /**
- * Constructor for CSSProfileRegistry.
- */
- private CSSProfileRegistry() {
- super();
- fProfiles = new HashMap();
- Iterator i = new RegistryReader().enumProfiles();
- while (i.hasNext()) {
- Object profile = i.next();
- if (profile instanceof CSSProfile) {
- fProfiles.put(((CSSProfile) profile).getProfileID(), profile);
- }
- }
- }
-
-
- private static CSSProfileRegistry fInstance = null;
- private Map fProfiles = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java
deleted file mode 100644
index 8a4e1659c2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSFunctionID.java
+++ /dev/null
@@ -1,22 +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.css.core.internal.metamodel.util;
-
-public interface CSSFunctionID {
-
- final static String F_ATTR = "attr"; //$NON-NLS-1$
- final static String F_COUNTER = "counter"; //$NON-NLS-1$
- final static String F_RGB = "rgb"; //$NON-NLS-1$
- final static String F_RECT = "rect"; //$NON-NLS-1$
- final static String F_URI = "uri"; //$NON-NLS-1$
- final static String F_FORMAT = "format"; //$NON-NLS-1$
- final static String F_LOCAL = "local"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java
deleted file mode 100644
index b8f898e2a4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSKeywordID.java
+++ /dev/null
@@ -1,261 +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.css.core.internal.metamodel.util;
-
-public interface CSSKeywordID {
-
- final static String K_100 = "100"; //$NON-NLS-1$
- final static String K_200 = "200"; //$NON-NLS-1$
- final static String K_300 = "300"; //$NON-NLS-1$
- final static String K_400 = "400"; //$NON-NLS-1$
- final static String K_500 = "500"; //$NON-NLS-1$
- final static String K_600 = "600"; //$NON-NLS-1$
- final static String K_700 = "700"; //$NON-NLS-1$
- final static String K_800 = "800"; //$NON-NLS-1$
- final static String K_900 = "900"; //$NON-NLS-1$
- final static String K_ABOVE = "above"; //$NON-NLS-1$
- final static String K_ABSOLUTE = "absolute"; //$NON-NLS-1$
- final static String K_ACTIVEBORDER = "ActiveBorder"; //$NON-NLS-1$
- final static String K_ACTIVECAPTION = "ActiveCaption"; //$NON-NLS-1$
- final static String K_ALL = "all"; //$NON-NLS-1$
- final static String K_ALWAYS = "always"; //$NON-NLS-1$
- final static String K_APPWORKSPACE = "AppWorkspace"; //$NON-NLS-1$
- final static String K_AQUA = "aqua"; //$NON-NLS-1$
- final static String K_ARMENIAN = "armenian"; //$NON-NLS-1$
- final static String K_AUTO = "auto"; //$NON-NLS-1$
- final static String K_AVOID = "avoid"; //$NON-NLS-1$
- final static String K_BACKGROUND = "Background"; //$NON-NLS-1$
- final static String K_BASELINE = "baseline"; //$NON-NLS-1$
- final static String K_BEHIND = "behind"; //$NON-NLS-1$
- final static String K_BELOW = "below"; //$NON-NLS-1$
- final static String K_BIDI_OVERRIDE = "bidi-override"; //$NON-NLS-1$
- final static String K_BLACK = "black"; //$NON-NLS-1$
- final static String K_BLINK = "blink"; //$NON-NLS-1$
- final static String K_BLOCK = "block"; //$NON-NLS-1$
- final static String K_BLUE = "blue"; //$NON-NLS-1$
- final static String K_BOLD = "bold"; //$NON-NLS-1$
- final static String K_BOLDER = "bolder"; //$NON-NLS-1$
- final static String K_BOTH = "both"; //$NON-NLS-1$
- final static String K_BOTTOM = "bottom"; //$NON-NLS-1$
- final static String K_BUTTONFACE = "ButtonFace"; //$NON-NLS-1$
- final static String K_BUTTONHIGHLIGHT = "ButtonHighlight"; //$NON-NLS-1$
- final static String K_BUTTONSHADOW = "ButtonShadow"; //$NON-NLS-1$
- final static String K_BUTTONTEXT = "ButtonText"; //$NON-NLS-1$
- final static String K_CAPITALIZE = "capitalize"; //$NON-NLS-1$
- final static String K_CAPTION = "caption"; //$NON-NLS-1$
- final static String K_CAPTIONTEXT = "CaptionText"; //$NON-NLS-1$
- final static String K_CENTER = "center"; //$NON-NLS-1$
- final static String K_CENTER_LEFT = "center-left"; //$NON-NLS-1$
- final static String K_CENTER_RIGHT = "center-right"; //$NON-NLS-1$
- final static String K_CHILD = "child"; //$NON-NLS-1$
- final static String K_CIRCLE = "circle"; //$NON-NLS-1$
- final static String K_CJK_IDEOGRAPHIC = "cjk-ideographic"; //$NON-NLS-1$
- final static String K_CLOSE_QUOTE = "close-quote"; //$NON-NLS-1$
- final static String K_CODE = "code"; //$NON-NLS-1$
- final static String K_CONDENSED = "condensed"; //$NON-NLS-1$
- final static String K_COLLAPSE = "collapse"; //$NON-NLS-1$
- final static String K_COMPACT = "compact"; //$NON-NLS-1$
- final static String K_CONTINUOUS = "continuous"; //$NON-NLS-1$
- final static String K_CROP = "crop"; //$NON-NLS-1$
- final static String K_CROSS = "cross"; //$NON-NLS-1$
- final static String K_CROSSHAIR = "crosshair"; //$NON-NLS-1$
- final static String K_CURSIVE = "cursive"; //$NON-NLS-1$
- final static String K_DASHED = "dashed"; //$NON-NLS-1$
- final static String K_DECIMAL = "decimal"; //$NON-NLS-1$
- final static String K_DECIMAL_LEADING_ZERO = "decimal-leading-zero"; //$NON-NLS-1$
- final static String K_DEFAULT = "default"; //$NON-NLS-1$
- final static String K_DIGITS = "digits"; //$NON-NLS-1$
- final static String K_DISC = "disc"; //$NON-NLS-1$
- final static String K_DOTTED = "dotted"; //$NON-NLS-1$
- final static String K_DOUBLE = "double"; //$NON-NLS-1$
- final static String K_E_RESIZE = "e-resize"; //$NON-NLS-1$
- final static String K_EMBED = "embed"; //$NON-NLS-1$
- final static String K_EXPANDED = "expanded"; //$NON-NLS-1$
- final static String K_EXTRA_CONDENSED = "extra-condensed"; //$NON-NLS-1$
- final static String K_EXTRA_EXPANDED = "extra-expanded"; //$NON-NLS-1$
- final static String K_FANTASY = "fantasy"; //$NON-NLS-1$
- final static String K_FAR_LEFT = "far-left"; //$NON-NLS-1$
- final static String K_FAR_RIGHT = "far-right"; //$NON-NLS-1$
- final static String K_FAST = "fast"; //$NON-NLS-1$
- final static String K_FASTER = "faster"; //$NON-NLS-1$
- final static String K_FEMALE = "female"; //$NON-NLS-1$
- final static String K_FIXED = "fixed"; //$NON-NLS-1$
- final static String K_FUCHSIA = "fuchsia"; //$NON-NLS-1$
- final static String K_GEORGIAN = "georgian"; //$NON-NLS-1$
- final static String K_GRAY = "gray"; //$NON-NLS-1$
- final static String K_GRAYTEXT = "GrayText"; //$NON-NLS-1$
- final static String K_GREEN = "green"; //$NON-NLS-1$
- final static String K_GROOVE = "groove"; //$NON-NLS-1$
- final static String K_HEBREW = "hebrew"; //$NON-NLS-1$
- final static String K_HELP = "help"; //$NON-NLS-1$
- final static String K_HIDDEN = "hidden"; //$NON-NLS-1$
- final static String K_HIDE = "hide"; //$NON-NLS-1$
- final static String K_HIGH = "high"; //$NON-NLS-1$
- final static String K_HIGHLIGHT = "Highlight"; //$NON-NLS-1$
- final static String K_HIGHLIGHTTEXT = "HighlightText"; //$NON-NLS-1$
- final static String K_HIGHER = "higher"; //$NON-NLS-1$
- final static String K_HIRAGANA = "hiragana"; //$NON-NLS-1$
- final static String K_HIRAGANA_IROHA = "hiragana-iroha"; //$NON-NLS-1$
- final static String K_ICON = "icon"; //$NON-NLS-1$
- final static String K_INACTIVEBORDER = "InactiveBorder"; //$NON-NLS-1$
- final static String K_INACTIVECAPTION = "InactiveCaption"; //$NON-NLS-1$
- final static String K_INACTIVECAPTIONTEXT = "InactiveCaptionText"; //$NON-NLS-1$
- final static String K_INFOBACKGROUND = "InfoBackground"; //$NON-NLS-1$
- final static String K_INFOTEXT = "InfoText"; //$NON-NLS-1$
- final static String K_INLINE = "inline"; //$NON-NLS-1$
- final static String K_INLINE_TABLE = "inline-table"; //$NON-NLS-1$
- final static String K_INSET = "inset"; //$NON-NLS-1$
- final static String K_INSIDE = "inside"; //$NON-NLS-1$
- final static String K_INVERT = "invert"; //$NON-NLS-1$
- final static String K_ITALIC = "italic"; //$NON-NLS-1$
- final static String K_JUSTIFY = "justify"; //$NON-NLS-1$
- final static String K_KATAKANA = "katakana"; //$NON-NLS-1$
- final static String K_KATAKANA_IROHA = "katakana-iroha"; //$NON-NLS-1$
- final static String K_LANDSCAPE = "landscape"; //$NON-NLS-1$
- final static String K_LARGE = "large"; //$NON-NLS-1$
- final static String K_LARGER = "larger"; //$NON-NLS-1$
- final static String K_LEFT = "left"; //$NON-NLS-1$
- final static String K_LEFT_SIDE = "left-side"; //$NON-NLS-1$
- final static String K_LEFTWARDS = "leftwards"; //$NON-NLS-1$
- final static String K_LEVEL = "level"; //$NON-NLS-1$
- final static String K_LIGHTER = "lighter"; //$NON-NLS-1$
- final static String K_LIME = "lime"; //$NON-NLS-1$
- final static String K_LINE_THROUGH = "line-through"; //$NON-NLS-1$
- final static String K_LIST_ITEM = "list-item"; //$NON-NLS-1$
- final static String K_LOUD = "loud"; //$NON-NLS-1$
- final static String K_LOW = "low"; //$NON-NLS-1$
- final static String K_LOWER = "lower"; //$NON-NLS-1$
- final static String K_LOWER_ALPHA = "lower-alpha"; //$NON-NLS-1$
- final static String K_LOWER_GREEK = "lower-greek"; //$NON-NLS-1$
- final static String K_LOWER_LATIN = "lower-latin"; //$NON-NLS-1$
- final static String K_LOWER_ROMAN = "lower-roman"; //$NON-NLS-1$
- final static String K_LOWERCASE = "lowercase"; //$NON-NLS-1$
- final static String K_LTR = "ltr"; //$NON-NLS-1$
- final static String K_MALE = "male"; //$NON-NLS-1$
- final static String K_MARKER = "marker"; //$NON-NLS-1$
- final static String K_MAROON = "maroon"; //$NON-NLS-1$
- final static String K_MEDIUM = "medium"; //$NON-NLS-1$
- final static String K_MENU = "menu"; //$NON-NLS-1$
- final static String K_MENUTEXT = "MenuText"; //$NON-NLS-1$
- final static String K_MESSAGE_BOX = "message-box"; //$NON-NLS-1$
- final static String K_MIDDLE = "middle"; //$NON-NLS-1$
- final static String K_MIX = "mix"; //$NON-NLS-1$
- final static String K_MONOSPACE = "monospace"; //$NON-NLS-1$
- final static String K_MOVE = "move"; //$NON-NLS-1$
- final static String K_N_RESIZE = "n-resize"; //$NON-NLS-1$
- final static String K_NARROWER = "narrower"; //$NON-NLS-1$
- final static String K_NAVY = "navy"; //$NON-NLS-1$
- final static String K_NE_RESIZE = "ne-resize"; //$NON-NLS-1$
- final static String K_NO_CLOSE_QUOTE = "no-close-quote"; //$NON-NLS-1$
- final static String K_NO_OPEN_QUOTE = "no-open-quote"; //$NON-NLS-1$
- final static String K_NO_REPEAT = "no-repeat"; //$NON-NLS-1$
- final static String K_NONE = "none"; //$NON-NLS-1$
- final static String K_NORMAL = "normal"; //$NON-NLS-1$
- final static String K_NOWRAP = "nowrap"; //$NON-NLS-1$
- final static String K_NW_RESIZE = "nw-resize"; //$NON-NLS-1$
- final static String K_OBLIQUE = "oblique"; //$NON-NLS-1$
- final static String K_OLIVE = "olive"; //$NON-NLS-1$
- final static String K_ONCE = "once"; //$NON-NLS-1$
- final static String K_OPEN_QUOTE = "open-quote"; //$NON-NLS-1$
- final static String K_OUTSET = "outset"; //$NON-NLS-1$
- final static String K_OUTSIDE = "outside"; //$NON-NLS-1$
- final static String K_OVERLINE = "overline"; //$NON-NLS-1$
- final static String K_POINTER = "pointer"; //$NON-NLS-1$
- final static String K_PORTRAIT = "portrait"; //$NON-NLS-1$
- final static String K_PRE = "pre"; //$NON-NLS-1$
- final static String K_PURPLE = "purple"; //$NON-NLS-1$
- final static String K_RED = "red"; //$NON-NLS-1$
- final static String K_RELATIVE = "relative"; //$NON-NLS-1$
- final static String K_REPEAT = "repeat"; //$NON-NLS-1$
- final static String K_REPEAT_X = "repeat-x"; //$NON-NLS-1$
- final static String K_REPEAT_Y = "repeat-y"; //$NON-NLS-1$
- final static String K_RIDGE = "ridge"; //$NON-NLS-1$
- final static String K_RIGHT = "right"; //$NON-NLS-1$
- final static String K_RIGHT_SIDE = "right-side"; //$NON-NLS-1$
- final static String K_RIGHTWARDS = "rightwards"; //$NON-NLS-1$
- final static String K_RTL = "rtl"; //$NON-NLS-1$
- final static String K_RUN_IN = "run-in"; //$NON-NLS-1$
- final static String K_S_RESIZE = "s-resize"; //$NON-NLS-1$
- final static String K_SANS_SERIF = "sans-serif"; //$NON-NLS-1$
- final static String K_SCROLL = "scroll"; //$NON-NLS-1$
- final static String K_SCROLLBAR = "Scrollbar"; //$NON-NLS-1$
- final static String K_SE_RESIZE = "se-resize"; //$NON-NLS-1$
- final static String K_SEMI_CONDENSED = "semi-condensed"; //$NON-NLS-1$
- final static String K_SEMI_EXPANDED = "semi-expanded"; //$NON-NLS-1$
- final static String K_SEPARATE = "separate"; //$NON-NLS-1$
- final static String K_SERIF = "serif"; //$NON-NLS-1$
- final static String K_SHOW = "show"; //$NON-NLS-1$
- final static String K_SILENT = "silent"; //$NON-NLS-1$
- final static String K_SILVER = "silver"; //$NON-NLS-1$
- final static String K_SLOW = "slow"; //$NON-NLS-1$
- final static String K_SLOWER = "slower"; //$NON-NLS-1$
- final static String K_SMALL = "small"; //$NON-NLS-1$
- final static String K_SMALL_CAPS = "small-caps"; //$NON-NLS-1$
- final static String K_SMALL_CAPTION = "small-caption"; //$NON-NLS-1$
- final static String K_SMALLER = "smaller"; //$NON-NLS-1$
- final static String K_SOFT = "soft"; //$NON-NLS-1$
- final static String K_SOLID = "solid"; //$NON-NLS-1$
- final static String K_SPELL_OUT = "spell-out"; //$NON-NLS-1$
- final static String K_SQUARE = "square"; //$NON-NLS-1$
- final static String K_STATIC = "static"; //$NON-NLS-1$
- final static String K_STATUS_BAR = "status-bar"; //$NON-NLS-1$
- final static String K_SUB = "sub"; //$NON-NLS-1$
- final static String K_SUPER = "super"; //$NON-NLS-1$
- final static String K_SW_RESIZE = "sw-resize"; //$NON-NLS-1$
- final static String K_TABLE = "table"; //$NON-NLS-1$
- final static String K_TABLE_CAPTION = "table-caption"; //$NON-NLS-1$
- final static String K_TABLE_CELL = "table-cell"; //$NON-NLS-1$
- final static String K_TABLE_COLUMN = "table-column"; //$NON-NLS-1$
- final static String K_TABLE_COLUMN_GROUP = "table-column-group"; //$NON-NLS-1$
- final static String K_TABLE_FOOTER_GROUP = "table-footer-group"; //$NON-NLS-1$
- final static String K_TABLE_HEADER_GROUP = "table-header-group"; //$NON-NLS-1$
- final static String K_TABLE_ROW = "table-row"; //$NON-NLS-1$
- final static String K_TABLE_ROW_GROUP = "table-row-group"; //$NON-NLS-1$
- final static String K_TEAL = "teal"; //$NON-NLS-1$
- final static String K_TEXT = "text"; //$NON-NLS-1$
- final static String K_TEXT_TOP = "text-top"; //$NON-NLS-1$
- final static String K_TEXT_BOTTOM = "text-bottom"; //$NON-NLS-1$
- final static String K_THICK = "thick"; //$NON-NLS-1$
- final static String K_THIN = "thin"; //$NON-NLS-1$
- final static String K_THREEDDARKSHADOW = "ThreeDDarkShadow"; //$NON-NLS-1$
- final static String K_THREEDFACE = "ThreeDFace"; //$NON-NLS-1$
- final static String K_THREEDHIGHLIGHT = "ThreeDHighlight"; //$NON-NLS-1$
- final static String K_THREEDLIGHTSHADOW = "ThreeDLightShadow"; //$NON-NLS-1$
- final static String K_THREEDSHADOW = "ThreeDShadow"; //$NON-NLS-1$
- final static String K_TOP = "top"; //$NON-NLS-1$
- final static String K_TRANSPARENT = "transparent"; //$NON-NLS-1$
- final static String K_ULTRA_CONDENSED = "ultra-condensed"; //$NON-NLS-1$
- final static String K_ULTRA_EXPANDED = "ultra-expanded"; //$NON-NLS-1$
- final static String K_UNDERLINE = "underline"; //$NON-NLS-1$
- final static String K_UPPER_ALPHA = "upper-alpha"; //$NON-NLS-1$
- final static String K_UPPER_LATIN = "upper-latin"; //$NON-NLS-1$
- final static String K_UPPER_ROMAN = "upper-roman"; //$NON-NLS-1$
- final static String K_UPPERCASE = "uppercase"; //$NON-NLS-1$
- final static String K_VISIBLE = "visible"; //$NON-NLS-1$
- final static String K_W_RESIZE = "w-resize"; //$NON-NLS-1$
- final static String K_WAIT = "wait"; //$NON-NLS-1$
- final static String K_WHITE = "white"; //$NON-NLS-1$
- final static String K_WIDER = "wider"; //$NON-NLS-1$
- final static String K_WINDOW = "Window"; //$NON-NLS-1$
- final static String K_WINDOWFRAME = "WindowFrame"; //$NON-NLS-1$
- final static String K_WINDOWTEXT = "WindowText"; //$NON-NLS-1$
- final static String K_X_FAST = "x-fast"; //$NON-NLS-1$
- final static String K_X_HIGH = "x-high"; //$NON-NLS-1$
- final static String K_X_LARGE = "x-large"; //$NON-NLS-1$
- final static String K_X_LOUD = "x-loud"; //$NON-NLS-1$
- final static String K_X_LOW = "x-low"; //$NON-NLS-1$
- final static String K_X_SLOW = "x-slow"; //$NON-NLS-1$
- final static String K_X_SMALL = "x-small"; //$NON-NLS-1$
- final static String K_X_SOFT = "x-soft"; //$NON-NLS-1$
- final static String K_XX_SMALL = "xx-small"; //$NON-NLS-1$
- final static String K_XX_LARGE = "xx-large"; //$NON-NLS-1$
- final static String K_YELLOW = "yellow"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java
deleted file mode 100644
index c26805cff6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMMTypeCollector.java
+++ /dev/null
@@ -1,62 +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.css.core.internal.metamodel.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-public class CSSMMTypeCollector extends CSSMetaModelTraverser {
-
- /**
- * Constructor for TypeCollector.
- */
- public CSSMMTypeCollector() {
- super();
- }
-
- public void apply(CSSMMNode node, String type) {
- fType = type;
- fNodes = new ArrayList();
- apply(node);
- }
-
- public void collectNestedType(boolean nested) {
- fNested = nested;
- }
-
- protected short preNode(CSSMMNode node) {
- short rc = TRAV_CONT;
- if (node != null) {
- if (fType == node.getType()) {
- if (!fNodes.contains(node)) {
- fNodes.add(node);
- }
- if (!fNested) {
- rc = TRAV_PRUNE;
- }
- }
- }
- return rc;
- }
-
- public Iterator getNodes() {
- return fNodes.iterator();
- }
-
-
- private boolean fNested = false;
- private String fType = null;
- List fNodes = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java
deleted file mode 100644
index b78cf7e8f6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMediaGroupID.java
+++ /dev/null
@@ -1,29 +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.css.core.internal.metamodel.util;
-
-public interface CSSMediaGroupID {
-
- final static String M_CONTINUOUS = "continuous"; //$NON-NLS-1$
- final static String M_PAGED = "paged"; //$NON-NLS-1$
-
- final static String M_VISUAL = "visual"; //$NON-NLS-1$
- final static String M_AURAL = "aural"; //$NON-NLS-1$
- final static String M_TACTILE = "tactile"; //$NON-NLS-1$
-
- final static String M_GRID = "grid"; //$NON-NLS-1$
- final static String M_BITMAP = "bitmap"; //$NON-NLS-1$
-
- final static String M_INTERACTIVE = "interactive"; //$NON-NLS-1$
- final static String M_STATIC = "static"; //$NON-NLS-1$
-
- final static String M_ALL = "all"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.java
deleted file mode 100644
index 75da697df2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelFinder.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.wst.css.core.internal.metamodel.util;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-
-public class CSSMetaModelFinder {
- /**
- * Constructor for CSSMetaModelFinder.
- */
- private CSSMetaModelFinder() {
- super();
- }
-
- static synchronized public CSSMetaModelFinder getInstance() {
- if (fInstance == null) {
- fInstance = new CSSMetaModelFinder();
- }
- return fInstance;
- }
-
- public CSSMetaModel findMetaModelFor(ICSSNode node) {
- return CSSProfileFinder.getInstance().findProfileFor(node).getMetaModel();
- }
-
- public CSSMetaModel findMetaModelFor(IStructuredModel model) {
- return CSSProfileFinder.getInstance().findProfileFor(model).getMetaModel();
-
- }
-
- // findMetaModelFor(Node) is not used.
- // Even if it is used, it can be replaced with
- // findMetaModelFor(IStructuredModel) easily
-
- public CSSMetaModel findMetaModelFor(String baseLocation) {
- return CSSProfileFinder.getInstance().findProfileFor(baseLocation).getMetaModel();
- }
-
- static private CSSMetaModelFinder fInstance = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java
deleted file mode 100644
index cabedfe569..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelTraverser.java
+++ /dev/null
@@ -1,92 +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.css.core.internal.metamodel.util;
-
-import java.util.Iterator;
-import java.util.Stack;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-
-abstract public class CSSMetaModelTraverser {
-
- /**
- * Constructor for Traverser.
- */
- public CSSMetaModelTraverser() {
- super();
- }
-
- public final void apply(CSSMMNode node) {
- fTravStack = new Stack();
-
- begin(node);
- traverse(node);
- end(node);
- }
-
- private final short traverse(CSSMMNode node) {
- if (node == null) {
- return TRAV_CONT;
- }
-
- fTravStack.push(node);
-
- short rc;
- rc = preNode(node);
-
- if (rc == TRAV_CONT) {
- Iterator i = node.getChildNodes();
- while (i.hasNext()) {
- CSSMMNode child = (CSSMMNode) i.next();
- short rcChild = traverse(child);
- if (rcChild == TRAV_STOP) {
- fTravStack.pop();
- return TRAV_STOP;
- }
- }
- }
- else if (rc == TRAV_STOP) {
- fTravStack.pop();
- return TRAV_STOP;
- }
-
- rc = postNode(node);
-
- fTravStack.pop();
- return (rc == TRAV_PRUNE) ? TRAV_CONT : rc;
- }
-
- protected void begin(CSSMMNode node) {
-
- }
-
- protected void end(CSSMMNode node) {
-
- }
-
- protected short preNode(CSSMMNode node) {
- return TRAV_CONT;
- }
-
- protected short postNode(CSSMMNode node) {
- return TRAV_CONT;
- }
-
-
- Stack fTravStack = null;
-
- protected static final short TRAV_CONT = 0;
- protected static final short TRAV_STOP = 1;
- protected static final short TRAV_PRUNE = 2;
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java
deleted file mode 100644
index 33a75ca9aa..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSMetaModelUtil.java
+++ /dev/null
@@ -1,120 +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.css.core.internal.metamodel.util;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-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.ICSSStyleRule;
-import org.w3c.dom.css.CSSFontFaceRule;
-
-
-public class CSSMetaModelUtil {
- public CSSMetaModelUtil(CSSMetaModel metamodel) {
- super();
- fMetaModel = metamodel;
- }
-
- public Iterator getProperties() {
- return collectNodesByType(CSSMMNode.TYPE_PROPERTY);
- }
-
- public Iterator getDescriptors() {
- return collectNodesByType(CSSMMNode.TYPE_DESCRIPTOR);
- }
-
- public Iterator collectNodesByType(String type) {
- CSSMMTypeCollector collector = new CSSMMTypeCollector();
- collector.apply(fMetaModel, type);
- return collector.getNodes();
- }
-
- public CSSMMProperty getProperty(String propertyName) {
- Iterator iProperty = getProperties();
- while (iProperty.hasNext()) {
- CSSMMNode node = (CSSMMNode) iProperty.next();
- if (node.getName().equalsIgnoreCase(propertyName)) {
- return (CSSMMProperty) node;
- }
- }
- return null;
- }
-
- public CSSMMDescriptor getDescriptor(String descriptorName) {
- Iterator iDescriptor = getDescriptors();
- while (iDescriptor.hasNext()) {
- CSSMMNode node = (CSSMMNode) iDescriptor.next();
- if (node.getName().equalsIgnoreCase(descriptorName)) {
- return (CSSMMDescriptor) node;
- }
- }
- return null;
- }
-
- public CSSMMNode getMetaModelNodeFor(ICSSNode node) {
- if (node instanceof ICSSStyleDeclaration) {
- node = node.getParentNode();
- }
- if (node instanceof ICSSStyleDeclItem) {
- ICSSNode parent = node.getParentNode();
- if (parent != null) {
- parent = parent.getParentNode();
- }
- if (parent instanceof ICSSStyleRule) {
- return getProperty(((ICSSStyleDeclItem) node).getPropertyName());
- }
- else if (parent instanceof CSSFontFaceRule) {
- return getDescriptor(((ICSSStyleDeclItem) node).getPropertyName());
- }
- }
- if (node == null) {
- return null;
- }
-
- if (fTypeMap == null) {
- fTypeMap = new HashMap();
- fTypeMap.put(new Short(ICSSNode.STYLERULE_NODE), CSSMMNode.TYPE_STYLE_RULE);
- fTypeMap.put(new Short(ICSSNode.FONTFACERULE_NODE), CSSMMNode.TYPE_FONT_FACE_RULE);
- fTypeMap.put(new Short(ICSSNode.PAGERULE_NODE), CSSMMNode.TYPE_PAGE_RULE);
- }
-
- String nodeType = (String) fTypeMap.get(new Short(node.getNodeType()));
- if (nodeType == null) {
- return null;
- }
-
- Iterator iNodes = collectNodesByType(nodeType);
- if (iNodes.hasNext()) {
- CSSMMNode targetNode = (CSSMMNode) iNodes.next();
- if (!iNodes.hasNext()) { // it's only one
- return targetNode;
- }
- }
-
- return null;
- }
-
- public CSSMetaModel getMetaModel() {
- return fMetaModel;
- }
-
-
- private CSSMetaModel fMetaModel = null;
- private Map fTypeMap = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java
deleted file mode 100644
index bef698372d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSNumberID.java
+++ /dev/null
@@ -1,23 +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.css.core.internal.metamodel.util;
-
-public interface CSSNumberID {
-
- final static java.lang.String N_ANGLE = "angle";//$NON-NLS-1$
- final static java.lang.String N_FREQUENCY = "frequency";//$NON-NLS-1$
- final static java.lang.String N_INTEGER = "integer";//$NON-NLS-1$
- final static java.lang.String N_LENGTH = "length";//$NON-NLS-1$
- final static java.lang.String N_PERCENTAGE = "percentage";//$NON-NLS-1$
- final static java.lang.String N_TIME = "time";//$NON-NLS-1$
- final static java.lang.String N_HASH = "hash"; //$NON-NLS-1$
- final static java.lang.String N_NUM = "number";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
deleted file mode 100644
index 6d7f528521..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSProfileFinder.java
+++ /dev/null
@@ -1,90 +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.css.core.internal.metamodel.util;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.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.css.core.internal.provisional.document.ICSSDocument;
-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.IStructuredModel;
-
-
-public class CSSProfileFinder {
- /**
- * Constructor for CSSProfileFinder.
- */
- private CSSProfileFinder() {
- super();
- }
-
- static synchronized public CSSProfileFinder getInstance() {
- if (fInstance == null) {
- fInstance = new CSSProfileFinder();
- }
- return fInstance;
- }
-
- public CSSProfile findProfileFor(ICSSNode node) {
- ICSSModel model = null;
- if (node != null) {
- ICSSDocument doc = node.getOwnerDocument();
- if (doc != null) {
- model = doc.getModel();
- }
- }
- return findProfileFor(model);
- }
-
- public CSSProfile findProfileFor(IStructuredModel model) {
- String baseLocation = null;
- if (model instanceof ICSSModel) {
- Object modelType = ((ICSSModel) model).getStyleSheetType();
- if (modelType == ICSSModel.EXTERNAL) {
- baseLocation = model.getBaseLocation();
- }
- else if (modelType == ICSSModel.EMBEDDED || modelType == ICSSModel.INLINE) {
- baseLocation = model.getBaseLocation(); // may be null
- }
- }
- else if (model != null) {
- baseLocation = model.getBaseLocation();
- }
- return findProfileFor(baseLocation);
- }
-
- public CSSProfile findProfileFor(String baseLocation) {
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- CSSProfile profile = null;
-
- if (baseLocation != null) {
- IPath path = new Path(baseLocation);
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- if (resource == null && path.segmentCount() > 1)
- resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (resource != null) {
- String profileID = CSSContentProperties.getProperty(CSSContentProperties.CSS_PROFILE, resource, true);
- if (profileID != null && 0 < profileID.length()) {
- profile = reg.getProfile(profileID);
- }
- }
- }
-
- return (profile != null) ? profile : reg.getDefaultProfile();
- }
-
- static private CSSProfileFinder fInstance = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java
deleted file mode 100644
index 550e8e7139..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSPropertyID.java
+++ /dev/null
@@ -1,137 +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.css.core.internal.metamodel.util;
-
-public interface CSSPropertyID {
-
- final static String P_AZIMUTH = "azimuth"; //$NON-NLS-1$
- final static String P_BG = "background"; //$NON-NLS-1$
- final static String P_BG_ATTACHMENT = "background-attachment"; //$NON-NLS-1$
- final static String P_BG_COLOR = "background-color"; //$NON-NLS-1$
- final static String P_BG_IMAGE = "background-image"; //$NON-NLS-1$
- final static String P_BG_POSITION = "background-position"; //$NON-NLS-1$
- final static String P_BG_REPEAT = "background-repeat"; //$NON-NLS-1$
- final static String P_BORDER = "border"; //$NON-NLS-1$
- final static String P_BORDER_COLLAPSE = "border-collapse"; //$NON-NLS-1$
- final static String P_BORDER_COLOR = "border-color"; //$NON-NLS-1$
- final static String P_BORDER_SPACING = "border-spacing"; //$NON-NLS-1$
- final static String P_BORDER_STYLE = "border-style"; //$NON-NLS-1$
- final static String P_BORDER_TOP = "border-top"; //$NON-NLS-1$
- final static String P_BORDER_RIGHT = "border-right"; //$NON-NLS-1$
- final static String P_BORDER_BOTTOM = "border-bottom"; //$NON-NLS-1$
- final static String P_BORDER_LEFT = "border-left"; //$NON-NLS-1$
- final static String P_BORDER_TOP_COLOR = "border-top-color"; //$NON-NLS-1$
- final static String P_BORDER_RIGHT_COLOR = "border-right-color"; //$NON-NLS-1$
- final static String P_BORDER_BOTTOM_COLOR = "border-bottom-color"; //$NON-NLS-1$
- final static String P_BORDER_LEFT_COLOR = "border-left-color"; //$NON-NLS-1$
- final static String P_BORDER_TOP_STYLE = "border-top-style"; //$NON-NLS-1$
- final static String P_BORDER_RIGHT_STYLE = "border-right-style"; //$NON-NLS-1$
- final static String P_BORDER_BOTTOM_STYLE = "border-bottom-style"; //$NON-NLS-1$
- final static String P_BORDER_LEFT_STYLE = "border-left-style"; //$NON-NLS-1$
- final static String P_BORDER_TOP_WIDTH = "border-top-width"; //$NON-NLS-1$
- final static String P_BORDER_RIGHT_WIDTH = "border-right-width"; //$NON-NLS-1$
- final static String P_BORDER_BOTTOM_WIDTH = "border-bottom-width"; //$NON-NLS-1$
- final static String P_BORDER_LEFT_WIDTH = "border-left-width"; //$NON-NLS-1$
- final static String P_BORDER_WIDTH = "border-width"; //$NON-NLS-1$
- final static String P_BOTTOM = "bottom"; //$NON-NLS-1$
- final static String P_CAPTION_SIDE = "caption-side"; //$NON-NLS-1$
- final static String P_CLEAR = "clear"; //$NON-NLS-1$
- final static String P_CLIP = "clip"; //$NON-NLS-1$
- final static String P_COLOR = "color"; //$NON-NLS-1$
- final static String P_CONTENT = "content"; //$NON-NLS-1$
- final static String P_COUNTER_INCREMENT = "counter-increment"; //$NON-NLS-1$
- final static String P_COUNTER_RESET = "counter-reset"; //$NON-NLS-1$
- final static String P_CUE = "cue"; //$NON-NLS-1$
- final static String P_CUE_AFTER = "cue-after"; //$NON-NLS-1$
- final static String P_CUE_BEFORE = "cue-before"; //$NON-NLS-1$
- final static String P_CURSOR = "cursor"; //$NON-NLS-1$
- final static String P_DIRECTION = "direction"; //$NON-NLS-1$
- final static String P_DISPLAY = "display"; //$NON-NLS-1$
- final static String P_ELEVATION = "elevation"; //$NON-NLS-1$
- final static String P_EMPTY_CELLS = "empty-cells"; //$NON-NLS-1$
- final static String P_FLOAT = "float"; //$NON-NLS-1$
- final static String P_FONT = "font"; //$NON-NLS-1$
- final static String P_FONT_FAMILY = "font-family"; //$NON-NLS-1$
- final static String P_FONT_SIZE = "font-size"; //$NON-NLS-1$
- final static String P_FONT_SIZE_ADJUST = "font-size-adjust"; //$NON-NLS-1$
- final static String P_FONT_STRETCH = "font-stretch"; //$NON-NLS-1$
- final static String P_FONT_STYLE = "font-style"; //$NON-NLS-1$
- final static String P_FONT_VARIANT = "font-variant"; //$NON-NLS-1$
- final static String P_FONT_WEIGHT = "font-weight"; //$NON-NLS-1$
- final static String P_HEIGHT = "height"; //$NON-NLS-1$
- final static String P_LEFT = "left"; //$NON-NLS-1$
- final static String P_LETTER_SPACING = "letter-spacing"; //$NON-NLS-1$
- final static String P_LINE_HEIGHT = "line-height"; //$NON-NLS-1$
- final static String P_LIST_STYLE = "list-style"; //$NON-NLS-1$
- final static String P_LIST_STYLE_IMAGE = "list-style-image"; //$NON-NLS-1$
- final static String P_LIST_STYLE_POSITION = "list-style-position"; //$NON-NLS-1$
- final static String P_LIST_STYLE_TYPE = "list-style-type"; //$NON-NLS-1$
- final static String P_MARGIN = "margin"; //$NON-NLS-1$
- final static String P_MARGIN_TOP = "margin-top"; //$NON-NLS-1$
- final static String P_MARGIN_RIGHT = "margin-right"; //$NON-NLS-1$
- final static String P_MARGIN_BOTTOM = "margin-bottom"; //$NON-NLS-1$
- final static String P_MARGIN_LEFT = "margin-left"; //$NON-NLS-1$
- final static String P_MARKER_OFFSET = "marker-offset"; //$NON-NLS-1$
- final static String P_MARKS = "marks"; //$NON-NLS-1$
- final static String P_MAX_HEIGHT = "max-height"; //$NON-NLS-1$
- final static String P_MAX_WIDTH = "max-width"; //$NON-NLS-1$
- final static String P_MIN_HEIGHT = "min-height"; //$NON-NLS-1$
- final static String P_MIN_WIDTH = "min-width"; //$NON-NLS-1$
- final static String P_ORPHANS = "orphans"; //$NON-NLS-1$
- final static String P_OUTLINE = "outline"; //$NON-NLS-1$
- final static String P_OUTLINE_COLOR = "outline-color"; //$NON-NLS-1$
- final static String P_OUTLINE_STYLE = "outline-style"; //$NON-NLS-1$
- final static String P_OUTLINE_WIDTH = "outline-width"; //$NON-NLS-1$
- final static String P_OVERFLOW = "overflow"; //$NON-NLS-1$
- final static String P_PADDING = "padding"; //$NON-NLS-1$
- final static String P_PADDING_TOP = "padding-top"; //$NON-NLS-1$
- final static String P_PADDING_RIGHT = "padding-right"; //$NON-NLS-1$
- final static String P_PADDING_BOTTOM = "padding-bottom"; //$NON-NLS-1$
- final static String P_PADDING_LEFT = "padding-left"; //$NON-NLS-1$
- final static String P_PAGE = "page"; //$NON-NLS-1$
- final static String P_PAGE_BREAK_AFTER = "page-break-after"; //$NON-NLS-1$
- final static String P_PAGE_BREAK_BEFORE = "page-break-before"; //$NON-NLS-1$
- final static String P_PAGE_BREAK_INSIDE = "page-break-inside"; //$NON-NLS-1$
- final static String P_PAUSE = "pause"; //$NON-NLS-1$
- final static String P_PAUSE_AFTER = "pause-after"; //$NON-NLS-1$
- final static String P_PAUSE_BEFORE = "pause-before"; //$NON-NLS-1$
- final static String P_PITCH = "pitch"; //$NON-NLS-1$
- final static String P_PITCH_RANGE = "pitch-range"; //$NON-NLS-1$
- final static String P_PLAY_DURING = "play-during"; //$NON-NLS-1$
- final static String P_POSITION = "position"; //$NON-NLS-1$
- final static String P_QUOTES = "quotes"; //$NON-NLS-1$
- final static String P_RICHNESS = "richness"; //$NON-NLS-1$
- final static String P_RIGHT = "right"; //$NON-NLS-1$
- final static String P_SIZE = "size"; //$NON-NLS-1$
- final static String P_SPEAK = "speak"; //$NON-NLS-1$
- final static String P_SPEAK_HEADER = "speak-header"; //$NON-NLS-1$
- final static String P_SPEAK_NUMERAL = "speak-numeral"; //$NON-NLS-1$
- final static String P_SPEAK_PUNCTUATION = "speak-punctuation"; //$NON-NLS-1$
- final static String P_SPEECH_RATE = "speech-rate"; //$NON-NLS-1$
- final static String P_STRESS = "stress"; //$NON-NLS-1$
- final static String P_TABLE_LAYOUT = "table-layout"; //$NON-NLS-1$
- final static String P_TEXT_ALIGN = "text-align"; //$NON-NLS-1$
- final static String P_TEXT_DECORATION = "text-decoration"; //$NON-NLS-1$
- final static String P_TEXT_INDENT = "text-indent"; //$NON-NLS-1$
- final static String P_TEXT_SHADOW = "text-shadow"; //$NON-NLS-1$
- final static String P_TEXT_TRANSFORM = "text-transform"; //$NON-NLS-1$
- final static String P_TOP = "top"; //$NON-NLS-1$
- final static String P_UNICODE_BIDI = "unicode-bidi"; //$NON-NLS-1$
- final static String P_VERTICAL_ALIGN = "vertical-align"; //$NON-NLS-1$
- final static String P_VISIBILITY = "visibility"; //$NON-NLS-1$
- final static String P_VOICE_FAMILY = "voice-family"; //$NON-NLS-1$
- final static String P_VOLUME = "volume"; //$NON-NLS-1$
- final static String P_WHITE_SPACE = "white-space"; //$NON-NLS-1$
- final static String P_WIDOWS = "widows"; //$NON-NLS-1$
- final static String P_WIDTH = "width"; //$NON-NLS-1$
- final static String P_WORD_SPACING = "word-spacing"; //$NON-NLS-1$
- final static String P_Z_INDEX = "z-index"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java
deleted file mode 100644
index 6522cfbc0a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSStringID.java
+++ /dev/null
@@ -1,22 +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.css.core.internal.metamodel.util;
-
-public interface CSSStringID {
-
- final static String S_ANY = "any"; //$NON-NLS-1$
- final static String S_COUNTER_IDENTIFIER = "counter-identifier"; //$NON-NLS-1$
- final static String S_FAMILY_NAME = "family-name"; //$NON-NLS-1$
- final static String S_FONT_FACE_NAME = "font-face-name"; //$NON-NLS-1$
- final static String S_PAGE_IDENTIFIER = "page-identifier"; //$NON-NLS-1$
- final static String S_SPECIFIC_VOICE = "specific-voice"; //$NON-NLS-1$
- final static String S_URANGE = "urange"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java
deleted file mode 100644
index 0f46d32adc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodel/util/CSSUnitID.java
+++ /dev/null
@@ -1,34 +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.css.core.internal.metamodel.util;
-
-public interface CSSUnitID {
-
- final static String U_CM = "cm";//$NON-NLS-1$
- final static String U_DEG = "deg";//$NON-NLS-1$
- final static String U_EMS = "em";//$NON-NLS-1$
- final static String U_EXS = "ex";//$NON-NLS-1$
- final static String U_GRAD = "grad";//$NON-NLS-1$
- final static String U_HASH = "#";//$NON-NLS-1$
- final static String U_HZ = "Hz";//$NON-NLS-1$
- final static String U_IN = "in";//$NON-NLS-1$
- // final static String U_INTEGER = "INTEGER";//$NON-NLS-1$
- final static String U_KHZ = "kHz";//$NON-NLS-1$
- final static String U_MM = "mm";//$NON-NLS-1$
- final static String U_MS = "ms";//$NON-NLS-1$
- // final static String U_NUMBER = "NUMBER";//$NON-NLS-1$
- final static String U_PC = "pc";//$NON-NLS-1$
- final static String U_PERCENTAGE = "%";//$NON-NLS-1$
- final static String U_PT = "pt";//$NON-NLS-1$
- final static String U_PX = "px";//$NON-NLS-1$
- final static String U_RAD = "rad";//$NON-NLS-1$
- final static String U_S = "s";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java
deleted file mode 100644
index 34b0e6d3ba..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCategoryImpl.java
+++ /dev/null
@@ -1,75 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMCategory;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMCategoryImpl extends CSSMMNodeImpl implements CSSMMCategory {
-
- public CSSMMCategoryImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_CATEGORY;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- public String getCaption() {
- return fCaption;
- }
-
- void setCaption(String caption) {
- fCaption = caption;
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getCaption() == null) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
- /*
- * @see Object#toString()
- */
- public String toString() {
- return getCaption();
- }
-
-
- private String fCaption = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java
deleted file mode 100644
index a064b514ed..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMCharsetRuleImpl.java
+++ /dev/null
@@ -1,45 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMCharsetRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMCharsetRuleImpl extends CSSMMNodeImpl implements CSSMMCharsetRule {
-
-
- public CSSMMCharsetRuleImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_CHARSET_RULE;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- return MetaModelErrors.NO_ERROR;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java
deleted file mode 100644
index eae79eae69..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMContainerImpl.java
+++ /dev/null
@@ -1,63 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMContainer;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMContainerImpl extends CSSMMNodeImpl implements CSSMMContainer {
-
-
- public CSSMMContainerImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_CONTAINER;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_NUMBER || type == TYPE_KEYWORD || type == TYPE_FUNCTION || type == TYPE_CONTAINER);
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getChildCount() == 0) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java
deleted file mode 100644
index 811d66494b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMDescriptorImpl.java
+++ /dev/null
@@ -1,75 +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.css.core.internal.metamodelimpl;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMDescriptor;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-class CSSMMDescriptorImpl extends CSSMMNodeImpl implements CSSMMDescriptor {
-
-
- public CSSMMDescriptorImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_DESCRIPTOR;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_NUMBER || type == TYPE_KEYWORD || type == TYPE_FUNCTION || type == TYPE_CONTAINER || type == TYPE_STRING || type == TYPE_SEPARATOR);
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getChildCount() == 0) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
- /*
- * @see CSSMMDescriptor#getValues()
- */
- public Iterator getValues() {
- ValueCollector collector = new ValueCollector();
- collector.apply(this);
- return collector.getNodes();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java
deleted file mode 100644
index 71d1ca95f3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFontFaceRuleImpl.java
+++ /dev/null
@@ -1,45 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMFontFaceRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMFontFaceRuleImpl extends CSSMMNodeImpl implements CSSMMFontFaceRule {
-
-
- public CSSMMFontFaceRuleImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_FONT_FACE_RULE;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return (child != null && child.getType() == TYPE_DESCRIPTOR);
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- return MetaModelErrors.NO_ERROR;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java
deleted file mode 100644
index 567f2169e8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMFunctionImpl.java
+++ /dev/null
@@ -1,96 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMFunction;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMFunctionImpl extends CSSMMNodeImpl implements CSSMMFunction {
-
- public CSSMMFunctionImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_FUNCTION;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- public String getFunctionString() {
- return fValue;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- /*
- * @see CSSMMNodeImpl#postSetAttribute()
- */
- // void postSetAttribute() throws BadInitializationException {
- // super.postSetAttribute();
- // String name = getName();
- // if (name == null) { throw new BadInitializationException(); }
- //
- // List list = new ArrayList();
- // list.add(CSSFunctionID.F_ATTR);
- // list.add(CSSFunctionID.F_COUNTER);
- // list.add(CSSFunctionID.F_RGB);
- // list.add(CSSFunctionID.F_RECT);
- // list.add(CSSFunctionID.F_URI);
- // list.add(CSSFunctionID.F_FORMAT);
- // list.add(CSSFunctionID.F_LOCAL);
- //
- // if (! list.contains(name.toLowerCase())) {
- // throw new BadInitializationException();
- // }
- // }
- /*
- * @see Object#toString()
- */
- public String toString() {
- return getFunctionString();
- }
-
- void setFunctionString(String value) {
- fValue = value;
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getFunctionString() == null) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
-
- private String fValue = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.java
deleted file mode 100644
index cadfe85b53..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMImportRuleImpl.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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMImportRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMImportRuleImpl extends CSSMMNodeImpl implements CSSMMImportRule {
-
-
- public CSSMMImportRuleImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_IMPORT_RULE;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- return MetaModelErrors.NO_ERROR;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java
deleted file mode 100644
index f8b5594006..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMKeywordImpl.java
+++ /dev/null
@@ -1,75 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMKeyword;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMKeywordImpl extends CSSMMNodeImpl implements CSSMMKeyword {
-
- public CSSMMKeywordImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_KEYWORD;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- /*
- * @see CSSMMKeyword#getKeywordString()
- */
- public String getKeywordString() {
- return fValue;
- }
-
- /*
- * @see Object#toString()
- */
- public String toString() {
- return getKeywordString();
- }
-
- void setKeywordString(String value) {
- fValue = value;
- }
-
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getKeywordString() == null) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
-
- private String fValue = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java
deleted file mode 100644
index 2dee90727b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMMediaRuleImpl.java
+++ /dev/null
@@ -1,41 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMMediaRule;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-class CSSMMMediaRuleImpl extends CSSMMNodeImpl implements CSSMMMediaRule {
-
-
- public CSSMMMediaRuleImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_MEDIA_RULE;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- short getError() {
- return MetaModelErrors.NO_ERROR;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java
deleted file mode 100644
index 923d7f7922..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNodeImpl.java
+++ /dev/null
@@ -1,148 +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.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-
-
-abstract class CSSMMNodeImpl implements CSSMMNode {
-
- public CSSMMNodeImpl() {
- super();
- }
-
- public abstract String getType();
-
- public String getDescription() {
- return fDescription;
- }
-
- public String getAttribute(String name) {
- if (fAttributes == null) {
- return null;
- }
- return (String) fAttributes.get(name);
- }
-
- public Iterator getChildNodes() {
- if (fChildNodes == null) {
- return Collections.EMPTY_LIST.iterator();
- }
- else {
- return Collections.unmodifiableCollection(fChildNodes).iterator();
- }
- }
-
- public Iterator getDescendants() {
- List descendants = new ArrayList();
- Iterator iChild = getChildNodes();
- while (iChild.hasNext()) {
- CSSMMNode child = (CSSMMNode) iChild.next();
- Iterator iDescendant = child.getDescendants();
- if (iDescendant.hasNext()) {
- while (iDescendant.hasNext()) {
- CSSMMNode descendant = (CSSMMNode) iDescendant.next();
- if (!descendants.contains(descendant)) {
- descendants.add(descendant);
- }
- }
- }
- else {
- if (!descendants.contains(child)) {
- descendants.add(child);
- }
- }
- }
- return Collections.unmodifiableCollection(descendants).iterator();
- }
-
- void appendChild(CSSMMNode child) {
- if (child == null) {
- return;
- }
- if (fChildNodes == null) {
- fChildNodes = new ArrayList();
- }
- if (!fChildNodes.contains(child)) {
- fChildNodes.add(child);
- ((CSSMMNodeImpl) child).fRefCount++;
- }
- }
-
- void removeChild(CSSMMNode child) {
- if (child == null || fChildNodes == null) {
- return;
- }
- Iterator i = fChildNodes.iterator();
- while (i.hasNext()) {
- if (i.next() == child) {
- i.remove();
- ((CSSMMNodeImpl) child).fRefCount--;
- return;
- }
- }
- }
-
- void removeAllChildNodes() {
- if (fChildNodes == null) {
- return;
- }
- Iterator i = fChildNodes.iterator();
- while (i.hasNext()) {
- ((CSSMMNodeImpl) i.next()).fRefCount--;
- }
- fChildNodes.clear();
- }
-
- abstract boolean canContain(CSSMMNode child);
-
- void initializeAttribute(Map attributes) throws IllegalArgumentException {
- if (fAttributes == null) {
- fAttributes = new HashMap();
- }
- fAttributes.putAll(attributes);
- postSetAttribute();
- }
-
- void setDescription(String description) {
- fDescription = description;
- }
-
- void postSetAttribute() throws IllegalArgumentException {
- // default : nop
- }
-
- abstract short getError();
-
- int getChildCount() {
- return (fChildNodes != null) ? fChildNodes.size() : 0;
- }
-
- int getReferenceCount() {
- return fRefCount;
- }
-
-
- private List fChildNodes = null;
- private String fDescription = null;
- private Map fAttributes = null;
- private int fRefCount = 0; // for error check
-
- static final String ATTR_NAME = "name"; //$NON-NLS-1$
- static final String NAME_NOT_AVAILABLE = ""; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java
deleted file mode 100644
index 3aae3e439f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMNumberImpl.java
+++ /dev/null
@@ -1,52 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNumber;
-
-class CSSMMNumberImpl extends CSSMMNodeImpl implements CSSMMNumber {
-
-
- public CSSMMNumberImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_NUMBER;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return (child != null && child.getType() == TYPE_UNIT);
- }
-
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java
deleted file mode 100644
index e28ccecd32..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPageRuleImpl.java
+++ /dev/null
@@ -1,50 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMPageRule;
-
-class CSSMMPageRuleImpl extends CSSMMNodeImpl implements CSSMMPageRule {
-
-
- public CSSMMPageRuleImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_PAGE_RULE;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_PROPERTY || type == TYPE_SELECTOR);
- }
-
- short getError() {
- if (getChildCount() == 0) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java
deleted file mode 100644
index 4b529fdac8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPropertyImpl.java
+++ /dev/null
@@ -1,76 +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.css.core.internal.metamodelimpl;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMProperty;
-
-
-class CSSMMPropertyImpl extends CSSMMNodeImpl implements CSSMMProperty {
- public CSSMMPropertyImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_PROPERTY;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_NUMBER || type == TYPE_KEYWORD || type == TYPE_FUNCTION || type == TYPE_CONTAINER || type == TYPE_STRING || type == TYPE_SEPARATOR || type == TYPE_PROPERTY);
- }
-
- /*
- * @see CSSMMProperty#getCategoryName()
- */
- public String getCategoryName() {
- return getAttribute(ATTR_CATEGORY);
- }
-
- public Iterator getValues() {
- ValueCollector collector = new ValueCollector();
- collector.apply(this);
- return collector.getNodes();
- }
-
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getChildCount() == 0) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
-
- static final String ATTR_CATEGORY = "category"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java
deleted file mode 100644
index a495981cac..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoClassImpl.java
+++ /dev/null
@@ -1,33 +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.css.core.internal.metamodelimpl;
-
-class CSSMMPseudoClassImpl extends CSSMMSelectorImpl {
-
-
- /**
- * Constructor for CSSMMPseudoClassImpl.
- */
- public CSSMMPseudoClassImpl() {
- super();
- }
-
- /*
- * @see CSSMMSelector#getSelectorType()
- */
- public String getSelectorType() {
- return TYPE_PSEUDO_CLASS;
- }
-
- void setSelectorString(String value) {
- fValue = ":" + value; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java
deleted file mode 100644
index eebe91731e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMPseudoElementImpl.java
+++ /dev/null
@@ -1,33 +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.css.core.internal.metamodelimpl;
-
-public class CSSMMPseudoElementImpl extends CSSMMSelectorImpl {
-
-
- /**
- * Constructor for CSSMMPseudoElementImpl.
- */
- public CSSMMPseudoElementImpl() {
- super();
- }
-
- /*
- * @see CSSMMSelector#getSelectorType()
- */
- public String getSelectorType() {
- return TYPE_PSEUDO_ELEMENT;
- }
-
- void setSelectorString(String value) {
- fValue = ":" + value; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java
deleted file mode 100644
index c45b4ce298..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorExpressionImpl.java
+++ /dev/null
@@ -1,49 +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.css.core.internal.metamodelimpl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-class CSSMMSelectorExpressionImpl extends CSSMMSelectorImpl {
-
- public CSSMMSelectorExpressionImpl() {
- super();
- }
-
- /*
- * @see CSSMMSelector#getSelectorType()
- */
- public String getSelectorType() {
- return TYPE_EXPRESSION;
- }
-
- void postSetAttribute() throws IllegalArgumentException {
- super.postSetAttribute();
- String name = getName();
- if (name == null) {
- throw new IllegalArgumentException();
- }
-
- Map map = new HashMap();
- map.put(EXPRESSION_ADJACENT.toLowerCase(), "+"); //$NON-NLS-1$
- map.put(EXPRESSION_ATTRIBUTE.toLowerCase(), "[]"); //$NON-NLS-1$
- map.put(EXPRESSION_CHILD.toLowerCase(), ">"); //$NON-NLS-1$
- map.put(EXPRESSION_DESCENDANT.toLowerCase(), "' '"); //$NON-NLS-1$
- map.put(EXPRESSION_UNIVERSAL.toLowerCase(), "*"); //$NON-NLS-1$
-
- fValue = (String) map.get(name.toLowerCase());
- if (fValue == null) {
- throw new IllegalArgumentException();
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java
deleted file mode 100644
index aaf243c055..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMSelectorImpl.java
+++ /dev/null
@@ -1,81 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMSelector;
-
-
-abstract class CSSMMSelectorImpl extends CSSMMNodeImpl implements CSSMMSelector {
-
- /**
- * Constructor for CSSMMSelectorImpl.
- */
- public CSSMMSelectorImpl() {
- super();
- }
-
- /*
- * @see CSSMMNode#getName()
- */
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNode#getType()
- */
- public String getType() {
- return TYPE_SELECTOR;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- /*
- * @see CSSMMNodeImpl#getError()
- */
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
- /*
- * @see CSSMMSelector#getSelectorString()
- */
- public String getSelectorString() {
- return fValue;
- }
-
- /*
- * @see Object#toString()
- */
- public String toString() {
- return getSelectorString();
- }
-
-
- protected String fValue = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java
deleted file mode 100644
index c8cde45bab..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStringImpl.java
+++ /dev/null
@@ -1,86 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMString;
-
-class CSSMMStringImpl extends CSSMMNodeImpl implements CSSMMString {
-
-
- public CSSMMStringImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_STRING;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
- /*
- * @see CSSMMNodeImpl#postSetAttribute()
- */
- // void postSetAttribute() throws BadInitializationException {
- // super.postSetAttribute();
- // String name = getName();
- // if (name == null) { throw new BadInitializationException(); }
- //
- // Map map = new HashMap();
- // map.put(CSSStringID.S_ANY.toLowerCase(), "<any>"); //$NON-NLS-1$
- // map.put(CSSStringID.S_COUNTER_IDENTIFIER.toLowerCase(), "<counter>");
- // //$NON-NLS-1$
- // map.put(CSSStringID.S_FAMILY_NAME.toLowerCase(), "<family-name>");
- // //$NON-NLS-1$
- // map.put(CSSStringID.S_FONT_FACE_NAME.toLowerCase(),
- // "<font-face-name>"); //$NON-NLS-1$
- // map.put(CSSStringID.S_PAGE_IDENTIFIER.toLowerCase(),
- // "<page-identifier>"); //$NON-NLS-1$
- // map.put(CSSStringID.S_SPECIFIC_VOICE.toLowerCase(),
- // "<specific-voice>"); //$NON-NLS-1$
- // map.put(CSSStringID.S_URANGE.toLowerCase(), "<urange>"); //$NON-NLS-1$
- //
- // fValue = (String)map.get(name.toLowerCase());
- // if (fValue == null) { throw new BadInitializationException(); }
- // }
- //
- // /*
- // * @see Object#toString()
- // */
- // public String toString() {
- // return fValue;
- // }
- //
- // private String fValue = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java
deleted file mode 100644
index 2c257c3f67..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleRuleImpl.java
+++ /dev/null
@@ -1,50 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleRule;
-
-class CSSMMStyleRuleImpl extends CSSMMNodeImpl implements CSSMMStyleRule {
-
-
- public CSSMMStyleRuleImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_STYLE_RULE;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_PROPERTY || type == TYPE_SELECTOR);
- }
-
- short getError() {
- if (getChildCount() == 0) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java
deleted file mode 100644
index 4d7fd006e3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMStyleSheetImpl.java
+++ /dev/null
@@ -1,50 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleSheet;
-
-class CSSMMStyleSheetImpl extends CSSMMNodeImpl implements CSSMMStyleSheet {
-
-
- public CSSMMStyleSheetImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_STYLE_SHEET;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_CHARSET_RULE || type == TYPE_IMPORT_RULE || type == TYPE_PAGE_RULE || type == TYPE_MEDIA_RULE || type == TYPE_FONT_FACE_RULE || type == TYPE_STYLE_RULE);
- }
-
- short getError() {
- if (getChildCount() == 0) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java
deleted file mode 100644
index 9c154a77ff..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMMUnitImpl.java
+++ /dev/null
@@ -1,108 +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.css.core.internal.metamodelimpl;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMUnit;
-
-/**
- * CSSMMUnit : embedded type
- */
-class CSSMMUnitImpl extends CSSMMNodeImpl implements CSSMMUnit {
-
- public CSSMMUnitImpl() {
- super();
- }
-
- public String getType() {
- return TYPE_UNIT;
- }
-
- public String getName() {
- String name = getAttribute(ATTR_NAME);
- if (name != null) {
- return name.toLowerCase();
- }
- else {
- return null;
- }
- }
-
- /*
- * @see CSSMMUnit#getUnitString()
- */
- public String getUnitString() {
- return fValue;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- return false;
- }
-
- /*
- * @see CSSMMNodeImpl#postSetAttribute()
- */
- // void postSetAttribute() throws BadInitializationException {
- // super.postSetAttribute();
- // String name = getName();
- // if (name == null) { throw new BadInitializationException(); }
- // Map map = new HashMap();
- // map.put(CSSUnitID.U_CM.toLowerCase(), "cm");//$NON-NLS-1$
- // map.put(CSSUnitID.U_DEG.toLowerCase(), "deg");//$NON-NLS-1$
- // map.put(CSSUnitID.U_EMS.toLowerCase(), "em");//$NON-NLS-1$
- // map.put(CSSUnitID.U_EXS.toLowerCase(), "ex");//$NON-NLS-1$
- // map.put(CSSUnitID.U_GRAD.toLowerCase(), "grad");//$NON-NLS-1$
- // map.put(CSSUnitID.U_HASH.toLowerCase(), "#");//$NON-NLS-1$
- // map.put(CSSUnitID.U_HZ.toLowerCase(), "Hz");//$NON-NLS-1$
- // map.put(CSSUnitID.U_IN.toLowerCase(), "in");//$NON-NLS-1$
- // // map.put(CSSUnitID.U_INTEGER.toLowerCase(),
- // "(integer)");//$NON-NLS-1$
- // map.put(CSSUnitID.U_KHZ.toLowerCase(), "kHz");//$NON-NLS-1$
- // map.put(CSSUnitID.U_MM.toLowerCase(), "mm");//$NON-NLS-1$
- // map.put(CSSUnitID.U_MS.toLowerCase(), "ms");//$NON-NLS-1$
- // // map.put(CSSUnitID.U_NUMBER.toLowerCase(), "(number)");//$NON-NLS-1$
- // map.put(CSSUnitID.U_PC.toLowerCase(), "pc");//$NON-NLS-1$
- // map.put(CSSUnitID.U_PERCENTAGE.toLowerCase(), "%");//$NON-NLS-1$
- // map.put(CSSUnitID.U_PT.toLowerCase(), "pt");//$NON-NLS-1$
- // map.put(CSSUnitID.U_PX.toLowerCase(), "px");//$NON-NLS-1$
- // map.put(CSSUnitID.U_RAD.toLowerCase(), "rad");//$NON-NLS-1$
- // map.put(CSSUnitID.U_S.toLowerCase(), "s");//$NON-NLS-1$
- // fValue = (String)map.get(name.toLowerCase());
- // if (fValue == null) { throw new BadInitializationException(); }
- // }
- /*
- * @see Object#toString()
- */
- public String toString() {
- return getUnitString();
- }
-
- void setUnitString(String value) {
- fValue = value;
- }
-
- short getError() {
- if (getName() == null) {
- return MetaModelErrors.ERROR_NOT_DEFINED;
- }
- else if (getUnitString() == null) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
- private String fValue = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java
deleted file mode 100644
index 2240db14ee..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSMetaModelImpl.java
+++ /dev/null
@@ -1,95 +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.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMStyleSheet;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-
-
-class CSSMetaModelImpl extends CSSMMNodeImpl implements CSSMetaModel {
- // class CSSMetaModelImpl implements CSSMetaModel {
- public CSSMetaModelImpl() {
- super();
- fNodePool = new NodePool();
- }
-
- public String getType() {
- return TYPE_META_MODEL;
- }
-
- public String getName() {
- return NAME_NOT_AVAILABLE;
- }
-
- /*
- * @see CSSMMNodeImpl#canContain(CSSMMNode)
- */
- boolean canContain(CSSMMNode child) {
- if (child == null) {
- return false;
- }
- String type = child.getType();
- return (type == TYPE_STYLE_SHEET || type == TYPE_CATEGORY);
- }
-
- public CSSMMStyleSheet getStyleSheet() {
- Iterator i = getChildNodes();
- while (i.hasNext()) {
- CSSMMNode node = (CSSMMNode) i.next();
- if (node.getType() == TYPE_STYLE_SHEET) {
- return (CSSMMStyleSheet) node;
- }
- }
- return null;
- // return fStyleSheet;
- }
-
- public Iterator getCategories() {
- List categories = new ArrayList();
- Iterator i = getChildNodes();
- while (i.hasNext()) {
- CSSMMNode node = (CSSMMNode) i.next();
- if (node.getType() == TYPE_CATEGORY) {
- categories.add(node);
- }
- }
- return categories.iterator();
- }
-
- void loadCompleted() {
- fNodePool = null;
- }
-
- // List fCategories = null;
- /*
- * @see CSSMMNodeImpl#isValid()
- */
- short getError() {
- if (getStyleSheet() != null) {
- return MetaModelErrors.ERROR_NO_CHILD;
- }
- else {
- return MetaModelErrors.NO_ERROR;
- }
- }
-
- NodePool getNodePool() {
- return fNodePool;
- }
-
-
- private NodePool fNodePool = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java
deleted file mode 100644
index 9c45f443a5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileImpl.java
+++ /dev/null
@@ -1,263 +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.css.core.internal.metamodelimpl;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Locale;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.osgi.framework.Bundle;
-
-
-
-class CSSProfileImpl implements CSSProfile {
-
- /**
- * Constructor for CSSMetaModelProfileInfoImpl.
- */
- private CSSProfileImpl() {
- super();
- }
-
- /**
- * Constructor for CSSMetaModelProfileInfoImpl.
- */
- public CSSProfileImpl(String id, URL url) {
- this();
- fID = id;
- fURL = url;
- }
-
- /**
- * Constructor for CSSMetaModelProfileInfoImpl.
- */
- CSSProfileImpl(String id, URL url, String relativeURI) {
- super();
- fID = id;
- fURL = url;
- fRelativeURI = relativeURI;
- }
-
- /*
- * @see CSSMetaModelProfileInfo#getProfileID()
- */
- public String getProfileID() {
- return fID;
- }
-
- /*
- * @see CSSMetaModelProfileInfo#getProfileName()
- */
- public String getProfileName() {
- return (fName == null) ? fID : fName;
- }
-
- public CSSMetaModel getMetaModel() {
- if (fMetaModel == null) {
- try {
- InputStream input = getProfileURL().openStream();
- ProfileLoader loader = new ProfileLoader(getResourceBundle(), getLogging());
- fMetaModel = loader.loadProfile(input);
- }
- catch (IOException e) {
- Logger.logException("Cannot open stream for profile", e); //$NON-NLS-1$
- }
- }
- return fMetaModel;
- }
-
- private ResourceBundle getResourceBundle() {
- ResourceBundle resourceBundle = null;
-
- Bundle bundle = null;
- String pluginID = getOwnerPluginID();
- if (pluginID != null) {
- bundle = Platform.getBundle(pluginID);
- if (bundle != null) {
- // needed to work around FileLocator.openStream not looking for
- // files with Java naming conventions (BUG103345)
- IPath[] paths = getResourceBundlePaths();
- if (paths != null) {
- InputStream inStream = null;
- int i = 0;
- while (i < paths.length && inStream == null) {
- IPath path = paths[i];
- try {
- inStream = FileLocator.openStream(bundle, path, true);
- if (inStream != null)
- resourceBundle = new PropertyResourceBundle(inStream);
- else
- ++i;
- }
- catch (IOException e) {
- // unable to open stream with current path so just
- // try next path
- ++i;
- }
- finally {
- if (inStream != null)
- try {
- inStream.close();
- }
- catch (IOException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
- }
- }
- }
- return resourceBundle;
- }
-
- /**
- * Returns an array of potential resource bundle paths or null if there
- * are none
- *
- * @return IPath[] or null
- */
- private IPath[] getResourceBundlePaths() {
- IPath[] paths = new IPath[0];
-
- if (fRelativeURI != null) {
- // original path = location of profile.xml - profile.xml
- IPath originalPath = Path.fromOSString(fRelativeURI).removeLastSegments(1);
-
- String baseName = "cssprofile"; //$NON-NLS-1$
- Vector names = calculateBundleNames(baseName, Locale.getDefault());
-
- int a = 0;
- paths = new IPath[names.size()];
- for (int i = names.size(); i > 0; --i) {
- String bundleName = (String) names.get(i - 1);
- IPath path = originalPath.append(bundleName).addFileExtension("properties"); //$NON-NLS-1$
- paths[a] = path;
- ++a;
- }
- }
- return paths;
- }
-
- /**
- * Calculate the bundles along the search path from the base bundle to the
- * bundle specified by baseName and locale.<br />
- *
- * @param baseName
- * the base bundle name
- * @param locale
- * the locale
- * @param names
- * the vector used to return the names of the bundles along the
- * search path.
- *
- */
- private Vector calculateBundleNames(String baseName, Locale locale) {
- // this method can be deleted after BUG103345 is fixed
- final Vector result = new Vector(4); // default size 4
- final String language = locale.getLanguage();
- final int languageLength = language.length();
- final String country = locale.getCountry();
- final int countryLength = country.length();
- final String variant = locale.getVariant();
- final int variantLength = variant.length();
-
- result.addElement(baseName); // at least add base name
- if (languageLength + countryLength + variantLength == 0) {
- // The locale is "", "", "".
- return result;
- }
- final StringBuffer temp = new StringBuffer(baseName);
- temp.append('_');
- temp.append(language);
- if (languageLength > 0) {
- result.addElement(temp.toString());
- }
-
- if (countryLength + variantLength == 0) {
- return result;
- }
- temp.append('_');
- temp.append(country);
- if (countryLength > 0) {
- result.addElement(temp.toString());
- }
-
- if (variantLength == 0) {
- return result;
- }
- temp.append('_');
- temp.append(variant);
- result.addElement(temp.toString());
-
- return result;
- }
-
- /*
- * @see CSSMetaModelProfileInfo#getProfileURL()
- */
- public URL getProfileURL() {
- return fURL;
- }
-
- void setProfileName(String name) {
- fName = name;
- }
-
- public boolean isDefault() {
- return fDefault;
- }
-
- void setDefault(boolean isDefault) {
- fDefault = isDefault;
- }
-
- public String getOwnerPluginID() {
- return fOwnerPluginID;
- }
-
- void setOwnerPluginID(String pluginID) {
- fOwnerPluginID = pluginID;
- }
-
- /**
- * hidden option : logging
- */
- void setLogging(boolean logging) {
- fLogging = logging;
- }
-
- boolean getLogging() {
- return fLogging;
- }
-
-
- String fID = null;
- String fName = null;
- URL fURL = null;
- CSSMetaModel fMetaModel = null;
- String fOwnerPluginID = null;
- boolean fDefault = false;
- boolean fLogging = false;
- private String fRelativeURI = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java
deleted file mode 100644
index 9ab5e320d9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/CSSProfileTest.java
+++ /dev/null
@@ -1,73 +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.css.core.internal.metamodelimpl;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-
-
-class CSSProfileTest {
-
-
- /**
- * Test use only
- */
- public static void main(String[] args) {
- if (args.length == 0)
- return;
- CSSMetaModel metamodel = null;
- try {
- CSSProfile profile = new CSSProfileImpl("test", new URL(args[0])); //$NON-NLS-1$
- metamodel = profile.getMetaModel();
- }
- catch (MalformedURLException e) {
- Logger.logException(e);
- }
- if (metamodel == null) {
- return;
- }
- /*
- * CSSMMTypeCollector collector = new CSSMMTypeCollector();
- * collector.apply(metamodel, CSSMMNode.TYPE_PROPERTY); Iterator
- * iProperty = collector.getNodes(); while (iProperty.hasNext()) {
- * CSSMMNode node = (CSSMMNode)iProperty.next();
- * System.out.println("Property " + node.getName() + " can contain:");
- * //$NON-NLS-2$ //$NON-NLS-1$ Iterator iValue =
- * node.getDescendants(); while (iValue.hasNext()) {
- * debugOut((CSSMMNode)iValue.next(), 0, false); } }
- */
- debugOut(metamodel, 0, true);
- }
-
- static void debugOut(CSSMMNode node, int depth, boolean recursive) {
- String type = node.getType();
- for (int i = 0; i < depth; i++) {
- System.out.print("\t"); //$NON-NLS-1$
- }
- System.out.print("[ " + node.getName() + "(" + type + ") ]"); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- if (type == CSSMMNode.TYPE_UNIT || type == CSSMMNode.TYPE_KEYWORD || type == CSSMMNode.TYPE_FUNCTION || type == CSSMMNode.TYPE_SELECTOR) {
- System.out.print(" -> " + node.toString()); //$NON-NLS-1$
- }
- System.out.println();
-
- if (recursive) {
- java.util.Iterator iNode = node.getChildNodes();
- while (iNode.hasNext()) {
- debugOut((CSSMMNode) iNode.next(), depth + 1, true);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java
deleted file mode 100644
index 5ca381e5a7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/MetaModelErrors.java
+++ /dev/null
@@ -1,30 +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.css.core.internal.metamodelimpl;
-
-interface MetaModelErrors {
-
- static final short NO_ERROR = 0;
-
- // MASK
- static final short MASK_WARNING = 0x1000;
- static final short MASK_ERROR = 0x2000;
-
- // ERROR
- static final short ERROR_NOT_DEFINED = MASK_ERROR + 0x01;
- static final short ERROR_INVALID_NAME = MASK_ERROR + 0x04;
- static final short ERROR_INVAILD_CHILD = MASK_ERROR + 0x02;
- static final short ERROR_NO_CHILD = MASK_ERROR + 0x08;
- // static final short ERROR_NO_ESSENTIAL_CHILD = MASK_ERROR + 0x10
-
- // WARNING
- static final short WARNING_HAS_NO_CHILD = MASK_WARNING + 0x01;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java
deleted file mode 100644
index f5cb56817e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/NodePool.java
+++ /dev/null
@@ -1,171 +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.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.wst.css.core.internal.Logger;
-
-
-
-class NodePool {
-
- NodePool() {
- super();
- initializeClassNameTable();
- }
-
- CSSMMNodeImpl getNode(String tagName, String nodeName) {
- if (nodeName != null) {
- nodeName = nodeName.toLowerCase();
- }
- String className = (String) classNames.get(tagName);
- if (className == null) {
- return null;
- }
- Map nodes = (Map) nodeRegistry.get(className);
- if (nodes == null) {
- nodes = new HashMap();
- nodeRegistry.put(className, nodes);
- }
- CSSMMNodeImpl node = (CSSMMNodeImpl) nodes.get(nodeName);
- if (node == null) {
- node = createNewNode(className);
- nodes.put(nodeName, node);
- }
- return node;
- }
-
- private CSSMMNodeImpl createNewNode(String className) {
- CSSMMNodeImpl node = null;
- if (className != null) {
- className = getPackageName() + "." + className; //$NON-NLS-1$
- try {
- node = (CSSMMNodeImpl) Class.forName(className).newInstance();
- }
- catch (IllegalAccessException e) {
- Logger.logException(e);
- }
- catch (InstantiationException e) {
- Logger.logException(e);
- }
- catch (ClassNotFoundException e) {
- Logger.logException(e);
- }
- }
- // System.out.println(className + " is Created");
- return node;
- }
-
- /**
- * Error check function: find nodes that are not referred by any node
- */
- Iterator getStrayNodes() {
- List strayNodes = new ArrayList();
- Iterator iMap = nodeRegistry.values().iterator();
- while (iMap.hasNext()) {
- Map nodes = (Map) iMap.next();
- Iterator iNode = nodes.values().iterator();
- while (iNode.hasNext()) {
- CSSMMNodeImpl node = (CSSMMNodeImpl) iNode.next();
- if (node.getReferenceCount() == 0) {
- strayNodes.add(node);
- }
- }
- }
- return strayNodes.iterator();
- }
-
- // This class must not be inner class :)
- private String getPackageName() {
- if (fPackageName == null) {
- String className = getClass().getName();
- int pos = className.lastIndexOf('.');
- if (0 < pos) {
- fPackageName = className.substring(0, pos);
- }
- else {
- fPackageName = ""; //$NON-NLS-1$
- }
- }
- return fPackageName;
- }
-
- void initializeClassNameTable() {
- classNames.put(ProfileKeywords.STYLESHEET_DEF, CLASS_STYLE_SHEET);
- classNames.put(ProfileKeywords.CHARSET_RULE_DEF, CLASS_CHARSET_RULE);
- classNames.put(ProfileKeywords.CHARSET_RULE, CLASS_CHARSET_RULE);
- classNames.put(ProfileKeywords.FONTFACE_RULE_DEF, CLASS_FONT_FACE_RULE);
- classNames.put(ProfileKeywords.FONTFACE_RULE, CLASS_FONT_FACE_RULE);
- classNames.put(ProfileKeywords.IMPORT_RULE_DEF, CLASS_IMPORT_RULE);
- classNames.put(ProfileKeywords.IMPORT_RULE, CLASS_IMPORT_RULE);
- classNames.put(ProfileKeywords.MEDIA_RULE_DEF, CLASS_MEDIA_RULE);
- classNames.put(ProfileKeywords.MEDIA_RULE, CLASS_MEDIA_RULE);
- classNames.put(ProfileKeywords.PAGE_RULE_DEF, CLASS_PAGE_RULE);
- classNames.put(ProfileKeywords.PAGE_RULE, CLASS_PAGE_RULE);
- classNames.put(ProfileKeywords.STYLE_RULE_DEF, CLASS_STYLE_RULE);
- classNames.put(ProfileKeywords.STYLE_RULE, CLASS_STYLE_RULE);
- classNames.put(ProfileKeywords.PROPERTY_DEF, CLASS_PROPERTY);
- classNames.put(ProfileKeywords.PROPERTY, CLASS_PROPERTY);
- classNames.put(ProfileKeywords.DESCRIPTOR_DEF, CLASS_DESCRIPTOR);
- classNames.put(ProfileKeywords.DESCRIPTOR, CLASS_DESCRIPTOR);
- classNames.put(ProfileKeywords.CONTAINER_DEF, CLASS_CONTAINER);
- classNames.put(ProfileKeywords.CONTAINER, CLASS_CONTAINER);
- classNames.put(ProfileKeywords.NUMBER_DEF, CLASS_NUMBER);
- classNames.put(ProfileKeywords.NUMBER, CLASS_NUMBER);
- classNames.put(ProfileKeywords.KEYWORD_DEF, CLASS_KEYWORD);
- classNames.put(ProfileKeywords.KEYWORD, CLASS_KEYWORD);
- classNames.put(ProfileKeywords.UNIT, CLASS_UNIT);
- classNames.put(ProfileKeywords.UNIT_DEF, CLASS_UNIT);
- classNames.put(ProfileKeywords.FUNCTION, CLASS_FUNCTION);
- classNames.put(ProfileKeywords.FUNCTION_DEF, CLASS_FUNCTION);
- classNames.put(ProfileKeywords.SELECTOR_EXPRESSION, CLASS_SELECTOR_EXPRESSION);
- classNames.put(ProfileKeywords.PSEUDO_ELEMENT, CLASS_PSEUDO_ELEMENT);
- classNames.put(ProfileKeywords.PSEUDO_ELEMENT_DEF, CLASS_PSEUDO_ELEMENT);
- classNames.put(ProfileKeywords.PSEUDO_CLASS, CLASS_PSEUDO_CLASS);
- classNames.put(ProfileKeywords.PSEUDO_CLASS_DEF, CLASS_PSEUDO_CLASS);
- classNames.put(ProfileKeywords.STRING, CLASS_STRING);
- classNames.put(ProfileKeywords.CATEGORY_DEF, CLASS_CATEGORY);
- }
-
-
- private String fPackageName;
- /*
- * Conversion Tables nodeRegistry : class name -> hash of node instances
- * classNames : Profile Tag name -> java class name
- */
- private Map nodeRegistry = new HashMap();
- private Map classNames = new HashMap();
-
- private final static String CLASS_STYLE_SHEET = "CSSMMStyleSheetImpl"; //$NON-NLS-1$
- private final static String CLASS_CHARSET_RULE = "CSSMMCharsetRuleImpl"; //$NON-NLS-1$
- private final static String CLASS_FONT_FACE_RULE = "CSSMMFontFaceRuleImpl"; //$NON-NLS-1$
- private final static String CLASS_IMPORT_RULE = "CSSMMImportRuleImpl"; //$NON-NLS-1$
- private final static String CLASS_MEDIA_RULE = "CSSMMMediaRuleImpl"; //$NON-NLS-1$
- private final static String CLASS_PAGE_RULE = "CSSMMPageRuleImpl"; //$NON-NLS-1$
- private final static String CLASS_STYLE_RULE = "CSSMMStyleRuleImpl"; //$NON-NLS-1$
- private final static String CLASS_PROPERTY = "CSSMMPropertyImpl"; //$NON-NLS-1$
- private final static String CLASS_DESCRIPTOR = "CSSMMDescriptorImpl"; //$NON-NLS-1$
- private final static String CLASS_CONTAINER = "CSSMMContainerImpl"; //$NON-NLS-1$
- private final static String CLASS_NUMBER = "CSSMMNumberImpl"; //$NON-NLS-1$
- private final static String CLASS_KEYWORD = "CSSMMKeywordImpl"; //$NON-NLS-1$
- private final static String CLASS_UNIT = "CSSMMUnitImpl"; //$NON-NLS-1$
- private final static String CLASS_FUNCTION = "CSSMMFunctionImpl"; //$NON-NLS-1$
- private final static String CLASS_STRING = "CSSMMStringImpl"; //$NON-NLS-1$
- private final static String CLASS_CATEGORY = "CSSMMCategoryImpl"; //$NON-NLS-1$
- private final static String CLASS_SELECTOR_EXPRESSION = "CSSMMSelectorExpressionImpl"; //$NON-NLS-1$
- private final static String CLASS_PSEUDO_CLASS = "CSSMMPseudoClassImpl"; //$NON-NLS-1$
- private final static String CLASS_PSEUDO_ELEMENT = "CSSMMPseudoElementImpl"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java
deleted file mode 100644
index 82a6b33948..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileHandler.java
+++ /dev/null
@@ -1,293 +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.css.core.internal.metamodelimpl;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Stack;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMSelector;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-
-class ProfileHandler extends DefaultHandler {
-
- public ProfileHandler(CSSMetaModelImpl metamodel, ResourceBundle resourceBundle, boolean logging) {
- super();
- fMetaModel = metamodel;
- fNodePool = metamodel.getNodePool();
- fResourceBundle = resourceBundle;
- fLogging = logging;
- }
-
- public ProfileHandler(CSSMetaModelImpl metamodel, ResourceBundle resourceBundle) {
- super();
- fMetaModel = metamodel;
- fNodePool = metamodel.getNodePool();
- fResourceBundle = resourceBundle;
- fLogging = false;
- }
-
- private String getResourceString(String key) {
- if (key.equals("%")) { //$NON-NLS-1$
- return key;
- }
- if (!key.startsWith("%")) { //$NON-NLS-1$
- return key;
- }
- if (key.startsWith("%%")) { //$NON-NLS-1$
- return key.substring(1);
- }
-
- if (fResourceBundle != null) {
- return fResourceBundle.getString(key.substring(1));
- }
- else {
- return key;
- }
- }
-
- public void startDocument() throws SAXException {
- // System.out.println("startDocument");
- // fNodeStack.push(metamodel);
- // fCurrentNode = null;
- }
-
- public void endDocument() throws SAXException {
- new ErrorCorrector().doCorrect(fMetaModel);
- if (fLogging) {
- Iterator i = fNodePool.getStrayNodes();
- while (i.hasNext()) {
- CSSMMNode node = (CSSMMNode) i.next();
- String str = "[CSSProfile Warning] " + node.getName(); //$NON-NLS-1$
- str += "(" + node.getType() + ") is not referred by any node."; //$NON-NLS-1$ //$NON-NLS-2$
- Logger.log(Logger.WARNING, str);
- // System.out.println(str);
- }
- }
- }
-
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- TagNode tagNode = null;
- CSSMMNodeImpl parentNode = null;
- if (0 < fNodeStack.size()) {
- tagNode = (TagNode) fNodeStack.peek();
- parentNode = tagNode.node;
- }
-
- CSSMMNodeImpl node = null;
- if (qName.equals(ProfileKeywords.PROFILE_IMPORT)) { // import
- String profileName = attributes.getValue(ATTR_NAME_REFERENCE);
- importProfile(profileName);
- }
- else if (isDefinition(qName)) { // node creation
- String nodeName = attributes.getValue(ATTR_NAME_DEFINITION);
- node = fNodePool.getNode(qName, nodeName);
- if (node != null) {
- String overwrite = attributes.getValue(ATTR_OVERWRITE);
- if (overwrite == null || overwrite.equals(ATTR_VALUE_OVERWRITE_FALSE)) {
- node.removeAllChildNodes();
- }
- Map attrMap = new HashMap();
- for (int i = 0; i < attributes.getLength(); i++) {
- attrMap.put(attributes.getQName(i), attributes.getValue(i));
- }
- try {
- node.initializeAttribute(attrMap);
- }
- catch (IllegalArgumentException e) {
- Logger.logException(e);
- }
- }
- }
- else if (node == null) { // node reference
- String nodeName = attributes.getValue(ATTR_NAME_REFERENCE);
- node = fNodePool.getNode(qName, nodeName);
- }
-
- if (node != null) {
- if (parentNode != null && parentNode.canContain(node)) {
- String enabled = attributes.getValue(ATTR_ENABLED);
- if (enabled != null && enabled.equals(ATTR_VALUE_ENABLED_FALSE)) {
- parentNode.removeChild(node);
- }
- else {
- parentNode.appendChild(node);
- }
- }
- else if (node.getType() == CSSMMNode.TYPE_STYLE_SHEET || node.getType() == CSSMMNode.TYPE_CATEGORY) {
- fMetaModel.appendChild(node);
- }
- else {
- if (fLogging && parentNode != null) {
- Logger.log(Logger.ERROR, parentNode.getType() + " cannot contain " + //$NON-NLS-1$
- node.getType() + " (" + qName + ")"); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- }
-
- fNodeStack.push(new TagNode(qName, (node != null) ? node : parentNode));
- }
-
- public void endElement(String uri, String localName, String qName) throws SAXException {
- fNodeStack.pop();
- }
-
- public void characters(char[] ch, int start, int length) throws SAXException {
- TagNode tagNode = (TagNode) fNodeStack.peek();
- String tagName = tagNode.tag;
- if (tagName.equals(ProfileKeywords.KEYWORD_VALUE) || tagName.equals(ProfileKeywords.UNIT_VALUE) || tagName.equals(ProfileKeywords.FUNCTION_VALUE) || tagName.equals(ProfileKeywords.SELECTOR_VALUE) || tagName.equals(ProfileKeywords.DESCRIPTION) || tagName.equals(ProfileKeywords.CAPTION)) {
- StringBuffer buf = new StringBuffer(length);
- for (int i = 0; i < length; i++) {
- buf.append(ch[start + i]);
- }
- String value = getResourceString(buf.toString().trim());
- CSSMMNodeImpl node = tagNode.node;
- if (node != null) {
- if (node.getType() == CSSMMNode.TYPE_KEYWORD && tagName.equals(ProfileKeywords.KEYWORD_VALUE)) {
- ((CSSMMKeywordImpl) node).setKeywordString(value);
- }
- else if (node.getType() == CSSMMNode.TYPE_UNIT && tagName.equals(ProfileKeywords.UNIT_VALUE)) {
- ((CSSMMUnitImpl) node).setUnitString(value);
- }
- else if (node.getType() == CSSMMNode.TYPE_FUNCTION && tagName.equals(ProfileKeywords.FUNCTION_VALUE)) {
- ((CSSMMFunctionImpl) node).setFunctionString(value);
- }
- else if (node.getType() == CSSMMNode.TYPE_SELECTOR && ((CSSMMSelector) node).getSelectorType() == CSSMMSelector.TYPE_PSEUDO_ELEMENT) {
- ((CSSMMPseudoElementImpl) node).setSelectorString(value);
- }
- else if (node.getType() == CSSMMNode.TYPE_SELECTOR && ((CSSMMSelector) node).getSelectorType() == CSSMMSelector.TYPE_PSEUDO_CLASS) {
- ((CSSMMPseudoClassImpl) node).setSelectorString(value);
- }
- else if (node.getType() == CSSMMNode.TYPE_CATEGORY && tagName.equals(ProfileKeywords.CAPTION)) {
- ((CSSMMCategoryImpl) node).setCaption(value);
- }
- else if (tagName.equals(ProfileKeywords.DESCRIPTION)) {
- node.setDescription(value);
- }
- }
- }
- }
-
- private boolean isDefinition(String tagName) {
- return (tagName.equals(ProfileKeywords.STYLESHEET_DEF) || tagName.equals(ProfileKeywords.CHARSET_RULE_DEF) || tagName.equals(ProfileKeywords.IMPORT_RULE_DEF) || tagName.equals(ProfileKeywords.PAGE_RULE_DEF) || tagName.equals(ProfileKeywords.MEDIA_RULE_DEF) || tagName.equals(ProfileKeywords.FONTFACE_RULE_DEF) || tagName.equals(ProfileKeywords.STYLE_RULE_DEF) || tagName.equals(ProfileKeywords.KEYWORD_DEF) || tagName.equals(ProfileKeywords.NUMBER_DEF) || tagName.equals(ProfileKeywords.PROPERTY_DEF) || tagName.equals(ProfileKeywords.DESCRIPTOR_DEF) || tagName.equals(ProfileKeywords.CONTAINER_DEF) || tagName.equals(ProfileKeywords.UNIT_DEF) || tagName.equals(ProfileKeywords.FUNCTION_DEF) || tagName.equals(ProfileKeywords.STRING) || tagName.equals(ProfileKeywords.CATEGORY_DEF) || tagName.equals(ProfileKeywords.PSEUDO_CLASS_DEF) || tagName.equals(ProfileKeywords.PSEUDO_ELEMENT_DEF) || tagName.equals(ProfileKeywords.SELECTOR_EXPRESSION) || tagName.equals(ProfileKeywords.SEPARATOR));
- }
-
- private void importProfile(String profileName) {
- URL profileURL = null;
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- CSSProfile profile = reg.getProfile(profileName);
- if (profile != null) {
- // first: find URL by ID
- profileURL = profile.getProfileURL();
- }
- else {
- // second: find URL by filename of profile URL
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- profile = (CSSProfile) i.next();
- URL url = profile.getProfileURL();
- if (url.getFile().endsWith(profileName)) {
- profileURL = url;
- break;
- }
- }
- }
- if (profileURL == null) {
- // final: it may be url itself
- try {
- profileURL = new URL(profileName);
- }
- catch (MalformedURLException e) {
- Logger.logException(e);
- }
- }
- if (profileURL != null) {
- try {
- ProfileLoader.loadProfile(fMetaModel, profileURL.openStream(), fResourceBundle, fLogging);
- }
- catch (IOException e) {
- Logger.logException("Cannot open stream for profile", //$NON-NLS-1$
- e);
- }
- }
- }
-
- class TagNode {
-
- String tag = null;
- CSSMMNodeImpl node = null;
-
- TagNode(String tag, CSSMMNodeImpl node) {
- this.tag = tag;
- this.node = node;
- }
- }
-
- class ErrorCorrector {
-
- void doCorrect(CSSMMNodeImpl node) {
- Iterator i = node.getChildNodes();
- ArrayList errorNodes = new ArrayList();
- while (i.hasNext()) {
- CSSMMNodeImpl child = (CSSMMNodeImpl) i.next();
- doCorrect(child);
- short error = child.getError();
- if (error != MetaModelErrors.NO_ERROR) {
- // node.removeChild(child);
- errorNodes.add(child);
-
- String str = "[CSSProfile Error] " + node.getName(); //$NON-NLS-1$
- str += "(" + node.getType() + ") contains error node: "; //$NON-NLS-1$ //$NON-NLS-2$
- str += child.getName() + "(" + child.getType() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- str += " - error code = " + error; //$NON-NLS-1$
- if (fLogging) {
- Logger.log(Logger.ERROR, str);
- // System.out.println(str);
- }
- }
- }
- int errorSize = errorNodes.size();
- if (errorSize > 0) {
- for (int j = 0; j < errorSize; j++) {
- CSSMMNodeImpl errorNode = (CSSMMNodeImpl) errorNodes.get(j);
- node.removeChild(errorNode);
- }
- }
- }
- }
-
-
- private CSSMetaModelImpl fMetaModel = null;
- private NodePool fNodePool = null;
- private Stack fNodeStack = new Stack();
- boolean fLogging = false;
- private ResourceBundle fResourceBundle = null;
-
- private final static String ATTR_NAME_DEFINITION = "name"; //$NON-NLS-1$
- private final static String ATTR_NAME_REFERENCE = "name"; //$NON-NLS-1$
- private final static String ATTR_OVERWRITE = "overwrite"; //$NON-NLS-1$
- private final static String ATTR_ENABLED = "enabled"; //$NON-NLS-1$
- private final static String ATTR_VALUE_OVERWRITE_FALSE = "false"; //$NON-NLS-1$
- private final static String ATTR_VALUE_ENABLED_FALSE = "false"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java
deleted file mode 100644
index a377136edb..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileKeywords.java
+++ /dev/null
@@ -1,58 +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.css.core.internal.metamodelimpl;
-
-interface ProfileKeywords {
-
- final static String CSS_PROFILE = "css-profile"; //$NON-NLS-1$
- final static String PROFILE_IMPORT = "profile-import"; //$NON-NLS-1$
- final static String STYLESHEET_DEF = "stylesheet-def"; //$NON-NLS-1$
- final static String CHARSET_RULE = "charset-rule"; //$NON-NLS-1$
- final static String IMPORT_RULE = "import-rule"; //$NON-NLS-1$
- final static String PAGE_RULE = "page-rule"; //$NON-NLS-1$
- final static String MEDIA_RULE = "media-rule"; //$NON-NLS-1$
- final static String FONTFACE_RULE = "fontface-rule"; //$NON-NLS-1$
- final static String STYLE_RULE = "style-rule"; //$NON-NLS-1$
- final static String CHARSET_RULE_DEF = "charset-rule-def"; //$NON-NLS-1$
- final static String IMPORT_RULE_DEF = "import-rule-def"; //$NON-NLS-1$
- final static String PAGE_RULE_DEF = "page-rule-def"; //$NON-NLS-1$
- final static String MEDIA_RULE_DEF = "media-rule-def"; //$NON-NLS-1$
- final static String FONTFACE_RULE_DEF = "fontface-rule-def"; //$NON-NLS-1$
- final static String STYLE_RULE_DEF = "style-rule-def"; //$NON-NLS-1$
- final static String FUNCTION_DEF = "function-def"; //$NON-NLS-1$
- final static String FUNCTION_VALUE = "function-value"; //$NON-NLS-1$
- final static String KEYWORD_DEF = "keyword-def"; //$NON-NLS-1$
- final static String KEYWORD_VALUE = "keyword-value"; //$NON-NLS-1$
- final static String DESCRIPTION = "description"; //$NON-NLS-1$
- final static String NUMBER_DEF = "number-def"; //$NON-NLS-1$
- final static String UNIT = "unit"; //$NON-NLS-1$
- final static String UNIT_DEF = "unit-def"; //$NON-NLS-1$
- final static String UNIT_VALUE = "unit-value"; //$NON-NLS-1$
- final static String CONTAINER_DEF = "container-def"; //$NON-NLS-1$
- final static String CATEGORY_DEF = "category-def"; //$NON-NLS-1$
- final static String CAPTION = "caption"; //$NON-NLS-1$
- final static String PROPERTY_DEF = "property-def"; //$NON-NLS-1$
- final static String DESCRIPTOR_DEF = "descriptor-def"; //$NON-NLS-1$
- final static String SELECTOR_EXPRESSION = "selector-expression"; //$NON-NLS-1$
- final static String PSEUDO_CLASS = "pseudo-class"; //$NON-NLS-1$
- final static String PSEUDO_ELEMENT = "pseudo-element"; //$NON-NLS-1$
- final static String PSEUDO_CLASS_DEF = "pseudo-class-def"; //$NON-NLS-1$
- final static String PSEUDO_ELEMENT_DEF = "pseudo-element-def"; //$NON-NLS-1$
- final static String SELECTOR_VALUE = "selector-value"; //$NON-NLS-1$
- final static String NUMBER = "number"; //$NON-NLS-1$
- final static String KEYWORD = "keyword"; //$NON-NLS-1$
- final static String FUNCTION = "function"; //$NON-NLS-1$
- final static String CONTAINER = "container"; //$NON-NLS-1$
- final static String STRING = "string"; //$NON-NLS-1$
- final static String SEPARATOR = "separator"; //$NON-NLS-1$
- final static String PROPERTY = "property"; //$NON-NLS-1$
- final static String DESCRIPTOR = "descriptor"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java
deleted file mode 100644
index 3442ab8483..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ProfileLoader.java
+++ /dev/null
@@ -1,72 +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.css.core.internal.metamodelimpl;
-
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ResourceBundle;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSMetaModel;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-
-
-class ProfileLoader {
-
-
- /**
- * Constructor for ProfileLoader.
- */
- private ProfileLoader() {
- super();
- }
-
- ProfileLoader(ResourceBundle resourceBundle, boolean logging) {
- this();
- fResourceBundle = resourceBundle;
- fLogging = logging;
- }
-
- static void loadProfile(CSSMetaModelImpl metamodel, InputStream input, ResourceBundle resourceBundle, boolean logging) {
- try {
- XMLReader xmlReader = XMLReaderUtil.createXMLReader(PARSER_NAME);
- // XMLReaderFactory.createXMLReader(PARSER_NAME);
- xmlReader.setContentHandler(new ProfileHandler(metamodel, resourceBundle, logging));
- xmlReader.parse(new InputSource(input));
- }
- catch (IOException e) {
- Logger.logException(e);
- }
- catch (SAXException e) {
- Logger.logException(e);
- }
- }
-
- CSSMetaModel loadProfile(InputStream input) {
- if (fMetaModel == null) {
- fMetaModel = new CSSMetaModelImpl();
- }
- loadProfile(fMetaModel, input, fResourceBundle, fLogging);
- fMetaModel.loadCompleted();
- return fMetaModel;
- }
-
-
- CSSMetaModelImpl fMetaModel = null;
- private final static String PARSER_NAME = "org.apache.xerces.parsers.SAXParser"; //$NON-NLS-1$
- private ResourceBundle fResourceBundle = null;
- private boolean fLogging = false;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java
deleted file mode 100644
index e4483df1d8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/RegistryReader.java
+++ /dev/null
@@ -1,113 +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.css.core.internal.metamodelimpl;
-
-
-
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.osgi.framework.Bundle;
-
-
-
-public class RegistryReader {
-
- //
- private String PLUGIN_ID = "org.eclipse.wst.sse.core"; //$NON-NLS-1$
- private String EXTENSION_POINT_ID = "cssprofile"; //$NON-NLS-1$
- private String TAG_NAME = "profile"; //$NON-NLS-1$
- private String ATT_ID = "id"; //$NON-NLS-1$
- private String ATT_NAME = "name"; //$NON-NLS-1$
- private String ATT_URI = "uri"; //$NON-NLS-1$
- private String ATT_DEFAULT = "default"; //$NON-NLS-1$
- private String ATT_LOGGING = "logging"; // Hidden Option //$NON-NLS-1$
-
- /**
- * Constructor for CSSMetaModelRegistryReader.
- */
- public RegistryReader() {
- super();
- }
-
- /**
- *
- */
- protected CSSProfile readElement(IConfigurationElement element) {
- CSSProfileImpl info = null;
- if (element.getName().equals(TAG_NAME)) {
- String strID = element.getAttribute(ATT_ID);
- String strNAME = element.getAttribute(ATT_NAME);
- String strURI = element.getAttribute(ATT_URI);
-
- if (strID != null || strURI != null) {
- Bundle bundle = null;
- String pluginId = element.getContributor().getName();
- bundle = Platform.getBundle(pluginId);
- if (bundle != null) {
- Path path = new Path(strURI);
- URL url = FileLocator.find(bundle, path, null);
- if (url != null) {
- try {
- url = FileLocator.toFileURL(url);
- info = new CSSProfileImpl(strID, url, strURI);
- info.setProfileName(strNAME);
- info.setDefault((element.getAttribute(ATT_DEFAULT) != null));
- info.setLogging((element.getAttribute(ATT_LOGGING) != null));
- info.setOwnerPluginID(pluginId);
- }
- catch (java.io.IOException e) {
- // through
- }
- }
- }
- }
-
- if (info == null) {
- Logger.log(Logger.ERROR, "Error reading CSS Profile: " + strID); //$NON-NLS-1$
- }
- }
- return info;
- }
-
- /**
- * We simply require an 'add' method, of what ever it is we are to read
- * into
- */
- public Iterator enumProfiles() {
- Set set = new HashSet();
- 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++) {
- CSSProfile info = readElement(elements[i]);
- // null can be returned if there's an error reading the
- // element
- if (info != null) {
- set.add(info);
- }
- }
- }
- return set.iterator();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java
deleted file mode 100644
index 7bb47ace80..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/ValueCollector.java
+++ /dev/null
@@ -1,50 +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.css.core.internal.metamodelimpl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSMMNode;
-import org.eclipse.wst.css.core.internal.metamodel.util.CSSMetaModelTraverser;
-
-
-
-class ValueCollector extends CSSMetaModelTraverser {
- public void begin(CSSMMNode node) {
- fNodes = new ArrayList();
- }
-
- protected short preNode(CSSMMNode node) {
- short rc = TRAV_CONT;
- if (node != null) {
- String type = node.getType();
- if (type == CSSMMNode.TYPE_PROPERTY || type == CSSMMNode.TYPE_DESCRIPTOR || type == CSSMMNode.TYPE_CONTAINER) {
- rc = TRAV_CONT;
- }
- else {
- if (!fNodes.contains(node)) {
- fNodes.add(node);
- rc = TRAV_PRUNE;
- }
- }
- }
- return rc;
- }
-
- public Iterator getNodes() {
- return fNodes.iterator();
- }
-
-
- private List fNodes = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java
deleted file mode 100644
index b303190221..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/metamodelimpl/XMLReaderUtil.java
+++ /dev/null
@@ -1,38 +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.css.core.internal.metamodelimpl;
-
-
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-
-class XMLReaderUtil {
-
- static public XMLReader createXMLReader(String className) throws SAXException {
- try {
- return SAXParserFactory.newInstance().newSAXParser().getXMLReader();
- }
- catch (ParserConfigurationException e) {
- Logger.logException(e);
- }
- catch (FactoryConfigurationError e) {
- Logger.logException(e);
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java
deleted file mode 100644
index 122a3060f6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/CSSModelLoader.java
+++ /dev/null
@@ -1,54 +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.css.core.internal.modelhandler;
-
-
-import org.eclipse.wst.css.core.internal.document.CSSModelImpl;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-import org.eclipse.wst.sse.core.internal.document.IDocumentLoader;
-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.IStructuredModel;
-
-
-/**
- *
- */
-public class CSSModelLoader extends AbstractModelLoader {
- /**
- * CSSLoader constructor comment.
- */
- public CSSModelLoader() {
- super();
- }
-
- /*
- * @see IModelLoader#newModel()
- */
- public IStructuredModel newModel() {
- IStructuredModel model = new CSSModelImpl();
- // now done in create
- // model.setStructuredDocument(createNewStructuredDocument());
- // model.setFactoryRegistry(defaultFactoryRegistry());
- return model;
- }
-
- public IModelLoader newInstance() {
- return new CSSModelLoader();
- }
-
- public IDocumentLoader getDocumentLoader() {
- if (documentLoaderInstance == null) {
- documentLoaderInstance = new CSSDocumentLoader();
- }
- return documentLoaderInstance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java
deleted file mode 100644
index 42003b49be..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/modelhandler/ModelHandlerForCSS.java
+++ /dev/null
@@ -1,56 +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.css.core.internal.modelhandler;
-
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentCharsetDetector;
-import org.eclipse.wst.css.core.internal.encoding.CSSDocumentLoader;
-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 ModelHandlerForCSS 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.css.core.csssource"; //$NON-NLS-1$
- /**
- * Needs to match what's in plugin registry. In fact, can be overwritten
- * at run time with what's in registry! (so should never be 'final')
- */
- private static String ModelHandlerID = "org.eclipse.wst.css.core.modelhandler"; //$NON-NLS-1$
-
- public ModelHandlerForCSS() {
- super();
- setId(ModelHandlerID);
- setAssociatedContentTypeId(AssociatedContentTypeID);
- }
-
- public IDocumentCharsetDetector getEncodingDetector() {
- return new CSSDocumentCharsetDetector();
- }
-
- public IDocumentLoader getDocumentLoader() {
- return new CSSDocumentLoader();
- }
-
- /*
- * @see ContentTypeDescription#getModelLoader()
- */
- public IModelLoader getModelLoader() {
- return new CSSModelLoader();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.java
deleted file mode 100644
index 1f12b959cd..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSRegionUtil.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.wst.css.core.internal.parser;
-
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-
-
-public class CSSRegionUtil {
-
- /**
- */
- public static boolean isDeclarationValueType(String type) {
- return (type == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION || type == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_IMPORTANT || type == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || type == CSSRegionContexts.CSS_DECLARATION_VALUE_OPERATOR || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE || type == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE || type == CSSRegionContexts.CSS_DECLARATION_VALUE_S || type == CSSRegionContexts.CSS_DECLARATION_VALUE_STRING || type == CSSRegionContexts.CSS_DECLARATION_VALUE_UNICODE_RANGE || type == CSSRegionContexts.CSS_DECLARATION_VALUE_URI);
- }
-
- /**
- * these type can be beggining of selector
- */
- public static boolean isSelectorBegginingType(String type) {
- return (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START);
- }
-
-
- /**
- *
- * @param type
- * @return
- */
- public static boolean isDeclarationType(String type) {
- return (type == CSSRegionContexts.CSS_DECLARATION_PROPERTY || type == CSSRegionContexts.CSS_DECLARATION_SEPARATOR || isDeclarationValueType(type) || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER);
- }
-
- /**
- * These types consist selector region
- *
- * @param type
- * @return
- */
- public static boolean isSelectorType(String type) {
- return (type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_END || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_NAME || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_OPERATOR || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_VALUE || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_COMBINATOR || type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO || type == CSSRegionContexts.CSS_SELECTOR_SEPARATOR || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.java
deleted file mode 100644
index 831336f3ba..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSSourceParser.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.css.core.internal.parser;
-
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
-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.internal.util.Debug;
-
-
-public class CSSSourceParser implements RegionParser {
- public static final int MODE_STYLESHEET = 0;
- public static final int MODE_DECLARATION = 1;
- public static final int MODE_DECLARATION_VALUE = 2;
-
- private long fStartTime;
- private long fStopTime;
- private ICSSTokenizer fTokenizer;
-
- public void setParserMode(int mode) {
- int initialState;
- int bufsize;
- switch (mode) {
- case MODE_STYLESHEET :
- initialState = CSSTokenizer.YYINITIAL;
- bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
- break;
- case MODE_DECLARATION :
- initialState = CSSTokenizer.ST_DECLARATION;
- bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
- break;
- case MODE_DECLARATION_VALUE :
- initialState = CSSTokenizer.ST_DECLARATION_PRE_VALUE;
- bufsize = CSSTokenizer.BUFFER_SIZE_SMALL;
- break;
- default :
- return;
- }
- if (0 < initialState) {
- ICSSTokenizer tokenizer = getTokenizer();
- tokenizer.setInitialState(initialState);
- tokenizer.setInitialBufferSize(bufsize);
- }
- }
-
- public IStructuredDocumentRegion getDocumentRegions() {
- IStructuredDocumentRegion headnode = null;
- if (headnode == null) {
- if (Debug.perfTest) {
- fStartTime = System.currentTimeMillis();
- }
- headnode = parseNodes();
- if (Debug.perfTest) {
- fStopTime = System.currentTimeMillis();
- System.out.println(" -- creating nodes of IStructuredDocument -- "); //$NON-NLS-1$
- System.out.println(" Time parse and init all regions: " + (fStopTime - fStartTime) + " (msecs)"); //$NON-NLS-2$//$NON-NLS-1$
- // System.out.println(" for " + fRegions.size() + "
- // Regions");//$NON-NLS-2$//$NON-NLS-1$
- System.out.println(" and " + _countNodes(headnode) + " Nodes"); //$NON-NLS-2$//$NON-NLS-1$
- }
- }
- return headnode;
- }
-
- public List getRegions() {
- IStructuredDocumentRegion headNode = null;
- if (!getTokenizer().isEOF()) {
- headNode = getDocumentRegions();
- // throw new IllegalStateException("parsing has not finished");
- }
- // for memory recovery, we assume if someone
- // requests all regions, we can reset our big
- // memory consuming objects
- // but the new "getRegions" method is then more expensive.
- // I don't think its used much, though.
- List localRegionsList = getRegions(headNode);
- primReset();
- return localRegionsList;
- }
-
- /**
- * Method getRegions.
- *
- * @param headNode
- * @return List
- */
- protected List getRegions(IStructuredDocumentRegion headNode) {
- List allRegions = new ArrayList();
- IStructuredDocumentRegion currentNode = headNode;
- while (currentNode != null) {
- ITextRegionList nodeRegions = currentNode.getRegions();
- for (int i = 0; i < nodeRegions.size(); i++) {
- allRegions.add(nodeRegions.get(i));
- }
- currentNode = currentNode.getNext();
- }
- return allRegions;
- }
-
- public void reset(Reader reader) {
- primReset();
- getTokenizer().reset(reader, 0);
- }
-
- public void reset(Reader reader, int offset) {
- reset(reader);
- }
-
- public void reset(String input) {
- reset(new StringReader(input));
- }
-
- public void reset(String input, int offset) {
- reset(input);
- }
-
- public RegionParser newInstance() {
- return new CSSSourceParser();
- }
-
- private IStructuredDocumentRegion parseNodes() {
- // regions are initially reported as complete offsets within the
- // scanned input
- // they are adjusted here to be indexes from the currentNode's start
- // offset
- IStructuredDocumentRegion headNode = null;
- IStructuredDocumentRegion lastNode = null;
- ITextRegion region = null;
- IStructuredDocumentRegion currentNode = null;
- String type = null;
- String currentRegionType = null;
-
- while ((region = getNextRegion()) != null) {
- type = region.getType();
- if (mustBeStart(type, currentRegionType) && currentNode != null) {
- currentNode.setEnded(true);
- }
-
- if ((currentNode != null && currentNode.isEnded()) || currentNode == null) {
- if (currentNode != null && !currentNode.isEnded()) {
- currentNode.setEnded(true);
- }
- lastNode = currentNode;
- currentNode = createStructuredDocumentRegion(type);
- currentRegionType = type;
- if (lastNode != null) {
- lastNode.setNext(currentNode);
- }
- currentNode.setPrevious(lastNode);
- currentNode.setStart(region.getStart());
- }
-
- currentNode.addRegion(region);
- currentNode.setLength(region.getStart() + region.getLength() - currentNode.getStart());
- region.adjustStart(-currentNode.getStart());
-
- if (mustBeEnd(type)) {
- currentNode.setEnded(true);
- }
-
- if (headNode == null && currentNode != null) {
- headNode = currentNode;
- }
- }
-
- if (currentNode != null && !currentNode.isEnded()) {
- currentNode.setEnded(true);
- }
-
- primReset();
- return headNode;
- }
-
- private IStructuredDocumentRegion createStructuredDocumentRegion(String type) {
- return CSSStructuredDocumentRegionFactory.createRegion(type);
- }
- /**
- * currently public but may be made default access protected in future.
- */
- protected boolean mustBeStart(String type, String docRegionType) {
- return ((type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_IMPORT || type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_MEDIA || type == CSSRegionContexts.CSS_FONT_FACE || type == CSSRegionContexts.CSS_CHARSET || type == CSSRegionContexts.CSS_ATKEYWORD || type == CSSRegionContexts.CSS_DECLARATION_PROPERTY || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER) || (docRegionType == CSSRegionContexts.CSS_DECLARATION_PROPERTY && type == CSSRegionContexts.CSS_S) || (!CSSRegionUtil.isSelectorBegginingType(docRegionType) && (type == CSSRegionContexts.CSS_SELECTOR_ELEMENT_NAME || type == CSSRegionContexts.CSS_SELECTOR_UNIVERSAL || type == CSSRegionContexts.CSS_SELECTOR_PSEUDO || type == CSSRegionContexts.CSS_SELECTOR_CLASS || type == CSSRegionContexts.CSS_SELECTOR_ID || type == CSSRegionContexts.CSS_SELECTOR_ATTRIBUTE_START)));
- }
- /**
- * currently public but may be made default access protected in future.
- */
- protected boolean mustBeEnd(String type) {
- return (type == CSSRegionContexts.CSS_DELIMITER || type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE || type == CSSRegionContexts.CSS_DECLARATION_DELIMITER);
- }
-
- private ITextRegion getNextRegion() {
- ITextRegion region = null;
- try {
- region = getTokenizer().getNextToken();
- // DMW: 2/12/03 Removed state
- // if (region != null) {
- // fRegions.add(region);
- // }
- return region;
- }
- catch (StackOverflowError e) {
- Logger.logException(getClass().getName() + ": input could not be parsed correctly at position " + getTokenizer().getOffset(), e); //$NON-NLS-1$
- throw e;
- }
- catch (Exception e) {
- Logger.logException(getClass().getName() + ": input could not be parsed correctly at position " + getTokenizer().getOffset() + " (" + e.getLocalizedMessage() + ")", e); //$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- }
- return null;
- }
-
- private void primReset() {
-
- getTokenizer().reset(new char[0]);
- }
- /**
- * currently public but may be made default access protected in future.
- */
- public ICSSTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new CSSTokenizer();
- }
- return fTokenizer;
- }
-
-
- /**
- * This is a simple utility to count nodes. Used only for debug
- * statements.
- */
- private int _countNodes(IStructuredDocumentRegion nodes) {
- int result = 0;
- IStructuredDocumentRegion countNode = nodes;
- while (countNode != null) {
- result++;
- countNode = countNode.getNext();
- }
- return result;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java
deleted file mode 100644
index bd9f233c5d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,27 +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.css.core.internal.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-public class CSSStructuredDocumentRegionFactory {
- public static IStructuredDocumentRegion createRegion(String type) {
- IStructuredDocumentRegion instance = null;
- if (type != null) {
- instance = new BasicStructuredDocumentRegion();
- }
- else {
-
- }
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
deleted file mode 100644
index 1b114c5fc1..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/CSSTokenizer.java
+++ /dev/null
@@ -1,1972 +0,0 @@
-/* The following code was generated by JFlex 1.4.2 on 7/17/08 1:09 AM */
-
-/*******************************************************************************
- * 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
- *******************************************************************************/
-/*nlsXXX*/
-package org.eclipse.wst.css.core.internal.parser;
-
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parser.regions.CSSTextRegionFactory;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.jflex.de/">JFlex</a> 1.4.2
- * on 7/17/08 1:09 AM from the specification file
- * <tt>CSSTokenizer.jflex</tt>
- */
-public class CSSTokenizer implements CSSRegionContexts, ICSSTokenizer {
-
- /** This character denotes the end of file */
- public static final int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
- private static final int ZZ_BUFFERSIZE = 16384;
-
- /** lexical states */
- public static final int ST_SELECTOR_ATTRIBUTE_NAME = 26;
- public static final int ST_IMPORT_DELIMITER = 10;
- public static final int ST_DECLARATION_PRE_VALUE = 38;
- public static final int ST_SELECTOR = 22;
- public static final int ST_CHARSET_DELIMITER = 4;
- public static final int ST_DECLARATION_VALUE = 40;
- public static final int ST_PAGE_PSEUDO_PAGE = 16;
- public static final int ST_IMPORT_URI = 6;
- public static final int ST_SELECTOR_ATTRIBUTE_END = 32;
- public static final int ST_SELECTOR_ATTRIBUTE_OPERATOR = 28;
- public static final int ST_DECLARATION = 34;
- public static final int ST_PAGE_DELIMITER = 18;
- public static final int ST_SELECTOR_ATTRIBUTE_VALUE = 30;
- public static final int ST_MEDIA_MEDIUM = 12;
- public static final int ST_CHARSET_NAME = 2;
- public static final int ST_IMPORT_MEDIUM = 8;
- public static final int ST_DECLARATION_SEPARATOR = 36;
- public static final int ST_FONT_FACE_DELIMITER = 20;
- public static final int ST_MEDIA_DELIMITER = 14;
- public static final int ST_SELECTOR_MODIFIER = 24;
- public static final int YYINITIAL = 0;
-
- /**
- * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
- * ZZ_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 static final int ZZ_LEXSTATE[] = {
- 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 8, 9, 9, 9, 9, 0, 0, 10, 10, 11, 11, 12, 12, 13, 13,
- 14, 14, 15, 15, 16, 16, 17, 17, 18, 18
- };
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\11\0\1\12\1\17\1\0\1\4\1\20\22\0\1\6\1\31\1\11"+
- "\1\21\1\16\1\72\1\16\1\5\1\25\1\13\1\35\1\15\1\55"+
- "\1\10\1\14\1\34\12\1\1\62\1\50\1\30\1\67\1\32\1\27"+
- "\1\36\1\43\1\26\1\40\1\57\1\46\1\64\1\61\1\41\1\51"+
- "\2\2\1\24\1\52\1\65\1\54\1\53\1\2\1\23\1\44\1\47"+
- "\1\22\5\2\1\66\1\3\1\71\1\16\1\2\1\16\1\42\1\7"+
- "\1\37\1\56\1\45\1\63\1\61\1\41\1\51\2\2\1\24\1\52"+
- "\1\65\1\54\1\53\1\2\1\23\1\44\1\47\1\22\5\2\1\60"+
- "\1\70\1\33\1\70\1\0\uff80\2";
-
- /**
- * Translates characters to character classes
- */
- private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
-
- /**
- * Translates DFA states to action switch labels.
- */
- private static final int [] ZZ_ACTION = zzUnpackAction();
-
- private static final String ZZ_ACTION_PACKED_0 =
- "\23\0\1\1\1\2\1\1\1\3\4\1\1\4\1\1"+
- "\1\5\1\1\1\6\1\7\3\1\1\10\3\1\1\11"+
- "\2\1\1\12\1\13\2\1\1\14\1\15\1\16\2\1"+
- "\1\17\1\1\1\3\1\20\1\21\1\22\2\1\1\23"+
- "\1\1\1\24\1\25\4\1\1\26\2\1\1\27\1\30"+
- "\1\31\1\32\4\1\1\33\3\1\1\32\1\1\2\34"+
- "\1\3\1\0\1\2\1\0\1\35\1\0\1\36\10\0"+
- "\1\6\4\0\1\37\4\0\1\40\4\0\1\11\1\0"+
- "\1\13\1\0\1\16\1\0\1\41\1\0\1\22\1\0"+
- "\1\25\2\0\1\25\3\0\1\26\1\42\3\0\1\43"+
- "\1\0\1\32\1\44\1\32\2\0\1\45\2\0\1\31"+
- "\1\46\2\0\1\32\2\0\1\47\1\2\1\50\1\35"+
- "\1\36\10\0\1\6\1\0\1\37\2\0\1\37\2\0"+
- "\1\40\2\0\1\40\2\0\1\11\1\13\1\16\1\22"+
- "\1\25\1\0\1\25\2\0\1\25\1\0\1\26\1\42"+
- "\1\32\1\0\1\32\1\0\1\45\2\0\1\45\1\0"+
- "\1\46\1\51\1\32\1\0\1\2\1\35\1\36\1\52"+
- "\1\53\10\0\1\6\5\0\1\11\1\13\1\16\1\22"+
- "\1\25\2\0\1\26\1\42\2\32\2\0\1\46\1\51"+
- "\1\0\1\44\1\0\1\2\1\35\1\36\3\0\1\54"+
- "\2\0\1\6\1\0\1\6\10\0\1\55\1\11\1\13"+
- "\1\16\1\22\1\25\2\0\1\26\1\42\2\32\2\0"+
- "\1\46\2\51\5\0\1\56\1\0\1\2\1\35\1\36"+
- "\2\0\1\57\2\0\1\6\6\0\1\55\2\0\1\11"+
- "\1\13\1\16\1\22\1\25\2\0\1\26\1\42\2\32"+
- "\2\0\1\46\2\51\2\0\1\56\3\0\1\2\1\35"+
- "\1\36\1\0\1\60\2\0\1\6\13\0\1\11\1\13"+
- "\1\16\1\22\1\25\2\0\1\26\1\42\2\32\2\0"+
- "\1\46\2\51\10\0\1\35\1\36\1\61\2\0\1\6"+
- "\6\0\1\55\1\0\1\55\2\0\1\42\1\32\2\0"+
- "\1\46\2\51\2\0\1\56\1\0\1\56\6\0\1\32"+
- "\1\51\4\0\1\62\4\0\1\51\3\0\1\63\12\0";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[434];
- int offset = 0;
- offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackAction(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- do result[j++] = value; while (--count > 0);
- }
- return j;
- }
-
-
- /**
- * Translates a state to a row index in the transition table
- */
- private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
-
- private static final String ZZ_ROWMAP_PACKED_0 =
- "\0\0\0\73\0\166\0\261\0\354\0\u0127\0\u0162\0\u019d"+
- "\0\u01d8\0\u0213\0\u024e\0\u0289\0\u02c4\0\u02ff\0\u033a\0\u0375"+
- "\0\u03b0\0\u03eb\0\u0426\0\u0461\0\u049c\0\u04d7\0\u0512\0\u054d"+
- "\0\u0588\0\u05c3\0\u05fe\0\u0461\0\u0639\0\u0461\0\u0674\0\u06af"+
- "\0\u0461\0\u06ea\0\u0725\0\u0760\0\u0461\0\u079b\0\u07d6\0\u0811"+
- "\0\u084c\0\u0887\0\u08c2\0\u0461\0\u08fd\0\u0938\0\u0973\0\u0461"+
- "\0\u0461\0\u09ae\0\u09e9\0\u0a24\0\u0461\0\u0a5f\0\u0a9a\0\u0461"+
- "\0\u0461\0\u0ad5\0\u0b10\0\u0b4b\0\u0461\0\u0b86\0\u0461\0\u0bc1"+
- "\0\u0bfc\0\u0c37\0\u0c72\0\u0cad\0\u0ce8\0\u0d23\0\u0d5e\0\u0461"+
- "\0\u0461\0\u0d99\0\u0dd4\0\u0e0f\0\u0e4a\0\u0e85\0\u0ec0\0\u0461"+
- "\0\u0efb\0\u0f36\0\u0f71\0\u0fac\0\u0fe7\0\u0639\0\u0461\0\u1022"+
- "\0\u04d7\0\u105d\0\u1098\0\u0588\0\u10d3\0\u05c3\0\u110e\0\u1149"+
- "\0\u1184\0\u11bf\0\u11fa\0\u1235\0\u1270\0\u12ab\0\u12e6\0\u1321"+
- "\0\u135c\0\u06ea\0\u1397\0\u0461\0\u0760\0\u13d2\0\u079b\0\u140d"+
- "\0\u0461\0\u07d6\0\u1448\0\u1483\0\u0887\0\u14be\0\u0938\0\u14f9"+
- "\0\u09e9\0\u1534\0\u156f\0\u0461\0\u0b10\0\u15aa\0\u0bfc\0\u15e5"+
- "\0\u0c37\0\u1620\0\u0461\0\u0cad\0\u165b\0\u0d23\0\u1696\0\u16d1"+
- "\0\u170c\0\u1747\0\u0efb\0\u0461\0\u0e0f\0\u1782\0\u0461\0\u17bd"+
- "\0\u0e4a\0\u17f8\0\u0461\0\u0ec0\0\u1833\0\u186e\0\u0f71\0\u18a9"+
- "\0\u18e4\0\u191f\0\u0fe7\0\u195a\0\u0461\0\u1995\0\u0461\0\u19d0"+
- "\0\u1a0b\0\u1a46\0\u1a81\0\u1abc\0\u1af7\0\u1b32\0\u1b6d\0\u1ba8"+
- "\0\u1be3\0\u1c1e\0\u1c59\0\u06ea\0\u1c94\0\u1ccf\0\u0760\0\u1d0a"+
- "\0\u1d45\0\u079b\0\u1d80\0\u1dbb\0\u07d6\0\u1df6\0\u1e31\0\u1e6c"+
- "\0\u1ea7\0\u1ee2\0\u1f1d\0\u1f58\0\u1f93\0\u0c37\0\u1fce\0\u2009"+
- "\0\u0cad\0\u2044\0\u207f\0\u20ba\0\u20f5\0\u2130\0\u216b\0\u21a6"+
- "\0\u0e4a\0\u21e1\0\u221c\0\u0ec0\0\u2257\0\u2292\0\u22cd\0\u2308"+
- "\0\u2343\0\u237e\0\u23b9\0\u23f4\0\u0461\0\u0461\0\u242f\0\u246a"+
- "\0\u24a5\0\u24e0\0\u251b\0\u2556\0\u2591\0\u25cc\0\u2607\0\u2642"+
- "\0\u267d\0\u26b8\0\u26f3\0\u272e\0\u2769\0\u27a4\0\u27df\0\u281a"+
- "\0\u2855\0\u2890\0\u28cb\0\u2906\0\u2941\0\u297c\0\u29b7\0\u29f2"+
- "\0\u2a2d\0\u2a68\0\u2aa3\0\u2ade\0\u2b19\0\u2b54\0\u2b8f\0\u2bca"+
- "\0\u2c05\0\u2c40\0\u2c7b\0\u2cb6\0\u0461\0\u2cf1\0\u2d2c\0\u0461"+
- "\0\u2d67\0\u2da2\0\u2ddd\0\u2e18\0\u2e53\0\u2e8e\0\u2ec9\0\u2f04"+
- "\0\u2f3f\0\u2f7a\0\u0461\0\u2fb5\0\u2ff0\0\u302b\0\u3066\0\u30a1"+
- "\0\u30dc\0\u3117\0\u3152\0\u318d\0\u31c8\0\u3203\0\u323e\0\u3279"+
- "\0\u32b4\0\u32ef\0\u332a\0\u3365\0\u33a0\0\u2b19\0\u33db\0\u3416"+
- "\0\u0461\0\u3451\0\u348c\0\u34c7\0\u3502\0\u353d\0\u3578\0\u0461"+
- "\0\u35b3\0\u35ee\0\u3629\0\u3664\0\u369f\0\u36da\0\u3715\0\u3750"+
- "\0\u378b\0\u2ec9\0\u37c6\0\u3801\0\u383c\0\u3877\0\u38b2\0\u38ed"+
- "\0\u3928\0\u3963\0\u399e\0\u39d9\0\u3a14\0\u3a4f\0\u3a8a\0\u3ac5"+
- "\0\u3b00\0\u3b3b\0\u3b76\0\u3bb1\0\u3bec\0\u3c27\0\u3365\0\u3c62"+
- "\0\u3c9d\0\u3cd8\0\u3d13\0\u3d4e\0\u3d89\0\u3dc4\0\u0461\0\u3dff"+
- "\0\u3e3a\0\u3e75\0\u3eb0\0\u3eeb\0\u3f26\0\u3f61\0\u3f9c\0\u3fd7"+
- "\0\u4012\0\u404d\0\u4088\0\u40c3\0\u40fe\0\u4139\0\u4174\0\u41af"+
- "\0\u41ea\0\u4225\0\u4260\0\u429b\0\u42d6\0\u4311\0\u434c\0\u4387"+
- "\0\u43c2\0\u43fd\0\u4438\0\u4473\0\u44ae\0\u44e9\0\u4524\0\u455f"+
- "\0\u459a\0\u45d5\0\u4610\0\u464b\0\u4686\0\u46c1\0\u46fc\0\u0461"+
- "\0\u4737\0\u4772\0\u47ad\0\u47e8\0\u4823\0\u485e\0\u4899\0\u48d4"+
- "\0\u490f\0\u2f3f\0\u494a\0\u2f7a\0\u4985\0\u49c0\0\u49fb\0\u4a36"+
- "\0\u4a71\0\u4aac\0\u4ae7\0\u4b22\0\u4b5d\0\u4b98\0\u4bd3\0\u33db"+
- "\0\u4c0e\0\u3416\0\u4c49\0\u4c84\0\u4cbf\0\u4cfa\0\u4d35\0\u4d70"+
- "\0\u4dab\0\u4de6\0\u4e21\0\u4e5c\0\u4e97\0\u4ed2\0\u0461\0\u4f0d"+
- "\0\u4f48\0\u4f83\0\u4fbe\0\u0461\0\u4ff9\0\u5034\0\u506f\0\u0461"+
- "\0\u50aa\0\u50e5\0\u5120\0\u515b\0\u5196\0\u51d1\0\u520c\0\u5247"+
- "\0\u5282\0\u52bd";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[434];
- int offset = 0;
- offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackRowMap(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int high = packed.charAt(i++) << 16;
- result[j++] = high | packed.charAt(i++);
- }
- return j;
- }
-
- /**
- * The transition table of the DFA
- */
- private static final int [] ZZ_TRANS = zzUnpackTrans();
-
- private static final String ZZ_TRANS_PACKED_0 =
- "\2\24\1\25\1\26\1\27\1\24\1\27\1\25\1\30"+
- "\1\24\1\27\1\24\1\31\2\24\2\27\1\32\3\25"+
- "\1\24\1\25\1\24\1\33\2\24\1\34\1\35\1\36"+
- "\1\37\11\25\1\24\4\25\1\24\2\25\1\24\1\25"+
- "\1\40\3\25\1\41\10\24\1\27\1\42\1\27\1\24"+
- "\1\43\1\44\1\27\4\24\2\27\7\24\1\33\2\24"+
- "\1\34\1\35\1\24\1\37\40\24\1\27\1\24\1\27"+
- "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33"+
- "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\26\24"+
- "\1\27\1\46\1\27\1\24\1\43\1\47\1\27\4\24"+
- "\2\27\1\24\1\50\5\24\1\33\2\24\1\34\1\35"+
- "\1\24\1\37\11\24\1\45\24\24\1\51\1\52\1\27"+
- "\1\24\1\27\1\51\1\53\1\24\1\27\4\24\2\27"+
- "\1\24\3\51\1\24\1\51\1\24\1\33\2\24\1\34"+
- "\1\35\1\24\1\37\11\51\1\45\4\51\1\24\2\51"+
- "\1\24\1\51\1\24\3\51\11\24\1\27\1\24\1\27"+
- "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33"+
- "\2\24\1\34\1\35\1\24\1\37\11\24\1\45\4\24"+
- "\1\54\17\24\1\55\1\56\1\27\1\24\1\27\1\55"+
- "\1\57\1\24\1\27\4\24\2\27\1\24\3\55\1\24"+
- "\1\55\1\24\1\33\2\24\1\34\1\35\1\24\1\37"+
- "\11\55\1\24\4\55\1\24\2\55\1\24\1\55\1\24"+
- "\3\55\11\24\1\27\1\24\1\27\1\24\1\43\1\24"+
- "\1\27\4\24\2\27\7\24\1\33\2\24\1\34\1\35"+
- "\1\24\1\37\16\24\1\60\2\24\1\61\14\24\1\62"+
- "\1\63\1\27\1\24\1\27\1\62\1\64\1\24\1\27"+
- "\4\24\2\27\1\24\3\62\1\24\1\62\1\24\1\33"+
- "\2\24\1\34\1\35\1\24\1\37\11\62\1\24\4\62"+
- "\1\24\2\62\1\65\1\62\1\66\3\62\11\24\1\27"+
- "\1\24\1\27\1\24\1\43\1\24\1\27\4\24\2\27"+
- "\7\24\1\33\2\24\1\34\1\35\1\24\1\37\21\24"+
- "\1\65\16\24\1\67\1\24\1\67\1\24\1\43\1\24"+
- "\1\67\1\24\1\31\1\70\1\24\2\67\1\32\6\24"+
- "\1\33\1\24\1\70\1\34\1\35\1\36\1\37\16\24"+
- "\1\71\2\24\1\65\1\24\1\40\3\24\1\41\6\24"+
- "\1\72\1\73\1\27\1\24\1\27\1\72\1\74\1\24"+
- "\1\27\4\24\2\27\1\24\3\72\1\24\1\72\1\24"+
- "\1\33\2\24\1\34\1\35\1\24\1\37\11\72\1\24"+
- "\4\72\1\24\2\72\1\24\1\72\1\24\3\72\11\24"+
- "\1\27\1\24\1\27\1\24\1\43\1\24\1\27\4\24"+
- "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
- "\30\24\1\75\1\76\1\77\3\24\1\100\1\101\1\27"+
- "\1\102\1\27\1\100\1\103\1\104\1\27\4\24\2\27"+
- "\1\24\3\100\1\24\1\100\1\24\1\33\2\24\1\34"+
- "\1\35\1\24\1\37\11\100\1\24\4\100\1\24\2\100"+
- "\1\24\1\100\1\24\3\100\11\24\1\27\1\24\1\27"+
- "\1\24\1\43\1\24\1\27\4\24\2\27\7\24\1\33"+
- "\2\24\1\34\1\35\1\24\1\37\32\24\1\77\3\24"+
- "\1\105\1\106\1\27\1\24\1\27\1\105\1\107\1\24"+
- "\1\27\4\24\2\27\1\24\3\105\1\24\1\105\1\24"+
- "\1\33\2\24\1\34\1\35\1\24\1\37\11\105\1\110"+
- "\4\105\1\24\2\105\1\24\1\105\1\24\3\105\11\24"+
- "\1\27\1\24\1\27\1\24\1\43\1\24\1\27\4\24"+
- "\2\27\7\24\1\33\2\24\1\34\1\35\1\24\1\37"+
- "\11\24\1\110\11\24\1\111\11\24\1\112\1\113\1\114"+
- "\1\27\1\115\1\27\1\113\1\116\1\117\1\27\1\120"+
- "\1\121\1\122\1\24\2\27\1\123\1\124\2\113\1\24"+
- "\1\113\1\24\1\33\1\125\1\24\1\34\1\126\1\24"+
- "\1\37\11\113\1\110\4\113\1\127\2\113\1\24\1\113"+
- "\1\24\3\113\6\24\1\112\1\113\1\114\1\130\1\115"+
- "\1\130\1\113\1\116\1\117\1\130\1\120\1\121\1\122"+
- "\1\24\2\130\1\123\1\124\2\113\1\24\1\113\1\24"+
- "\1\33\1\125\1\24\1\34\1\126\1\24\1\37\11\113"+
- "\1\110\4\113\1\127\2\113\1\24\1\113\1\24\3\113"+
- "\5\24\74\0\2\25\1\131\3\0\2\25\11\0\3\25"+
- "\1\0\1\25\10\0\11\25\1\0\4\25\1\0\2\25"+
- "\1\0\1\25\1\0\3\25\6\0\1\132\2\25\1\0"+
- "\2\25\1\132\2\25\1\0\4\25\2\0\16\25\1\132"+
- "\2\25\1\132\2\25\1\132\10\25\1\132\4\25\1\132"+
- "\7\25\4\0\1\27\1\0\1\27\3\0\1\27\4\0"+
- "\2\27\54\0\1\25\1\131\3\0\1\25\1\133\11\0"+
- "\3\25\1\0\1\25\10\0\11\25\1\0\4\25\1\0"+
- "\2\25\1\0\1\25\1\0\3\25\6\0\2\134\1\135"+
- "\3\0\2\134\11\0\3\134\1\0\1\134\10\0\11\134"+
- "\1\0\4\134\1\0\2\134\1\0\1\134\1\0\3\134"+
- "\6\0\2\136\1\137\3\0\2\136\11\0\3\136\1\0"+
- "\1\136\10\0\11\136\1\0\4\136\1\0\2\136\1\0"+
- "\1\136\1\0\3\136\36\0\1\140\76\0\1\141\74\0"+
- "\2\142\10\0\1\143\1\144\1\145\7\0\2\146\10\0"+
- "\1\147\1\150\3\0\1\147\1\151\11\0\3\147\1\0"+
- "\1\147\10\0\11\147\1\0\4\147\1\0\2\147\1\0"+
- "\1\147\1\0\3\147\6\0\2\152\1\153\1\0\1\154"+
- "\11\152\2\0\52\152\10\0\1\133\63\0\2\155\1\156"+
- "\1\0\4\155\1\154\5\155\2\0\52\155\1\0\2\157"+
- "\1\160\1\0\1\161\11\157\2\0\52\157\1\0\2\162"+
- "\1\163\1\0\4\162\1\161\5\162\2\0\52\162\23\0"+
- "\1\164\50\0\2\51\1\165\3\0\2\51\11\0\3\51"+
- "\1\0\1\51\10\0\11\51\1\0\4\51\1\0\2\51"+
- "\1\0\1\51\1\0\3\51\6\0\1\166\2\51\1\0"+
- "\2\51\1\166\2\51\1\0\4\51\2\0\16\51\1\166"+
- "\2\51\1\166\2\51\1\166\10\51\1\166\4\51\1\166"+
- "\7\51\2\0\1\51\1\165\3\0\1\51\1\133\11\0"+
- "\3\51\1\0\1\51\10\0\11\51\1\0\4\51\1\0"+
- "\2\51\1\0\1\51\1\0\3\51\6\0\2\55\1\167"+
- "\3\0\2\55\11\0\3\55\1\0\1\55\10\0\11\55"+
- "\1\0\4\55\1\0\2\55\1\0\1\55\1\0\3\55"+
- "\6\0\1\170\2\55\1\0\2\55\1\170\2\55\1\0"+
- "\4\55\2\0\16\55\1\170\2\55\1\170\2\55\1\170"+
- "\10\55\1\170\4\55\1\170\7\55\2\0\1\55\1\167"+
- "\3\0\1\55\1\133\11\0\3\55\1\0\1\55\10\0"+
- "\11\55\1\0\4\55\1\0\2\55\1\0\1\55\1\0"+
- "\3\55\6\0\2\62\1\171\3\0\2\62\11\0\3\62"+
- "\1\0\1\62\10\0\11\62\1\0\4\62\1\0\2\62"+
- "\1\0\1\62\1\0\3\62\6\0\1\172\2\62\1\0"+
- "\2\62\1\172\2\62\1\0\4\62\2\0\16\62\1\172"+
- "\2\62\1\172\2\62\1\172\10\62\1\172\4\62\1\172"+
- "\7\62\2\0\1\62\1\171\3\0\1\62\1\133\11\0"+
- "\3\62\1\0\1\62\10\0\11\62\1\0\4\62\1\0"+
- "\2\62\1\0\1\62\1\0\3\62\7\0\1\62\1\171"+
- "\3\0\1\62\1\173\11\0\3\62\1\0\1\62\10\0"+
- "\11\62\1\0\4\62\1\0\2\62\1\0\1\62\1\0"+
- "\3\62\5\0\4\174\1\67\1\174\1\67\3\174\1\67"+
- "\2\174\1\0\1\174\2\67\11\174\1\0\1\174\1\0"+
- "\20\174\1\0\2\174\1\0\12\174\1\0\2\72\1\175"+
- "\3\0\2\72\11\0\3\72\1\0\1\72\10\0\11\72"+
- "\1\0\4\72\1\0\2\72\1\0\1\72\1\0\3\72"+
- "\6\0\1\176\2\72\1\0\2\72\1\176\2\72\1\0"+
- "\4\72\2\0\16\72\1\176\2\72\1\176\2\72\1\176"+
- "\10\72\1\176\4\72\1\176\7\72\2\0\1\72\1\175"+
- "\3\0\1\72\1\133\11\0\3\72\1\0\1\72\10\0"+
- "\11\72\1\0\4\72\1\0\2\72\1\0\1\72\1\0"+
- "\3\72\74\0\1\75\4\0\2\100\1\177\3\0\2\100"+
- "\11\0\3\100\1\0\1\100\10\0\11\100\1\0\4\100"+
- "\1\0\2\100\1\0\1\100\1\0\3\100\6\0\1\200"+
- "\2\100\1\0\2\100\1\200\2\100\1\0\4\100\2\0"+
- "\16\100\1\200\2\100\1\200\2\100\1\200\10\100\1\200"+
- "\4\100\1\200\7\100\1\0\2\201\1\202\1\0\1\203"+
- "\11\201\2\0\52\201\2\0\1\100\1\177\3\0\1\100"+
- "\1\133\11\0\3\100\1\0\1\100\10\0\11\100\1\0"+
- "\4\100\1\0\2\100\1\0\1\100\1\0\3\100\6\0"+
- "\2\204\1\205\1\0\4\204\1\203\5\204\2\0\52\204"+
- "\1\0\2\105\1\206\3\0\2\105\11\0\3\105\1\0"+
- "\1\105\10\0\11\105\1\0\4\105\1\0\2\105\1\0"+
- "\1\105\1\0\3\105\6\0\1\207\2\105\1\0\2\105"+
- "\1\207\2\105\1\0\4\105\2\0\16\105\1\207\2\105"+
- "\1\207\2\105\1\207\10\105\1\207\4\105\1\207\7\105"+
- "\2\0\1\105\1\206\3\0\1\105\1\133\11\0\3\105"+
- "\1\0\1\105\10\0\11\105\1\0\4\105\1\0\2\105"+
- "\1\0\1\105\1\0\3\105\6\0\1\112\1\210\1\211"+
- "\3\0\1\210\1\212\3\0\1\213\5\0\3\210\1\0"+
- "\1\210\10\0\11\210\1\0\4\210\1\0\2\210\1\0"+
- "\1\210\1\0\3\210\4\0\1\214\1\0\2\113\1\215"+
- "\3\0\2\113\3\0\1\216\5\0\3\113\1\217\1\113"+
- "\10\0\11\113\1\0\4\113\1\0\2\113\1\0\1\113"+
- "\1\0\3\113\6\0\1\220\2\113\1\0\2\113\1\220"+
- "\2\113\1\0\4\113\2\0\16\113\1\220\2\113\1\220"+
- "\2\113\1\220\10\113\1\220\4\113\1\220\7\113\1\0"+
- "\2\221\1\222\1\0\1\223\11\221\2\0\52\221\1\0"+
- "\1\112\1\113\1\215\3\0\1\113\1\133\3\0\1\213"+
- "\5\0\3\113\1\0\1\113\10\0\11\113\1\0\4\113"+
- "\1\0\2\113\1\0\1\113\1\0\3\113\6\0\2\224"+
- "\1\225\1\0\4\224\1\223\5\224\2\0\52\224\1\0"+
- "\1\226\72\0\1\112\12\0\1\213\57\0\2\227\1\230"+
- "\3\0\2\227\11\0\3\227\1\0\1\227\10\0\11\227"+
- "\1\0\4\227\1\0\2\227\1\0\1\227\1\0\3\227"+
- "\6\0\2\113\1\215\3\0\2\113\3\0\1\216\1\231"+
- "\4\0\1\113\1\232\1\113\1\217\1\113\10\0\11\113"+
- "\1\0\4\113\1\0\2\113\1\0\1\113\1\0\3\113"+
- "\11\0\1\233\1\0\1\233\3\0\1\233\4\0\2\233"+
- "\30\0\1\234\21\0\4\235\1\130\1\235\1\130\3\235"+
- "\1\130\4\235\2\130\12\235\1\0\14\235\1\0\22\235"+
- "\1\0\1\236\1\25\1\131\1\25\1\0\1\25\1\236"+
- "\1\25\1\0\1\25\4\0\2\25\1\0\3\25\1\0"+
- "\1\25\10\0\1\236\2\25\1\236\2\25\1\236\2\25"+
- "\1\0\4\25\1\0\1\236\1\25\1\0\1\25\1\0"+
- "\1\236\2\25\37\0\1\237\41\0\1\240\2\134\1\0"+
- "\2\134\1\240\2\134\1\0\4\134\2\0\16\134\1\240"+
- "\2\134\1\240\2\134\1\240\10\134\1\240\4\134\1\240"+
- "\7\134\1\0\1\241\2\136\1\0\2\136\1\241\2\136"+
- "\1\0\4\136\2\0\16\136\1\241\2\136\1\241\2\136"+
- "\1\241\10\136\1\241\4\136\1\241\7\136\10\0\1\242"+
- "\62\0\35\141\1\243\35\141\41\0\1\244\103\0\1\245"+
- "\65\0\2\246\66\0\2\247\103\0\1\250\17\0\2\147"+
- "\1\150\3\0\2\147\11\0\3\147\1\251\1\147\10\0"+
- "\11\147\1\0\4\147\1\0\2\147\1\0\1\147\1\0"+
- "\3\147\6\0\1\252\2\147\1\0\2\147\1\252\2\147"+
- "\1\0\4\147\2\0\16\147\1\252\2\147\1\252\2\147"+
- "\1\252\10\147\1\252\4\147\1\252\7\147\2\0\1\147"+
- "\1\150\3\0\1\147\12\0\3\147\1\0\1\147\10\0"+
- "\11\147\1\0\4\147\1\0\2\147\1\0\1\147\1\0"+
- "\3\147\6\0\1\253\1\152\1\153\1\152\1\254\1\152"+
- "\1\253\10\152\1\255\16\152\1\253\2\152\1\253\2\152"+
- "\1\253\10\152\1\253\4\152\1\253\7\152\1\0\1\256"+
- "\1\155\1\156\3\155\1\256\1\155\1\257\6\155\1\260"+
- "\16\155\1\256\2\155\1\256\2\155\1\256\10\155\1\256"+
- "\4\155\1\256\7\155\1\0\1\261\1\157\1\160\1\157"+
- "\1\262\1\157\1\261\10\157\1\263\16\157\1\261\2\157"+
- "\1\261\2\157\1\261\10\157\1\261\4\157\1\261\7\157"+
- "\1\0\1\264\1\162\1\163\3\162\1\264\1\162\1\265"+
- "\6\162\1\266\16\162\1\264\2\162\1\264\2\162\1\264"+
- "\10\162\1\264\4\162\1\264\7\162\24\0\1\267\47\0"+
- "\1\270\1\51\1\165\1\51\1\0\1\51\1\270\1\51"+
- "\1\0\1\51\4\0\2\51\1\0\3\51\1\0\1\51"+
- "\10\0\1\270\2\51\1\270\2\51\1\270\2\51\1\0"+
- "\4\51\1\0\1\270\1\51\1\0\1\51\1\0\1\270"+
- "\2\51\6\0\1\271\1\55\1\167\1\55\1\0\1\55"+
- "\1\271\1\55\1\0\1\55\4\0\2\55\1\0\3\55"+
- "\1\0\1\55\10\0\1\271\2\55\1\271\2\55\1\271"+
- "\2\55\1\0\4\55\1\0\1\271\1\55\1\0\1\55"+
- "\1\0\1\271\2\55\6\0\1\272\1\62\1\171\1\62"+
- "\1\0\1\62\1\272\1\62\1\0\1\62\4\0\2\62"+
- "\1\0\3\62\1\0\1\62\10\0\1\272\2\62\1\272"+
- "\2\62\1\272\2\62\1\0\4\62\1\0\1\272\1\62"+
- "\1\0\1\62\1\0\1\272\2\62\7\0\1\62\1\171"+
- "\3\0\1\62\12\0\3\62\1\0\1\62\10\0\11\62"+
- "\1\0\4\62\1\0\2\62\1\0\1\62\1\0\3\62"+
- "\6\0\1\273\1\72\1\175\1\72\1\0\1\72\1\273"+
- "\1\72\1\0\1\72\4\0\2\72\1\0\3\72\1\0"+
- "\1\72\10\0\1\273\2\72\1\273\2\72\1\273\2\72"+
- "\1\0\4\72\1\0\1\273\1\72\1\0\1\72\1\0"+
- "\1\273\2\72\6\0\1\274\1\100\1\177\1\100\1\0"+
- "\1\100\1\274\1\100\1\0\1\100\4\0\2\100\1\0"+
- "\3\100\1\0\1\100\10\0\1\274\2\100\1\274\2\100"+
- "\1\274\2\100\1\0\4\100\1\0\1\274\1\100\1\0"+
- "\1\100\1\0\1\274\2\100\6\0\1\275\1\201\1\202"+
- "\1\201\1\276\1\201\1\275\10\201\1\277\16\201\1\275"+
- "\2\201\1\275\2\201\1\275\10\201\1\275\4\201\1\275"+
- "\7\201\1\0\1\300\1\204\1\205\3\204\1\300\1\204"+
- "\1\301\6\204\1\302\16\204\1\300\2\204\1\300\2\204"+
- "\1\300\10\204\1\300\4\204\1\300\7\204\1\0\1\303"+
- "\1\105\1\206\1\105\1\0\1\105\1\303\1\105\1\0"+
- "\1\105\4\0\2\105\1\0\3\105\1\0\1\105\10\0"+
- "\1\303\2\105\1\303\2\105\1\303\2\105\1\0\4\105"+
- "\1\0\1\303\1\105\1\0\1\105\1\0\1\303\2\105"+
- "\6\0\2\210\1\211\3\0\2\210\11\0\3\210\1\0"+
- "\1\210\10\0\11\210\1\0\4\210\1\0\2\210\1\0"+
- "\1\210\1\0\3\210\6\0\1\304\2\210\1\0\2\210"+
- "\1\304\2\210\1\0\4\210\2\0\16\210\1\304\2\210"+
- "\1\304\2\210\1\304\10\210\1\304\4\210\1\304\7\210"+
- "\2\0\1\210\1\211\3\0\1\210\12\0\3\210\1\0"+
- "\1\210\10\0\11\210\1\0\4\210\1\0\2\210\1\0"+
- "\1\210\1\0\3\210\6\0\2\305\1\306\3\0\2\305"+
- "\11\0\3\305\1\0\1\305\10\0\11\305\1\0\4\305"+
- "\1\0\2\305\1\0\1\305\1\0\3\305\6\0\1\307"+
- "\1\113\1\215\1\113\1\0\1\113\1\307\1\113\1\0"+
- "\1\113\1\0\1\216\2\0\2\113\1\0\3\113\1\217"+
- "\1\113\10\0\1\307\2\113\1\307\2\113\1\307\2\113"+
- "\1\0\4\113\1\0\1\307\1\113\1\0\1\113\1\0"+
- "\1\307\2\113\6\0\1\310\1\221\1\222\1\221\1\311"+
- "\1\221\1\310\10\221\1\312\16\221\1\310\2\221\1\310"+
- "\2\221\1\310\10\221\1\310\4\221\1\310\7\221\1\0"+
- "\1\313\1\224\1\225\3\224\1\313\1\224\1\314\6\224"+
- "\1\315\16\224\1\313\2\224\1\313\2\224\1\313\10\224"+
- "\1\313\4\224\1\313\7\224\1\0\1\226\1\210\1\211"+
- "\3\0\1\210\1\212\11\0\3\210\1\0\1\210\10\0"+
- "\11\210\1\0\4\210\1\0\2\210\1\0\1\210\1\0"+
- "\3\210\4\0\1\214\1\0\1\316\2\227\1\0\2\227"+
- "\1\316\2\227\1\0\4\227\2\0\16\227\1\316\2\227"+
- "\1\316\2\227\1\316\10\227\1\316\4\227\1\316\7\227"+
- "\1\0\1\317\5\0\1\317\16\0\2\317\7\0\2\317"+
- "\1\0\2\317\1\0\2\317\7\0\2\317\3\0\2\317"+
- "\7\0\2\113\1\215\3\0\2\113\3\0\1\216\5\0"+
- "\2\113\1\320\1\217\1\113\10\0\11\113\1\0\4\113"+
- "\1\0\2\113\1\0\1\113\1\0\3\113\57\0\1\321"+
- "\21\0\1\322\1\25\1\131\1\25\1\0\1\25\1\322"+
- "\1\25\1\0\1\25\4\0\2\25\1\0\3\25\1\0"+
- "\1\25\10\0\1\322\2\25\1\322\2\25\1\322\2\25"+
- "\1\0\4\25\1\0\1\322\1\25\1\0\1\25\1\0"+
- "\1\322\2\25\6\0\1\323\1\134\1\135\1\134\1\0"+
- "\1\134\1\323\1\134\1\0\1\134\4\0\2\134\1\0"+
- "\3\134\1\0\1\134\10\0\1\323\2\134\1\323\2\134"+
- "\1\323\2\134\1\0\4\134\1\0\1\323\1\134\1\0"+
- "\1\134\1\0\1\323\2\134\6\0\1\324\1\136\1\137"+
- "\1\136\1\0\1\136\1\324\1\136\1\0\1\136\4\0"+
- "\2\136\1\0\3\136\1\0\1\136\10\0\1\324\2\136"+
- "\1\324\2\136\1\324\2\136\1\0\4\136\1\0\1\324"+
- "\1\136\1\0\1\136\1\0\1\324\2\136\15\0\1\325"+
- "\62\0\34\141\1\326\1\243\35\141\42\0\2\327\102\0"+
- "\1\330\75\0\2\331\74\0\1\332\76\0\1\333\7\0"+
- "\1\334\1\335\1\251\1\0\1\251\1\334\1\336\1\0"+
- "\1\251\4\0\2\251\1\0\3\334\1\0\1\334\10\0"+
- "\11\334\1\0\4\334\1\0\2\334\1\0\1\334\1\0"+
- "\3\334\6\0\1\337\1\147\1\150\1\147\1\0\1\147"+
- "\1\337\1\147\1\0\1\147\4\0\2\147\1\0\3\147"+
- "\1\251\1\147\10\0\1\337\2\147\1\337\2\147\1\337"+
- "\2\147\1\0\4\147\1\0\1\337\1\147\1\0\1\147"+
- "\1\0\1\337\2\147\6\0\1\340\1\152\1\153\1\152"+
- "\1\154\1\152\1\340\27\152\1\340\2\152\1\340\2\152"+
- "\1\340\10\152\1\340\4\152\1\340\7\152\1\0\2\152"+
- "\1\153\1\0\1\154\12\152\1\0\52\152\1\0\1\341"+
- "\1\155\1\156\3\155\1\341\1\155\1\154\25\155\1\341"+
- "\2\155\1\341\2\155\1\341\10\155\1\341\4\155\1\341"+
- "\7\155\1\0\2\155\1\156\1\0\4\155\1\154\6\155"+
- "\1\0\52\155\1\0\1\342\1\157\1\160\1\157\1\161"+
- "\1\157\1\342\27\157\1\342\2\157\1\342\2\157\1\342"+
- "\10\157\1\342\4\157\1\342\7\157\1\0\2\157\1\160"+
- "\1\0\1\161\12\157\1\0\52\157\1\0\1\343\1\162"+
- "\1\163\3\162\1\343\1\162\1\161\25\162\1\343\2\162"+
- "\1\343\2\162\1\343\10\162\1\343\4\162\1\343\7\162"+
- "\1\0\2\162\1\163\1\0\4\162\1\161\6\162\1\0"+
- "\52\162\25\0\1\344\46\0\1\345\1\51\1\165\1\51"+
- "\1\0\1\51\1\345\1\51\1\0\1\51\4\0\2\51"+
- "\1\0\3\51\1\0\1\51\10\0\1\345\2\51\1\345"+
- "\2\51\1\345\2\51\1\0\4\51\1\0\1\345\1\51"+
- "\1\0\1\51\1\0\1\345\2\51\6\0\1\346\1\55"+
- "\1\167\1\55\1\0\1\55\1\346\1\55\1\0\1\55"+
- "\4\0\2\55\1\0\3\55\1\0\1\55\10\0\1\346"+
- "\2\55\1\346\2\55\1\346\2\55\1\0\4\55\1\0"+
- "\1\346\1\55\1\0\1\55\1\0\1\346\2\55\6\0"+
- "\1\347\1\62\1\171\1\62\1\0\1\62\1\347\1\62"+
- "\1\0\1\62\4\0\2\62\1\0\3\62\1\0\1\62"+
- "\10\0\1\347\2\62\1\347\2\62\1\347\2\62\1\0"+
- "\4\62\1\0\1\347\1\62\1\0\1\62\1\0\1\347"+
- "\2\62\6\0\1\350\1\72\1\175\1\72\1\0\1\72"+
- "\1\350\1\72\1\0\1\72\4\0\2\72\1\0\3\72"+
- "\1\0\1\72\10\0\1\350\2\72\1\350\2\72\1\350"+
- "\2\72\1\0\4\72\1\0\1\350\1\72\1\0\1\72"+
- "\1\0\1\350\2\72\6\0\1\351\1\100\1\177\1\100"+
- "\1\0\1\100\1\351\1\100\1\0\1\100\4\0\2\100"+
- "\1\0\3\100\1\0\1\100\10\0\1\351\2\100\1\351"+
- "\2\100\1\351\2\100\1\0\4\100\1\0\1\351\1\100"+
- "\1\0\1\100\1\0\1\351\2\100\6\0\1\352\1\201"+
- "\1\202\1\201\1\203\1\201\1\352\27\201\1\352\2\201"+
- "\1\352\2\201\1\352\10\201\1\352\4\201\1\352\7\201"+
- "\1\0\2\201\1\202\1\0\1\203\12\201\1\0\52\201"+
- "\1\0\1\353\1\204\1\205\3\204\1\353\1\204\1\203"+
- "\25\204\1\353\2\204\1\353\2\204\1\353\10\204\1\353"+
- "\4\204\1\353\7\204\1\0\2\204\1\205\1\0\4\204"+
- "\1\203\6\204\1\0\52\204\1\0\1\354\1\105\1\206"+
- "\1\105\1\0\1\105\1\354\1\105\1\0\1\105\4\0"+
- "\2\105\1\0\3\105\1\0\1\105\10\0\1\354\2\105"+
- "\1\354\2\105\1\354\2\105\1\0\4\105\1\0\1\354"+
- "\1\105\1\0\1\105\1\0\1\354\2\105\6\0\1\355"+
- "\1\210\1\211\1\210\1\0\1\210\1\355\1\210\1\0"+
- "\1\210\4\0\2\210\1\0\3\210\1\0\1\210\10\0"+
- "\1\355\2\210\1\355\2\210\1\355\2\210\1\0\4\210"+
- "\1\0\1\355\1\210\1\0\1\210\1\0\1\355\2\210"+
- "\6\0\2\305\1\306\3\0\2\305\3\0\1\216\5\0"+
- "\3\305\1\0\1\305\10\0\11\305\1\0\4\305\1\0"+
- "\2\305\1\0\1\305\1\0\3\305\6\0\1\356\2\305"+
- "\1\0\2\305\1\356\2\305\1\0\4\305\2\0\16\305"+
- "\1\356\2\305\1\356\2\305\1\356\10\305\1\356\4\305"+
- "\1\356\7\305\1\0\1\357\1\113\1\215\1\113\1\0"+
- "\1\113\1\357\1\113\1\0\1\113\1\0\1\216\2\0"+
- "\2\113\1\0\3\113\1\217\1\113\10\0\1\357\2\113"+
- "\1\357\2\113\1\357\2\113\1\0\4\113\1\0\1\357"+
- "\1\113\1\0\1\113\1\0\1\357\2\113\6\0\1\360"+
- "\1\221\1\222\1\221\1\223\1\221\1\360\27\221\1\360"+
- "\2\221\1\360\2\221\1\360\10\221\1\360\4\221\1\360"+
- "\7\221\1\0\2\221\1\222\1\0\1\223\12\221\1\0"+
- "\52\221\1\0\1\361\1\224\1\225\3\224\1\361\1\224"+
- "\1\223\25\224\1\361\2\224\1\361\2\224\1\361\10\224"+
- "\1\361\4\224\1\361\7\224\1\0\2\224\1\225\1\0"+
- "\4\224\1\223\6\224\1\0\52\224\1\0\1\362\1\227"+
- "\1\230\1\227\1\0\1\227\1\362\1\227\1\0\1\227"+
- "\4\0\2\227\1\0\3\227\1\0\1\227\10\0\1\362"+
- "\2\227\1\362\2\227\1\362\2\227\1\0\4\227\1\0"+
- "\1\362\1\227\1\0\1\227\1\0\1\362\2\227\6\0"+
- "\1\363\5\0\1\363\1\364\15\0\2\363\7\0\2\363"+
- "\1\0\2\363\1\0\2\363\7\0\2\363\3\0\2\363"+
- "\7\0\2\113\1\215\3\0\2\113\3\0\1\216\5\0"+
- "\3\113\1\365\1\113\10\0\11\113\1\0\4\113\1\0"+
- "\2\113\1\0\1\113\1\0\3\113\60\0\1\366\20\0"+
- "\1\367\1\25\1\131\1\25\1\0\1\25\1\367\1\25"+
- "\1\0\1\25\4\0\2\25\1\0\3\25\1\0\1\25"+
- "\10\0\1\367\2\25\1\367\2\25\1\367\2\25\1\0"+
- "\4\25\1\0\1\367\1\25\1\0\1\25\1\0\1\367"+
- "\2\25\6\0\1\370\1\134\1\135\1\134\1\0\1\134"+
- "\1\370\1\134\1\0\1\134\4\0\2\134\1\0\3\134"+
- "\1\0\1\134\10\0\1\370\2\134\1\370\2\134\1\370"+
- "\2\134\1\0\4\134\1\0\1\370\1\134\1\0\1\134"+
- "\1\0\1\370\2\134\6\0\1\371\1\136\1\137\1\136"+
- "\1\0\1\136\1\371\1\136\1\0\1\136\4\0\2\136"+
- "\1\0\3\136\1\0\1\136\10\0\1\371\2\136\1\371"+
- "\2\136\1\371\2\136\1\0\4\136\1\0\1\371\1\136"+
- "\1\0\1\136\1\0\1\371\2\136\30\0\1\372\123\0"+
- "\1\373\67\0\1\374\66\0\2\375\73\0\1\376\24\0"+
- "\2\334\1\335\1\377\1\0\1\377\2\334\1\0\1\377"+
- "\1\u0100\3\0\2\377\1\0\3\334\1\0\1\334\10\0"+
- "\11\334\1\0\4\334\1\0\2\334\1\0\1\334\1\0"+
- "\3\334\6\0\1\u0101\2\334\1\0\2\334\1\u0101\2\334"+
- "\1\0\4\334\2\0\16\334\1\u0101\2\334\1\u0101\2\334"+
- "\1\u0101\10\334\1\u0101\4\334\1\u0101\7\334\2\0\1\334"+
- "\1\335\3\0\1\334\12\0\3\334\1\0\1\334\10\0"+
- "\11\334\1\0\4\334\1\0\2\334\1\0\1\334\1\0"+
- "\3\334\6\0\1\u0102\1\147\1\150\1\147\1\0\1\147"+
- "\1\u0102\1\147\1\0\1\147\4\0\2\147\1\0\3\147"+
- "\1\251\1\147\10\0\1\u0102\2\147\1\u0102\2\147\1\u0102"+
- "\2\147\1\0\4\147\1\0\1\u0102\1\147\1\0\1\147"+
- "\1\0\1\u0102\2\147\6\0\1\u0103\1\152\1\153\1\152"+
- "\1\154\1\152\1\u0103\27\152\1\u0103\2\152\1\u0103\2\152"+
- "\1\u0103\10\152\1\u0103\4\152\1\u0103\7\152\1\0\1\u0104"+
- "\1\155\1\156\3\155\1\u0104\1\155\1\154\25\155\1\u0104"+
- "\2\155\1\u0104\2\155\1\u0104\10\155\1\u0104\4\155\1\u0104"+
- "\7\155\1\0\1\u0105\1\157\1\160\1\157\1\161\1\157"+
- "\1\u0105\27\157\1\u0105\2\157\1\u0105\2\157\1\u0105\10\157"+
- "\1\u0105\4\157\1\u0105\7\157\1\0\1\u0106\1\162\1\163"+
- "\3\162\1\u0106\1\162\1\161\25\162\1\u0106\2\162\1\u0106"+
- "\2\162\1\u0106\10\162\1\u0106\4\162\1\u0106\7\162\1\0"+
- "\2\u0107\1\u0108\1\344\1\u0109\1\344\2\u0107\1\u010a\1\344"+
- "\1\u010b\3\u0107\2\344\4\u0107\1\0\45\u0107\1\0\1\u010c"+
- "\1\51\1\165\1\51\1\0\1\51\1\u010c\1\51\1\0"+
- "\1\51\4\0\2\51\1\0\3\51\1\0\1\51\10\0"+
- "\1\u010c\2\51\1\u010c\2\51\1\u010c\2\51\1\0\4\51"+
- "\1\0\1\u010c\1\51\1\0\1\51\1\0\1\u010c\2\51"+
- "\6\0\1\u010d\1\55\1\167\1\55\1\0\1\55\1\u010d"+
- "\1\55\1\0\1\55\4\0\2\55\1\0\3\55\1\0"+
- "\1\55\10\0\1\u010d\2\55\1\u010d\2\55\1\u010d\2\55"+
- "\1\0\4\55\1\0\1\u010d\1\55\1\0\1\55\1\0"+
- "\1\u010d\2\55\6\0\1\u010e\1\62\1\171\1\62\1\0"+
- "\1\62\1\u010e\1\62\1\0\1\62\4\0\2\62\1\0"+
- "\3\62\1\0\1\62\10\0\1\u010e\2\62\1\u010e\2\62"+
- "\1\u010e\2\62\1\0\4\62\1\0\1\u010e\1\62\1\0"+
- "\1\62\1\0\1\u010e\2\62\6\0\1\u010f\1\72\1\175"+
- "\1\72\1\0\1\72\1\u010f\1\72\1\0\1\72\4\0"+
- "\2\72\1\0\3\72\1\0\1\72\10\0\1\u010f\2\72"+
- "\1\u010f\2\72\1\u010f\2\72\1\0\4\72\1\0\1\u010f"+
- "\1\72\1\0\1\72\1\0\1\u010f\2\72\6\0\1\u0110"+
- "\1\100\1\177\1\100\1\0\1\100\1\u0110\1\100\1\0"+
- "\1\100\4\0\2\100\1\0\3\100\1\0\1\100\10\0"+
- "\1\u0110\2\100\1\u0110\2\100\1\u0110\2\100\1\0\4\100"+
- "\1\0\1\u0110\1\100\1\0\1\100\1\0\1\u0110\2\100"+
- "\6\0\1\u0111\1\201\1\202\1\201\1\203\1\201\1\u0111"+
- "\27\201\1\u0111\2\201\1\u0111\2\201\1\u0111\10\201\1\u0111"+
- "\4\201\1\u0111\7\201\1\0\1\u0112\1\204\1\205\3\204"+
- "\1\u0112\1\204\1\203\25\204\1\u0112\2\204\1\u0112\2\204"+
- "\1\u0112\10\204\1\u0112\4\204\1\u0112\7\204\1\0\1\u0113"+
- "\1\105\1\206\1\105\1\0\1\105\1\u0113\1\105\1\0"+
- "\1\105\4\0\2\105\1\0\3\105\1\0\1\105\10\0"+
- "\1\u0113\2\105\1\u0113\2\105\1\u0113\2\105\1\0\4\105"+
- "\1\0\1\u0113\1\105\1\0\1\105\1\0\1\u0113\2\105"+
- "\6\0\1\u0114\1\210\1\211\1\210\1\0\1\210\1\u0114"+
- "\1\210\1\0\1\210\4\0\2\210\1\0\3\210\1\0"+
- "\1\210\10\0\1\u0114\2\210\1\u0114\2\210\1\u0114\2\210"+
- "\1\0\4\210\1\0\1\u0114\1\210\1\0\1\210\1\0"+
- "\1\u0114\2\210\6\0\1\u0115\1\305\1\306\1\305\1\0"+
- "\1\305\1\u0115\1\305\1\0\1\305\1\0\1\216\2\0"+
- "\2\305\1\0\3\305\1\0\1\305\10\0\1\u0115\2\305"+
- "\1\u0115\2\305\1\u0115\2\305\1\0\4\305\1\0\1\u0115"+
- "\1\305\1\0\1\305\1\0\1\u0115\2\305\6\0\1\u0116"+
- "\1\113\1\215\1\113\1\0\1\113\1\u0116\1\113\1\0"+
- "\1\113\1\0\1\216\2\0\2\113\1\0\3\113\1\217"+
- "\1\113\10\0\1\u0116\2\113\1\u0116\2\113\1\u0116\2\113"+
- "\1\0\4\113\1\0\1\u0116\1\113\1\0\1\113\1\0"+
- "\1\u0116\2\113\6\0\1\u0117\1\221\1\222\1\221\1\223"+
- "\1\221\1\u0117\27\221\1\u0117\2\221\1\u0117\2\221\1\u0117"+
- "\10\221\1\u0117\4\221\1\u0117\7\221\1\0\1\u0118\1\224"+
- "\1\225\3\224\1\u0118\1\224\1\223\25\224\1\u0118\2\224"+
- "\1\u0118\2\224\1\u0118\10\224\1\u0118\4\224\1\u0118\7\224"+
- "\1\0\1\u0119\1\227\1\230\1\227\1\0\1\227\1\u0119"+
- "\1\227\1\0\1\227\4\0\2\227\1\0\3\227\1\0"+
- "\1\227\10\0\1\u0119\2\227\1\u0119\2\227\1\u0119\2\227"+
- "\1\0\4\227\1\0\1\u0119\1\227\1\0\1\227\1\0"+
- "\1\u0119\2\227\6\0\1\u011a\5\0\1\u011a\1\364\15\0"+
- "\2\u011a\7\0\2\u011a\1\0\2\u011a\1\0\2\u011a\7\0"+
- "\2\u011a\3\0\2\u011a\7\0\1\u011b\5\0\1\u011b\16\0"+
- "\2\u011b\7\0\2\u011b\1\0\2\u011b\1\0\2\u011b\7\0"+
- "\2\u011b\3\0\2\u011b\7\0\2\u011c\1\u011d\1\u011e\1\u011f"+
- "\1\u011e\2\u011c\1\u0120\1\u011e\1\u0121\3\u011c\2\u011e\4\u011c"+
- "\1\0\45\u011c\54\0\1\u0122\17\0\1\u0123\1\25\1\131"+
- "\1\25\1\0\1\25\1\u0123\1\25\1\0\1\25\4\0"+
- "\2\25\1\0\3\25\1\0\1\25\10\0\1\u0123\2\25"+
- "\1\u0123\2\25\1\u0123\2\25\1\0\4\25\1\0\1\u0123"+
- "\1\25\1\0\1\25\1\0\1\u0123\2\25\6\0\1\u0124"+
- "\1\134\1\135\1\134\1\0\1\134\1\u0124\1\134\1\0"+
- "\1\134\4\0\2\134\1\0\3\134\1\0\1\134\10\0"+
- "\1\u0124\2\134\1\u0124\2\134\1\u0124\2\134\1\0\4\134"+
- "\1\0\1\u0124\1\134\1\0\1\134\1\0\1\u0124\2\134"+
- "\6\0\1\u0125\1\136\1\137\1\136\1\0\1\136\1\u0125"+
- "\1\136\1\0\1\136\4\0\2\136\1\0\3\136\1\0"+
- "\1\136\10\0\1\u0125\2\136\1\u0125\2\136\1\u0125\2\136"+
- "\1\0\4\136\1\0\1\u0125\1\136\1\0\1\136\1\0"+
- "\1\u0125\2\136\51\0\1\u0126\51\0\1\u0127\111\0\2\u0128"+
- "\37\0\1\u0129\66\0\1\377\1\0\1\377\3\0\1\377"+
- "\1\u0100\3\0\2\377\53\0\1\u012a\1\334\1\335\1\334"+
- "\1\0\1\334\1\u012a\1\334\1\0\1\334\1\u0100\3\0"+
- "\2\334\1\0\3\334\1\0\1\334\10\0\1\u012a\2\334"+
- "\1\u012a\2\334\1\u012a\2\334\1\0\4\334\1\0\1\u012a"+
- "\1\334\1\0\1\334\1\0\1\u012a\2\334\6\0\1\u012b"+
- "\1\147\1\150\1\147\1\0\1\147\1\u012b\1\147\1\0"+
- "\1\147\4\0\2\147\1\0\3\147\1\251\1\147\10\0"+
- "\1\u012b\2\147\1\u012b\2\147\1\u012b\2\147\1\0\4\147"+
- "\1\0\1\u012b\1\147\1\0\1\147\1\0\1\u012b\2\147"+
- "\6\0\1\u012c\1\152\1\153\1\152\1\154\1\152\1\u012c"+
- "\27\152\1\u012c\2\152\1\u012c\2\152\1\u012c\10\152\1\u012c"+
- "\4\152\1\u012c\7\152\1\0\1\u012d\1\155\1\156\3\155"+
- "\1\u012d\1\155\1\154\25\155\1\u012d\2\155\1\u012d\2\155"+
- "\1\u012d\10\155\1\u012d\4\155\1\u012d\7\155\1\0\1\u012e"+
- "\1\157\1\160\1\157\1\161\1\157\1\u012e\27\157\1\u012e"+
- "\2\157\1\u012e\2\157\1\u012e\10\157\1\u012e\4\157\1\u012e"+
- "\7\157\1\0\1\u012f\1\162\1\163\3\162\1\u012f\1\162"+
- "\1\161\25\162\1\u012f\2\162\1\u012f\2\162\1\u012f\10\162"+
- "\1\u012f\4\162\1\u012f\7\162\1\0\2\u0107\1\u0108\1\u0130"+
- "\1\0\3\u0107\1\0\1\u0130\1\u010b\3\u0107\2\u0130\4\u0107"+
- "\1\0\45\u0107\1\0\1\u0131\1\u0107\1\u0108\1\u0130\2\u0107"+
- "\1\u0131\2\u0107\1\u0130\1\u0132\3\u0107\2\u0130\16\u0107\1\u0131"+
- "\2\u0107\1\u0131\2\u0107\1\u0131\10\u0107\1\u0131\4\u0107\1\u0131"+
- "\7\u0107\1\0\2\u0109\1\u0133\1\0\1\u0130\11\u0109\2\0"+
- "\52\u0109\1\0\2\u010a\1\u0134\1\0\4\u010a\1\u0130\5\u010a"+
- "\2\0\52\u010a\1\0\1\u0135\1\51\1\165\1\51\1\0"+
- "\1\51\1\u0135\1\51\1\0\1\51\4\0\2\51\1\0"+
- "\3\51\1\0\1\51\10\0\1\u0135\2\51\1\u0135\2\51"+
- "\1\u0135\2\51\1\0\4\51\1\0\1\u0135\1\51\1\0"+
- "\1\51\1\0\1\u0135\2\51\6\0\1\u0136\1\55\1\167"+
- "\1\55\1\0\1\55\1\u0136\1\55\1\0\1\55\4\0"+
- "\2\55\1\0\3\55\1\0\1\55\10\0\1\u0136\2\55"+
- "\1\u0136\2\55\1\u0136\2\55\1\0\4\55\1\0\1\u0136"+
- "\1\55\1\0\1\55\1\0\1\u0136\2\55\6\0\1\u0137"+
- "\1\62\1\171\1\62\1\0\1\62\1\u0137\1\62\1\0"+
- "\1\62\4\0\2\62\1\0\3\62\1\0\1\62\10\0"+
- "\1\u0137\2\62\1\u0137\2\62\1\u0137\2\62\1\0\4\62"+
- "\1\0\1\u0137\1\62\1\0\1\62\1\0\1\u0137\2\62"+
- "\6\0\1\u0138\1\72\1\175\1\72\1\0\1\72\1\u0138"+
- "\1\72\1\0\1\72\4\0\2\72\1\0\3\72\1\0"+
- "\1\72\10\0\1\u0138\2\72\1\u0138\2\72\1\u0138\2\72"+
- "\1\0\4\72\1\0\1\u0138\1\72\1\0\1\72\1\0"+
- "\1\u0138\2\72\6\0\1\u0139\1\100\1\177\1\100\1\0"+
- "\1\100\1\u0139\1\100\1\0\1\100\4\0\2\100\1\0"+
- "\3\100\1\0\1\100\10\0\1\u0139\2\100\1\u0139\2\100"+
- "\1\u0139\2\100\1\0\4\100\1\0\1\u0139\1\100\1\0"+
- "\1\100\1\0\1\u0139\2\100\6\0\1\u013a\1\201\1\202"+
- "\1\201\1\203\1\201\1\u013a\27\201\1\u013a\2\201\1\u013a"+
- "\2\201\1\u013a\10\201\1\u013a\4\201\1\u013a\7\201\1\0"+
- "\1\u013b\1\204\1\205\3\204\1\u013b\1\204\1\203\25\204"+
- "\1\u013b\2\204\1\u013b\2\204\1\u013b\10\204\1\u013b\4\204"+
- "\1\u013b\7\204\1\0\1\u013c\1\105\1\206\1\105\1\0"+
- "\1\105\1\u013c\1\105\1\0\1\105\4\0\2\105\1\0"+
- "\3\105\1\0\1\105\10\0\1\u013c\2\105\1\u013c\2\105"+
- "\1\u013c\2\105\1\0\4\105\1\0\1\u013c\1\105\1\0"+
- "\1\105\1\0\1\u013c\2\105\6\0\1\u013d\1\210\1\211"+
- "\1\210\1\0\1\210\1\u013d\1\210\1\0\1\210\4\0"+
- "\2\210\1\0\3\210\1\0\1\210\10\0\1\u013d\2\210"+
- "\1\u013d\2\210\1\u013d\2\210\1\0\4\210\1\0\1\u013d"+
- "\1\210\1\0\1\210\1\0\1\u013d\2\210\6\0\1\u013e"+
- "\1\305\1\306\1\305\1\0\1\305\1\u013e\1\305\1\0"+
- "\1\305\1\0\1\216\2\0\2\305\1\0\3\305\1\0"+
- "\1\305\10\0\1\u013e\2\305\1\u013e\2\305\1\u013e\2\305"+
- "\1\0\4\305\1\0\1\u013e\1\305\1\0\1\305\1\0"+
- "\1\u013e\2\305\6\0\1\u013f\1\113\1\215\1\113\1\0"+
- "\1\113\1\u013f\1\113\1\0\1\113\1\0\1\216\2\0"+
- "\2\113\1\0\3\113\1\217\1\113\10\0\1\u013f\2\113"+
- "\1\u013f\2\113\1\u013f\2\113\1\0\4\113\1\0\1\u013f"+
- "\1\113\1\0\1\113\1\0\1\u013f\2\113\6\0\1\u0140"+
- "\1\221\1\222\1\221\1\223\1\221\1\u0140\27\221\1\u0140"+
- "\2\221\1\u0140\2\221\1\u0140\10\221\1\u0140\4\221\1\u0140"+
- "\7\221\1\0\1\u0141\1\224\1\225\3\224\1\u0141\1\224"+
- "\1\223\25\224\1\u0141\2\224\1\u0141\2\224\1\u0141\10\224"+
- "\1\u0141\4\224\1\u0141\7\224\1\0\1\u0142\1\227\1\230"+
- "\1\227\1\0\1\227\1\u0142\1\227\1\0\1\227\4\0"+
- "\2\227\1\0\3\227\1\0\1\227\10\0\1\u0142\2\227"+
- "\1\u0142\2\227\1\u0142\2\227\1\0\4\227\1\0\1\u0142"+
- "\1\227\1\0\1\227\1\0\1\u0142\2\227\6\0\1\u0143"+
- "\5\0\1\u0143\1\364\15\0\2\u0143\7\0\2\u0143\1\0"+
- "\2\u0143\1\0\2\u0143\7\0\2\u0143\3\0\2\u0143\7\0"+
- "\1\u0144\5\0\1\u0144\16\0\2\u0144\7\0\2\u0144\1\0"+
- "\2\u0144\1\0\2\u0144\7\0\2\u0144\3\0\2\u0144\7\0"+
- "\2\u011c\1\u011d\1\u0145\1\0\3\u011c\1\0\1\u0145\1\u0121"+
- "\3\u011c\2\u0145\4\u011c\1\0\45\u011c\1\0\1\u0146\1\u011c"+
- "\1\u011d\1\u0145\2\u011c\1\u0146\2\u011c\1\u0145\1\u0147\3\u011c"+
- "\2\u0145\16\u011c\1\u0146\2\u011c\1\u0146\2\u011c\1\u0146\10\u011c"+
- "\1\u0146\4\u011c\1\u0146\7\u011c\1\0\2\u011f\1\u0148\1\0"+
- "\1\u0145\11\u011f\2\0\52\u011f\1\0\2\u0120\1\u0149\1\0"+
- "\4\u0120\1\u0145\5\u0120\2\0\52\u0120\23\0\1\u014a\50\0"+
- "\1\u014b\1\25\1\131\1\25\1\0\1\25\1\u014b\1\25"+
- "\1\0\1\25\4\0\2\25\1\0\3\25\1\0\1\25"+
- "\10\0\1\u014b\2\25\1\u014b\2\25\1\u014b\2\25\1\0"+
- "\4\25\1\0\1\u014b\1\25\1\0\1\25\1\0\1\u014b"+
- "\2\25\6\0\1\u014c\1\134\1\135\1\134\1\0\1\134"+
- "\1\u014c\1\134\1\0\1\134\4\0\2\134\1\0\3\134"+
- "\1\0\1\134\10\0\1\u014c\2\134\1\u014c\2\134\1\u014c"+
- "\2\134\1\0\4\134\1\0\1\u014c\1\134\1\0\1\134"+
- "\1\0\1\u014c\2\134\6\0\1\u014d\1\136\1\137\1\136"+
- "\1\0\1\136\1\u014d\1\136\1\0\1\136\4\0\2\136"+
- "\1\0\3\136\1\0\1\136\10\0\1\u014d\2\136\1\u014d"+
- "\2\136\1\u014d\2\136\1\0\4\136\1\0\1\u014d\1\136"+
- "\1\0\1\136\1\0\1\u014d\2\136\52\0\2\u014e\73\0"+
- "\1\u014f\106\0\2\u0150\7\0\1\u0151\1\334\1\335\1\334"+
- "\1\0\1\334\1\u0151\1\334\1\0\1\334\1\u0100\3\0"+
- "\2\334\1\0\3\334\1\0\1\334\10\0\1\u0151\2\334"+
- "\1\u0151\2\334\1\u0151\2\334\1\0\4\334\1\0\1\u0151"+
- "\1\334\1\0\1\334\1\0\1\u0151\2\334\6\0\1\u0152"+
- "\1\147\1\150\1\147\1\0\1\147\1\u0152\1\147\1\0"+
- "\1\147\4\0\2\147\1\0\3\147\1\251\1\147\10\0"+
- "\1\u0152\2\147\1\u0152\2\147\1\u0152\2\147\1\0\4\147"+
- "\1\0\1\u0152\1\147\1\0\1\147\1\0\1\u0152\2\147"+
- "\6\0\1\u0153\1\152\1\153\1\152\1\154\1\152\1\u0153"+
- "\27\152\1\u0153\2\152\1\u0153\2\152\1\u0153\10\152\1\u0153"+
- "\4\152\1\u0153\7\152\1\0\1\u0154\1\155\1\156\3\155"+
- "\1\u0154\1\155\1\154\25\155\1\u0154\2\155\1\u0154\2\155"+
- "\1\u0154\10\155\1\u0154\4\155\1\u0154\7\155\1\0\1\u0155"+
- "\1\157\1\160\1\157\1\161\1\157\1\u0155\27\157\1\u0155"+
- "\2\157\1\u0155\2\157\1\u0155\10\157\1\u0155\4\157\1\u0155"+
- "\7\157\1\0\1\u0156\1\162\1\163\3\162\1\u0156\1\162"+
- "\1\161\25\162\1\u0156\2\162\1\u0156\2\162\1\u0156\10\162"+
- "\1\u0156\4\162\1\u0156\7\162\4\0\1\u0130\1\0\1\u0130"+
- "\3\0\1\u0130\1\u010b\3\0\2\u0130\53\0\1\u0157\1\u0107"+
- "\1\u0108\1\u0107\1\0\1\u0107\1\u0157\1\u0107\1\0\1\u0107"+
- "\1\u010b\11\u0107\1\0\11\u0107\1\u0157\2\u0107\1\u0157\2\u0107"+
- "\1\u0157\10\u0107\1\u0157\4\u0107\1\u0157\7\u0107\1\0\1\u0158"+
- "\1\u0109\1\u0133\1\u0109\1\u0159\1\u0109\1\u0158\10\u0109\1\u015a"+
- "\16\u0109\1\u0158\2\u0109\1\u0158\2\u0109\1\u0158\10\u0109\1\u0158"+
- "\4\u0109\1\u0158\7\u0109\1\0\1\u015b\1\u010a\1\u0134\3\u010a"+
- "\1\u015b\1\u010a\1\u015c\6\u010a\1\u015d\16\u010a\1\u015b\2\u010a"+
- "\1\u015b\2\u010a\1\u015b\10\u010a\1\u015b\4\u010a\1\u015b\7\u010a"+
- "\1\0\1\u015e\1\51\1\165\1\51\1\0\1\51\1\u015e"+
- "\1\51\1\0\1\51\4\0\2\51\1\0\3\51\1\0"+
- "\1\51\10\0\1\u015e\2\51\1\u015e\2\51\1\u015e\2\51"+
- "\1\0\4\51\1\0\1\u015e\1\51\1\0\1\51\1\0"+
- "\1\u015e\2\51\6\0\1\u015f\1\55\1\167\1\55\1\0"+
- "\1\55\1\u015f\1\55\1\0\1\55\4\0\2\55\1\0"+
- "\3\55\1\0\1\55\10\0\1\u015f\2\55\1\u015f\2\55"+
- "\1\u015f\2\55\1\0\4\55\1\0\1\u015f\1\55\1\0"+
- "\1\55\1\0\1\u015f\2\55\6\0\1\u0160\1\62\1\171"+
- "\1\62\1\0\1\62\1\u0160\1\62\1\0\1\62\4\0"+
- "\2\62\1\0\3\62\1\0\1\62\10\0\1\u0160\2\62"+
- "\1\u0160\2\62\1\u0160\2\62\1\0\4\62\1\0\1\u0160"+
- "\1\62\1\0\1\62\1\0\1\u0160\2\62\6\0\1\u0161"+
- "\1\72\1\175\1\72\1\0\1\72\1\u0161\1\72\1\0"+
- "\1\72\4\0\2\72\1\0\3\72\1\0\1\72\10\0"+
- "\1\u0161\2\72\1\u0161\2\72\1\u0161\2\72\1\0\4\72"+
- "\1\0\1\u0161\1\72\1\0\1\72\1\0\1\u0161\2\72"+
- "\6\0\1\u0162\1\100\1\177\1\100\1\0\1\100\1\u0162"+
- "\1\100\1\0\1\100\4\0\2\100\1\0\3\100\1\0"+
- "\1\100\10\0\1\u0162\2\100\1\u0162\2\100\1\u0162\2\100"+
- "\1\0\4\100\1\0\1\u0162\1\100\1\0\1\100\1\0"+
- "\1\u0162\2\100\6\0\1\u0163\1\201\1\202\1\201\1\203"+
- "\1\201\1\u0163\27\201\1\u0163\2\201\1\u0163\2\201\1\u0163"+
- "\10\201\1\u0163\4\201\1\u0163\7\201\1\0\1\u0164\1\204"+
- "\1\205\3\204\1\u0164\1\204\1\203\25\204\1\u0164\2\204"+
- "\1\u0164\2\204\1\u0164\10\204\1\u0164\4\204\1\u0164\7\204"+
- "\1\0\1\u0165\1\105\1\206\1\105\1\0\1\105\1\u0165"+
- "\1\105\1\0\1\105\4\0\2\105\1\0\3\105\1\0"+
- "\1\105\10\0\1\u0165\2\105\1\u0165\2\105\1\u0165\2\105"+
- "\1\0\4\105\1\0\1\u0165\1\105\1\0\1\105\1\0"+
- "\1\u0165\2\105\6\0\1\u0166\1\210\1\211\1\210\1\0"+
- "\1\210\1\u0166\1\210\1\0\1\210\4\0\2\210\1\0"+
- "\3\210\1\0\1\210\10\0\1\u0166\2\210\1\u0166\2\210"+
- "\1\u0166\2\210\1\0\4\210\1\0\1\u0166\1\210\1\0"+
- "\1\210\1\0\1\u0166\2\210\6\0\1\u0167\1\305\1\306"+
- "\1\305\1\0\1\305\1\u0167\1\305\1\0\1\305\1\0"+
- "\1\216\2\0\2\305\1\0\3\305\1\0\1\305\10\0"+
- "\1\u0167\2\305\1\u0167\2\305\1\u0167\2\305\1\0\4\305"+
- "\1\0\1\u0167\1\305\1\0\1\305\1\0\1\u0167\2\305"+
- "\6\0\1\u0168\1\113\1\215\1\113\1\0\1\113\1\u0168"+
- "\1\113\1\0\1\113\1\0\1\216\2\0\2\113\1\0"+
- "\3\113\1\217\1\113\10\0\1\u0168\2\113\1\u0168\2\113"+
- "\1\u0168\2\113\1\0\4\113\1\0\1\u0168\1\113\1\0"+
- "\1\113\1\0\1\u0168\2\113\6\0\1\u0169\1\221\1\222"+
- "\1\221\1\223\1\221\1\u0169\27\221\1\u0169\2\221\1\u0169"+
- "\2\221\1\u0169\10\221\1\u0169\4\221\1\u0169\7\221\1\0"+
- "\1\u016a\1\224\1\225\3\224\1\u016a\1\224\1\223\25\224"+
- "\1\u016a\2\224\1\u016a\2\224\1\u016a\10\224\1\u016a\4\224"+
- "\1\u016a\7\224\1\0\1\u016b\1\227\1\230\1\227\1\0"+
- "\1\227\1\u016b\1\227\1\0\1\227\4\0\2\227\1\0"+
- "\3\227\1\0\1\227\10\0\1\u016b\2\227\1\u016b\2\227"+
- "\1\u016b\2\227\1\0\4\227\1\0\1\u016b\1\227\1\0"+
- "\1\227\1\0\1\u016b\2\227\6\0\1\u016c\5\0\1\u016c"+
- "\1\364\15\0\2\u016c\7\0\2\u016c\1\0\2\u016c\1\0"+
- "\2\u016c\7\0\2\u016c\3\0\2\u016c\7\0\1\u016d\5\0"+
- "\1\u016d\16\0\2\u016d\7\0\2\u016d\1\0\2\u016d\1\0"+
- "\2\u016d\7\0\2\u016d\3\0\2\u016d\12\0\1\u0145\1\0"+
- "\1\u0145\3\0\1\u0145\1\u0121\3\0\2\u0145\53\0\1\u016e"+
- "\1\u011c\1\u011d\1\u011c\1\0\1\u011c\1\u016e\1\u011c\1\0"+
- "\1\u011c\1\u0121\11\u011c\1\0\11\u011c\1\u016e\2\u011c\1\u016e"+
- "\2\u011c\1\u016e\10\u011c\1\u016e\4\u011c\1\u016e\7\u011c\1\0"+
- "\1\u016f\1\u011f\1\u0148\1\u011f\1\u0170\1\u011f\1\u016f\10\u011f"+
- "\1\u0171\16\u011f\1\u016f\2\u011f\1\u016f\2\u011f\1\u016f\10\u011f"+
- "\1\u016f\4\u011f\1\u016f\7\u011f\1\0\1\u0172\1\u0120\1\u0149"+
- "\3\u0120\1\u0172\1\u0120\1\u0173\6\u0120\1\u0174\16\u0120\1\u0172"+
- "\2\u0120\1\u0172\2\u0120\1\u0172\10\u0120\1\u0172\4\u0120\1\u0172"+
- "\7\u0120\47\0\1\u0175\24\0\2\25\1\131\1\25\1\0"+
- "\3\25\1\0\1\25\4\0\2\25\1\0\3\25\1\0"+
- "\1\25\10\0\11\25\1\0\4\25\1\0\2\25\1\0"+
- "\1\25\1\0\3\25\6\0\1\u0176\1\134\1\135\1\134"+
- "\1\0\1\134\1\u0176\1\134\1\0\1\134\4\0\2\134"+
- "\1\0\3\134\1\0\1\134\10\0\1\u0176\2\134\1\u0176"+
- "\2\134\1\u0176\2\134\1\0\4\134\1\0\1\u0176\1\134"+
- "\1\0\1\134\1\0\1\u0176\2\134\6\0\1\u0177\1\136"+
- "\1\137\1\136\1\0\1\136\1\u0177\1\136\1\0\1\136"+
- "\4\0\2\136\1\0\3\136\1\0\1\136\10\0\1\u0177"+
- "\2\136\1\u0177\2\136\1\u0177\2\136\1\0\4\136\1\0"+
- "\1\u0177\1\136\1\0\1\136\1\0\1\u0177\2\136\54\0"+
- "\1\u0178\65\0\2\u0179\30\0\1\u017a\1\334\1\335\1\334"+
- "\1\0\1\334\1\u017a\1\334\1\0\1\334\1\u0100\3\0"+
- "\2\334\1\0\3\334\1\0\1\334\10\0\1\u017a\2\334"+
- "\1\u017a\2\334\1\u017a\2\334\1\0\4\334\1\0\1\u017a"+
- "\1\334\1\0\1\334\1\0\1\u017a\2\334\6\0\1\u017b"+
- "\1\147\1\150\1\147\1\0\1\147\1\u017b\1\147\1\0"+
- "\1\147\4\0\2\147\1\0\3\147\1\251\1\147\10\0"+
- "\1\u017b\2\147\1\u017b\2\147\1\u017b\2\147\1\0\4\147"+
- "\1\0\1\u017b\1\147\1\0\1\147\1\0\1\u017b\2\147"+
- "\6\0\1\u017c\1\152\1\153\1\152\1\154\1\152\1\u017c"+
- "\27\152\1\u017c\2\152\1\u017c\2\152\1\u017c\10\152\1\u017c"+
- "\4\152\1\u017c\7\152\1\0\1\u017d\1\155\1\156\3\155"+
- "\1\u017d\1\155\1\154\25\155\1\u017d\2\155\1\u017d\2\155"+
- "\1\u017d\10\155\1\u017d\4\155\1\u017d\7\155\1\0\1\u017e"+
- "\1\157\1\160\1\157\1\161\1\157\1\u017e\27\157\1\u017e"+
- "\2\157\1\u017e\2\157\1\u017e\10\157\1\u017e\4\157\1\u017e"+
- "\7\157\1\0\1\u017f\1\162\1\163\3\162\1\u017f\1\162"+
- "\1\161\25\162\1\u017f\2\162\1\u017f\2\162\1\u017f\10\162"+
- "\1\u017f\4\162\1\u017f\7\162\1\0\1\u0180\1\u0107\1\u0108"+
- "\1\u0107\1\0\1\u0107\1\u0180\1\u0107\1\0\1\u0107\1\u010b"+
- "\11\u0107\1\0\11\u0107\1\u0180\2\u0107\1\u0180\2\u0107\1\u0180"+
- "\10\u0107\1\u0180\4\u0107\1\u0180\7\u0107\1\0\1\u0181\1\u0109"+
- "\1\u0133\1\u0109\1\u0130\1\u0109\1\u0181\27\u0109\1\u0181\2\u0109"+
- "\1\u0181\2\u0109\1\u0181\10\u0109\1\u0181\4\u0109\1\u0181\7\u0109"+
- "\1\0\2\u0109\1\u0133\2\u0130\1\u0159\3\u0109\1\u0159\1\u0182"+
- "\3\u0109\2\u0130\52\u0109\1\0\2\u0109\1\u0133\1\0\1\u0130"+
- "\12\u0109\1\0\52\u0109\1\0\1\u0183\1\u010a\1\u0134\3\u010a"+
- "\1\u0183\1\u010a\1\u0130\25\u010a\1\u0183\2\u010a\1\u0183\2\u010a"+
- "\1\u0183\10\u010a\1\u0183\4\u010a\1\u0183\7\u010a\1\0\2\u010a"+
- "\1\u0134\1\u0130\1\u010a\1\u015c\2\u010a\1\u0130\1\u015c\1\u0184"+
- "\3\u010a\2\u0130\52\u010a\1\0\2\u010a\1\u0134\1\0\4\u010a"+
- "\1\u0130\6\u010a\1\0\52\u010a\1\0\2\51\1\165\1\51"+
- "\1\0\3\51\1\0\1\51\4\0\2\51\1\0\3\51"+
- "\1\0\1\51\10\0\11\51\1\0\4\51\1\0\2\51"+
- "\1\0\1\51\1\0\3\51\6\0\2\55\1\167\1\55"+
- "\1\0\3\55\1\0\1\55\4\0\2\55\1\0\3\55"+
- "\1\0\1\55\10\0\11\55\1\0\4\55\1\0\2\55"+
- "\1\0\1\55\1\0\3\55\6\0\2\62\1\171\1\62"+
- "\1\0\3\62\1\0\1\62\4\0\2\62\1\0\3\62"+
- "\1\0\1\62\10\0\11\62\1\0\4\62\1\0\2\62"+
- "\1\0\1\62\1\0\3\62\6\0\2\72\1\175\1\72"+
- "\1\0\3\72\1\0\1\72\4\0\2\72\1\0\3\72"+
- "\1\0\1\72\10\0\11\72\1\0\4\72\1\0\2\72"+
- "\1\0\1\72\1\0\3\72\6\0\2\100\1\177\1\100"+
- "\1\0\3\100\1\0\1\100\4\0\2\100\1\0\3\100"+
- "\1\0\1\100\10\0\11\100\1\0\4\100\1\0\2\100"+
- "\1\0\1\100\1\0\3\100\6\0\1\u0185\1\201\1\202"+
- "\1\201\1\203\1\201\1\u0185\27\201\1\u0185\2\201\1\u0185"+
- "\2\201\1\u0185\10\201\1\u0185\4\201\1\u0185\7\201\1\0"+
- "\1\u0186\1\204\1\205\3\204\1\u0186\1\204\1\203\25\204"+
- "\1\u0186\2\204\1\u0186\2\204\1\u0186\10\204\1\u0186\4\204"+
- "\1\u0186\7\204\1\0\2\105\1\206\1\105\1\0\3\105"+
- "\1\0\1\105\4\0\2\105\1\0\3\105\1\0\1\105"+
- "\10\0\11\105\1\0\4\105\1\0\2\105\1\0\1\105"+
- "\1\0\3\105\6\0\1\u0187\1\210\1\211\1\210\1\0"+
- "\1\210\1\u0187\1\210\1\0\1\210\4\0\2\210\1\0"+
- "\3\210\1\0\1\210\10\0\1\u0187\2\210\1\u0187\2\210"+
- "\1\u0187\2\210\1\0\4\210\1\0\1\u0187\1\210\1\0"+
- "\1\210\1\0\1\u0187\2\210\6\0\1\u0188\1\305\1\306"+
- "\1\305\1\0\1\305\1\u0188\1\305\1\0\1\305\1\0"+
- "\1\216\2\0\2\305\1\0\3\305\1\0\1\305\10\0"+
- "\1\u0188\2\305\1\u0188\2\305\1\u0188\2\305\1\0\4\305"+
- "\1\0\1\u0188\1\305\1\0\1\305\1\0\1\u0188\2\305"+
- "\6\0\2\113\1\215\1\113\1\0\3\113\1\0\1\113"+
- "\1\0\1\216\2\0\2\113\1\0\3\113\1\217\1\113"+
- "\10\0\11\113\1\0\4\113\1\0\2\113\1\0\1\113"+
- "\1\0\3\113\6\0\1\u0189\1\221\1\222\1\221\1\223"+
- "\1\221\1\u0189\27\221\1\u0189\2\221\1\u0189\2\221\1\u0189"+
- "\10\221\1\u0189\4\221\1\u0189\7\221\1\0\1\u018a\1\224"+
- "\1\225\3\224\1\u018a\1\224\1\223\25\224\1\u018a\2\224"+
- "\1\u018a\2\224\1\u018a\10\224\1\u018a\4\224\1\u018a\7\224"+
- "\1\0\1\u018b\1\227\1\230\1\227\1\0\1\227\1\u018b"+
- "\1\227\1\0\1\227\4\0\2\227\1\0\3\227\1\0"+
- "\1\227\10\0\1\u018b\2\227\1\u018b\2\227\1\u018b\2\227"+
- "\1\0\4\227\1\0\1\u018b\1\227\1\0\1\227\1\0"+
- "\1\u018b\2\227\6\0\1\u018c\5\0\1\u018c\1\364\15\0"+
- "\2\u018c\7\0\2\u018c\1\0\2\u018c\1\0\2\u018c\7\0"+
- "\2\u018c\3\0\2\u018c\7\0\1\u018d\5\0\1\u018d\16\0"+
- "\2\u018d\7\0\2\u018d\1\0\2\u018d\1\0\2\u018d\7\0"+
- "\2\u018d\3\0\2\u018d\7\0\1\u018e\1\u011c\1\u011d\1\u011c"+
- "\1\0\1\u011c\1\u018e\1\u011c\1\0\1\u011c\1\u0121\11\u011c"+
- "\1\0\11\u011c\1\u018e\2\u011c\1\u018e\2\u011c\1\u018e\10\u011c"+
- "\1\u018e\4\u011c\1\u018e\7\u011c\1\0\1\u018f\1\u011f\1\u0148"+
- "\1\u011f\1\u0145\1\u011f\1\u018f\27\u011f\1\u018f\2\u011f\1\u018f"+
- "\2\u011f\1\u018f\10\u011f\1\u018f\4\u011f\1\u018f\7\u011f\1\0"+
- "\2\u011f\1\u0148\2\u0145\1\u0170\3\u011f\1\u0170\1\u0190\3\u011f"+
- "\2\u0145\52\u011f\1\0\2\u011f\1\u0148\1\0\1\u0145\12\u011f"+
- "\1\0\52\u011f\1\0\1\u0191\1\u0120\1\u0149\3\u0120\1\u0191"+
- "\1\u0120\1\u0145\25\u0120\1\u0191\2\u0120\1\u0191\2\u0120\1\u0191"+
- "\10\u0120\1\u0191\4\u0120\1\u0191\7\u0120\1\0\2\u0120\1\u0149"+
- "\1\u0145\1\u0120\1\u0173\2\u0120\1\u0145\1\u0173\1\u0192\3\u0120"+
- "\2\u0145\52\u0120\1\0\2\u0120\1\u0149\1\0\4\u0120\1\u0145"+
- "\6\u0120\1\0\52\u0120\42\0\2\u0193\30\0\2\134\1\135"+
- "\1\134\1\0\3\134\1\0\1\134\4\0\2\134\1\0"+
- "\3\134\1\0\1\134\10\0\11\134\1\0\4\134\1\0"+
- "\2\134\1\0\1\134\1\0\3\134\6\0\2\136\1\137"+
- "\1\136\1\0\3\136\1\0\1\136\4\0\2\136\1\0"+
- "\3\136\1\0\1\136\10\0\11\136\1\0\4\136\1\0"+
- "\2\136\1\0\1\136\1\0\3\136\44\0\2\u0194\33\0"+
- "\1\u0195\1\334\1\335\1\334\1\0\1\334\1\u0195\1\334"+
- "\1\0\1\334\1\u0100\3\0\2\334\1\0\3\334\1\0"+
- "\1\334\10\0\1\u0195\2\334\1\u0195\2\334\1\u0195\2\334"+
- "\1\0\4\334\1\0\1\u0195\1\334\1\0\1\334\1\0"+
- "\1\u0195\2\334\6\0\2\147\1\150\1\147\1\0\3\147"+
- "\1\0\1\147\4\0\2\147\1\0\3\147\1\251\1\147"+
- "\10\0\11\147\1\0\4\147\1\0\2\147\1\0\1\147"+
- "\1\0\3\147\6\0\2\152\1\153\1\152\1\154\65\152"+
- "\1\0\2\155\1\156\5\155\1\154\61\155\1\0\2\157"+
- "\1\160\1\157\1\161\65\157\1\0\2\162\1\163\5\162"+
- "\1\161\61\162\1\0\1\u0196\1\u0107\1\u0108\1\u0107\1\0"+
- "\1\u0107\1\u0196\1\u0107\1\0\1\u0107\1\u010b\11\u0107\1\0"+
- "\11\u0107\1\u0196\2\u0107\1\u0196\2\u0107\1\u0196\10\u0107\1\u0196"+
- "\4\u0107\1\u0196\7\u0107\1\0\1\u0197\1\u0109\1\u0133\1\u0109"+
- "\1\u0130\1\u0109\1\u0197\27\u0109\1\u0197\2\u0109\1\u0197\2\u0109"+
- "\1\u0197\10\u0109\1\u0197\4\u0109\1\u0197\7\u0109\1\0\1\u0198"+
- "\1\u010a\1\u0134\3\u010a\1\u0198\1\u010a\1\u0130\25\u010a\1\u0198"+
- "\2\u010a\1\u0198\2\u010a\1\u0198\10\u010a\1\u0198\4\u010a\1\u0198"+
- "\7\u010a\1\0\2\201\1\202\1\201\1\203\65\201\1\0"+
- "\2\204\1\205\5\204\1\203\61\204\1\0\2\210\1\211"+
- "\1\210\1\0\3\210\1\0\1\210\4\0\2\210\1\0"+
- "\3\210\1\0\1\210\10\0\11\210\1\0\4\210\1\0"+
- "\2\210\1\0\1\210\1\0\3\210\6\0\1\u0199\1\305"+
- "\1\306\1\305\1\0\1\305\1\u0199\1\305\1\0\1\305"+
- "\1\0\1\216\2\0\2\305\1\0\3\305\1\0\1\305"+
- "\10\0\1\u0199\2\305\1\u0199\2\305\1\u0199\2\305\1\0"+
- "\4\305\1\0\1\u0199\1\305\1\0\1\305\1\0\1\u0199"+
- "\2\305\6\0\2\221\1\222\1\221\1\223\65\221\1\0"+
- "\2\224\1\225\5\224\1\223\61\224\1\0\2\227\1\230"+
- "\1\227\1\0\3\227\1\0\1\227\4\0\2\227\1\0"+
- "\3\227\1\0\1\227\10\0\11\227\1\0\4\227\1\0"+
- "\2\227\1\0\1\227\1\0\3\227\15\0\1\364\63\0"+
- "\1\u019a\5\0\1\u019a\16\0\2\u019a\7\0\2\u019a\1\0"+
- "\2\u019a\1\0\2\u019a\7\0\2\u019a\3\0\2\u019a\7\0"+
- "\1\u019b\1\u011c\1\u011d\1\u011c\1\0\1\u011c\1\u019b\1\u011c"+
- "\1\0\1\u011c\1\u0121\11\u011c\1\0\11\u011c\1\u019b\2\u011c"+
- "\1\u019b\2\u011c\1\u019b\10\u011c\1\u019b\4\u011c\1\u019b\7\u011c"+
- "\1\0\1\u019c\1\u011f\1\u0148\1\u011f\1\u0145\1\u011f\1\u019c"+
- "\27\u011f\1\u019c\2\u011f\1\u019c\2\u011f\1\u019c\10\u011f\1\u019c"+
- "\4\u011f\1\u019c\7\u011f\1\0\1\u019d\1\u0120\1\u0149\3\u0120"+
- "\1\u019d\1\u0120\1\u0145\25\u0120\1\u019d\2\u0120\1\u019d\2\u0120"+
- "\1\u019d\10\u0120\1\u019d\4\u0120\1\u019d\7\u0120\65\0\1\u019e"+
- "\52\0\2\u019f\25\0\1\u01a0\1\334\1\335\1\334\1\0"+
- "\1\334\1\u01a0\1\334\1\0\1\334\1\u0100\3\0\2\334"+
- "\1\0\3\334\1\0\1\334\10\0\1\u01a0\2\334\1\u01a0"+
- "\2\334\1\u01a0\2\334\1\0\4\334\1\0\1\u01a0\1\334"+
- "\1\0\1\334\1\0\1\u01a0\2\334\6\0\1\u01a1\1\u0107"+
- "\1\u0108\1\u0107\1\0\1\u0107\1\u01a1\1\u0107\1\0\1\u0107"+
- "\1\u010b\11\u0107\1\0\11\u0107\1\u01a1\2\u0107\1\u01a1\2\u0107"+
- "\1\u01a1\10\u0107\1\u01a1\4\u0107\1\u01a1\7\u0107\1\0\1\u01a2"+
- "\1\u0109\1\u0133\1\u0109\1\u0130\1\u0109\1\u01a2\27\u0109\1\u01a2"+
- "\2\u0109\1\u01a2\2\u0109\1\u01a2\10\u0109\1\u01a2\4\u0109\1\u01a2"+
- "\7\u0109\1\0\1\u01a3\1\u010a\1\u0134\3\u010a\1\u01a3\1\u010a"+
- "\1\u0130\25\u010a\1\u01a3\2\u010a\1\u01a3\2\u010a\1\u01a3\10\u010a"+
- "\1\u01a3\4\u010a\1\u01a3\7\u010a\1\0\2\305\1\306\1\305"+
- "\1\0\3\305\1\0\1\305\1\0\1\216\2\0\2\305"+
- "\1\0\3\305\1\0\1\305\10\0\11\305\1\0\4\305"+
- "\1\0\2\305\1\0\1\305\1\0\3\305\6\0\1\u01a4"+
- "\5\0\1\u01a4\16\0\2\u01a4\7\0\2\u01a4\1\0\2\u01a4"+
- "\1\0\2\u01a4\7\0\2\u01a4\3\0\2\u01a4\7\0\1\u01a5"+
- "\1\u011c\1\u011d\1\u011c\1\0\1\u011c\1\u01a5\1\u011c\1\0"+
- "\1\u011c\1\u0121\11\u011c\1\0\11\u011c\1\u01a5\2\u011c\1\u01a5"+
- "\2\u011c\1\u01a5\10\u011c\1\u01a5\4\u011c\1\u01a5\7\u011c\1\0"+
- "\1\u01a6\1\u011f\1\u0148\1\u011f\1\u0145\1\u011f\1\u01a6\27\u011f"+
- "\1\u01a6\2\u011f\1\u01a6\2\u011f\1\u01a6\10\u011f\1\u01a6\4\u011f"+
- "\1\u01a6\7\u011f\1\0\1\u01a7\1\u0120\1\u0149\3\u0120\1\u01a7"+
- "\1\u0120\1\u0145\25\u0120\1\u01a7\2\u0120\1\u01a7\2\u0120\1\u01a7"+
- "\10\u0120\1\u01a7\4\u0120\1\u01a7\7\u0120\47\0\1\u01a8\24\0"+
- "\2\334\1\335\1\334\1\0\3\334\1\0\1\334\1\u0100"+
- "\3\0\2\334\1\0\3\334\1\0\1\334\10\0\11\334"+
- "\1\0\4\334\1\0\2\334\1\0\1\334\1\0\3\334"+
- "\6\0\1\u01a9\1\u0107\1\u0108\1\u0107\1\0\1\u0107\1\u01a9"+
- "\1\u0107\1\0\1\u0107\1\u010b\11\u0107\1\0\11\u0107\1\u01a9"+
- "\2\u0107\1\u01a9\2\u0107\1\u01a9\10\u0107\1\u01a9\4\u0107\1\u01a9"+
- "\7\u0107\1\0\1\u01aa\1\u0109\1\u0133\1\u0109\1\u0130\1\u0109"+
- "\1\u01aa\27\u0109\1\u01aa\2\u0109\1\u01aa\2\u0109\1\u01aa\10\u0109"+
- "\1\u01aa\4\u0109\1\u01aa\7\u0109\1\0\1\u01ab\1\u010a\1\u0134"+
- "\3\u010a\1\u01ab\1\u010a\1\u0130\25\u010a\1\u01ab\2\u010a\1\u01ab"+
- "\2\u010a\1\u01ab\10\u010a\1\u01ab\4\u010a\1\u01ab\7\u010a\1\0"+
- "\1\u01ac\1\u011c\1\u011d\1\u011c\1\0\1\u011c\1\u01ac\1\u011c"+
- "\1\0\1\u011c\1\u0121\11\u011c\1\0\11\u011c\1\u01ac\2\u011c"+
- "\1\u01ac\2\u011c\1\u01ac\10\u011c\1\u01ac\4\u011c\1\u01ac\7\u011c"+
- "\1\0\1\u01ad\1\u011f\1\u0148\1\u011f\1\u0145\1\u011f\1\u01ad"+
- "\27\u011f\1\u01ad\2\u011f\1\u01ad\2\u011f\1\u01ad\10\u011f\1\u01ad"+
- "\4\u011f\1\u01ad\7\u011f\1\0\1\u01ae\1\u0120\1\u0149\3\u0120"+
- "\1\u01ae\1\u0120\1\u0145\25\u0120\1\u01ae\2\u0120\1\u01ae\2\u0120"+
- "\1\u01ae\10\u0120\1\u01ae\4\u0120\1\u01ae\7\u0120\1\0\2\u0107"+
- "\1\u0108\1\u0107\1\0\3\u0107\1\0\1\u0107\1\u010b\11\u0107"+
- "\1\0\45\u0107\1\0\1\u01af\1\u0109\1\u0133\1\u0109\1\u0130"+
- "\1\u0109\1\u01af\27\u0109\1\u01af\2\u0109\1\u01af\2\u0109\1\u01af"+
- "\10\u0109\1\u01af\4\u0109\1\u01af\7\u0109\1\0\1\u01b0\1\u010a"+
- "\1\u0134\3\u010a\1\u01b0\1\u010a\1\u0130\25\u010a\1\u01b0\2\u010a"+
- "\1\u01b0\2\u010a\1\u01b0\10\u010a\1\u01b0\4\u010a\1\u01b0\7\u010a"+
- "\1\0\2\u011c\1\u011d\1\u011c\1\0\3\u011c\1\0\1\u011c"+
- "\1\u0121\11\u011c\1\0\45\u011c\1\0\1\u01b1\1\u011f\1\u0148"+
- "\1\u011f\1\u0145\1\u011f\1\u01b1\27\u011f\1\u01b1\2\u011f\1\u01b1"+
- "\2\u011f\1\u01b1\10\u011f\1\u01b1\4\u011f\1\u01b1\7\u011f\1\0"+
- "\1\u01b2\1\u0120\1\u0149\3\u0120\1\u01b2\1\u0120\1\u0145\25\u0120"+
- "\1\u01b2\2\u0120\1\u01b2\2\u0120\1\u01b2\10\u0120\1\u01b2\4\u0120"+
- "\1\u01b2\7\u0120\1\0\2\u0109\1\u0133\1\u0109\1\u0130\65\u0109"+
- "\1\0\2\u010a\1\u0134\5\u010a\1\u0130\61\u010a\1\0\2\u011f"+
- "\1\u0148\1\u011f\1\u0145\65\u011f\1\0\2\u0120\1\u0149\5\u0120"+
- "\1\u0145\61\u0120";
-
- private static int [] zzUnpackTrans() {
- int [] result = new int[21240];
- int offset = 0;
- offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackTrans(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do result[j++] = value; while (--count > 0);
- }
- return j;
- }
-
-
- /* error codes */
- private static final int ZZ_UNKNOWN_ERROR = 0;
- private static final int ZZ_NO_MATCH = 1;
- private static final int ZZ_PUSHBACK_2BIG = 2;
-
- /* error messages for the codes above */
- private static final String ZZ_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /**
- * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
-
- private static final String ZZ_ATTRIBUTE_PACKED_0 =
- "\23\0\1\11\7\1\1\11\1\1\1\11\2\1\1\11"+
- "\3\1\1\11\6\1\1\11\3\1\2\11\3\1\1\11"+
- "\2\1\2\11\3\1\1\11\1\1\1\11\10\1\2\11"+
- "\6\1\1\11\6\1\1\11\1\1\1\0\1\1\1\0"+
- "\1\1\1\0\1\1\10\0\1\1\4\0\1\11\4\0"+
- "\1\11\4\0\1\1\1\0\1\1\1\0\1\1\1\0"+
- "\1\11\1\0\1\1\1\0\1\1\2\0\1\11\3\0"+
- "\2\1\3\0\1\11\1\0\1\1\1\11\1\1\2\0"+
- "\1\11\2\0\2\1\2\0\1\1\2\0\1\11\1\1"+
- "\1\11\2\1\10\0\1\1\1\0\1\1\2\0\1\1"+
- "\2\0\1\1\2\0\1\1\2\0\5\1\1\0\1\1"+
- "\2\0\1\1\1\0\3\1\1\0\1\1\1\0\1\1"+
- "\2\0\1\1\1\0\3\1\1\0\3\1\2\11\10\0"+
- "\1\1\5\0\5\1\2\0\4\1\2\0\2\1\1\0"+
- "\1\1\1\0\3\1\3\0\1\11\2\0\1\11\1\0"+
- "\1\1\10\0\1\11\5\1\2\0\4\1\2\0\3\1"+
- "\5\0\1\11\1\0\3\1\2\0\1\11\2\0\1\1"+
- "\6\0\1\1\2\0\5\1\2\0\4\1\2\0\3\1"+
- "\2\0\1\1\3\0\3\1\1\0\1\11\2\0\1\1"+
- "\13\0\5\1\2\0\4\1\2\0\3\1\10\0\2\1"+
- "\1\11\2\0\1\1\6\0\1\1\1\0\1\1\2\0"+
- "\2\1\2\0\3\1\2\0\1\1\1\0\1\1\6\0"+
- "\2\1\4\0\1\11\4\0\1\11\3\0\1\11\12\0";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[434];
- int offset = 0;
- offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackAttribute(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- do result[j++] = value; while (--count > 0);
- }
- return j;
- }
-
- /** the input device */
- private java.io.Reader zzReader;
-
- /** the current state of the DFA */
- private int zzState;
-
- /** the current lexical state */
- private int zzLexicalState = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
-
- /** the textposition at the last accepting state */
- private int zzMarkedPos;
-
- /** the current text position in the buffer */
- private int zzCurrentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int zzStartRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int zzEndRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- private int yycolumn;
-
- /**
- * zzAtBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean zzAtBOL = true;
-
- /** zzAtEOF == true <=> the scanner is at the EOF */
- private boolean zzAtEOF;
-
- /* user code: */
- private final static String UNDEFINED = "undefined";
- private String fBufferedContext = null;
- private int fBufferedStart;
-// private int fBufferedTextLength;
- private int fBufferedLength;
-// private StringBuffer fBufferedText = null;
- private CSSTextRegionFactory fRegionFactory = CSSTextRegionFactory.getInstance();
- private int fInitialState = YYINITIAL;
- public final static int BUFFER_SIZE_NORMAL = 16384;
- public final static int BUFFER_SIZE_SMALL = 256;
- private int fInitialBufferSize = BUFFER_SIZE_NORMAL;
-
- public void setInitialState(int state) {
- fInitialState = state;
- }
-
- public void setInitialBufferSize(int size) {
- fInitialBufferSize = size;
- }
-
- /* user method */
- public final ITextRegion getNextToken() throws IOException {
- String context;
- String nextTokenType;
- boolean spaceFollows;
-// StringBuffer text;
- int start;
- int textLength;
- int length;
- if (fBufferedContext != null) {
- context = fBufferedContext;
-// text = fBufferedText;
- start = fBufferedStart;
- textLength = length = fBufferedLength;
-
- fBufferedContext = null;
- } else {
- context = primGetNextToken();
-// text = new StringBuffer(yytext());
- start = yychar;
- textLength = length = yylength();
- }
-
- if (context != null) {
- if (context == UNDEFINED) {
- // undef -> concatenate undef's
- nextTokenType = primGetNextToken();
- while (nextTokenType == UNDEFINED) {
-// text.append(yytext());
- textLength += yylength();
- length = textLength;
- nextTokenType = primGetNextToken();
- }
- fBufferedContext = nextTokenType;
-// fBufferedText = new StringBuffer(yytext());
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- } else {
- nextTokenType = null;
- spaceFollows = false;
- if (CSSRegionUtil.isDeclarationValueType(context)) { // declaration value can contain VALUE_S
- nextTokenType = primGetNextToken();
- spaceFollows = (nextTokenType == CSS_DECLARATION_VALUE_S);
- } else if (canContainSpace(context)) {
- nextTokenType = primGetNextToken();
- spaceFollows = (nextTokenType == CSS_S);
- }
- if (nextTokenType != null) { // nextToken is retrieved
- if (spaceFollows) {
- // next is space -> append
-// text.append(yytext());
- length += yylength();
- } else {
- // next is NOT space -> push this for next time, return itself
- fBufferedContext = nextTokenType;
-// fBufferedText = new StringBuffer(yytext());
- fBufferedStart = yychar;
- fBufferedLength = yylength();
- }
- }
- }
- }
-
- if (context != null) {
- if (context == UNDEFINED) {
- context = CSS_UNKNOWN;
- }
- return fRegionFactory.createRegion(context, start, textLength, length);
- } else {
- return null;
- }
- }
-
- /* user method */
- /* for standalone use */
- public final List parseText() throws IOException {
- List tokens = new ArrayList();
-
- CSSTextToken token;
- for (String kind = primGetNextToken(); kind != null; kind = primGetNextToken()) {
- token = new CSSTextToken();
- token.kind = kind;
- token.start = yychar;
- token.length = yylength();
- token.image = yytext();
- tokens.add(token);
- }
-
- return tokens;
- }
-
- /* user method */
- private boolean canContainSpace(String type) {
- if (type == CSS_DELIMITER || type == CSS_RBRACE || type == CSS_DECLARATION_DELIMITER) {
- return false;
- } else {
- return true;
- }
- }
-
- /* user method */
- public final int getOffset() {
- return yychar;
- }
-
- /* user method */
- public final boolean isEOF() {
- return zzAtEOF;
- }
-
- /* user method */
- public void reset(char[] charArray) {
- reset(new CharArrayReader(charArray), 0);
- }
-
- /* user method */
- public final void reset(java.io.Reader in, int newOffset) {
- /** the input device */
- zzReader = in;
-
- /** the current state of the DFA */
- zzState = 0;
-
- /** the current lexical state */
- zzLexicalState = fInitialState; //YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- if (zzBuffer.length != fInitialBufferSize) {
- zzBuffer = new char[fInitialBufferSize];
- }
- java.util.Arrays.fill(zzBuffer, (char)0);
-
- /** the textposition at the last accepting state */
- zzMarkedPos = 0;
-
- /** the textposition at the last state to be included in yytext */
-// yy_pushbackPos = 0;
-
- /** the current text position in the buffer */
- zzCurrentPos = 0;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- zzStartRead = 0;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- zzEndRead = 0;
-
- /** number of newlines encountered up to the start of the matched text */
- yyline = 0;
-
- /** the number of characters up to the start of the matched text */
- yychar = 0;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
-// yycolumn = 0;
-
- /**
- * yy_atBOL == true <=> the scanner is currently at the beginning of a line
- */
-// yy_atBOL = false;
-
- /** zzAtEOF == true <=> the scanner has returned a value for EOF */
- zzAtEOF = false;
-
- /* user variables */
- // fUndefined.delete(0, fUndefined.length());
- }
-
- /* user method */
- public CSSTokenizer() {
- super();
- }
-
- /**
- * Added to workaround stricter compilation options without creating
- * an alternate skeleton file
- */
- void _usePrivates() {
- System.out.print(yycolumn);
- System.out.print(yyline);
- System.out.print(Boolean.toString(zzAtBOL));
- }
-
-
- /**
- * 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 CSSTokenizer(java.io.Reader in) {
- this.zzReader = 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 CSSTokenizer(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 [] zzUnpackCMap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 170) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Refills the input buffer.
- *
- * @return <code>false</code>, iff there was new input.
- *
- * @exception java.io.IOException if any I/O-Error occurs
- */
- private boolean zzRefill() throws java.io.IOException {
-
- /* first: make room (if you can) */
- if (zzStartRead > 0) {
- System.arraycopy(zzBuffer, zzStartRead,
- zzBuffer, 0,
- zzEndRead-zzStartRead);
-
- /* translate stored positions */
- zzEndRead-= zzStartRead;
- zzCurrentPos-= zzStartRead;
- zzMarkedPos-= zzStartRead;
- zzStartRead = 0;
- }
-
- /* is the buffer big enough? */
- if (zzCurrentPos >= zzBuffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[zzCurrentPos*2];
- System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
- zzBuffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = zzReader.read(zzBuffer, zzEndRead,
- zzBuffer.length-zzEndRead);
-
- if (numRead > 0) {
- zzEndRead+= numRead;
- return false;
- }
- // unlikely but not impossible: read 0 characters, but not at end of stream
- if (numRead == 0) {
- int c = zzReader.read();
- if (c == -1) {
- return true;
- } else {
- zzBuffer[zzEndRead++] = (char) c;
- return false;
- }
- }
-
- // numRead < 0
- return true;
- }
-
-
- /**
- * Closes the input stream.
- */
- public final void yyclose() throws java.io.IOException {
- zzAtEOF = true; /* indicate end of file */
- zzEndRead = zzStartRead; /* invalidate buffer */
-
- if (zzReader != null)
- zzReader.close();
- }
-
-
- /**
- * Resets the scanner to read from a new input stream.
- * Does not close the old reader.
- *
- * All internal variables are reset, the old input stream
- * <b>cannot</b> be reused (internal buffer is discarded and lost).
- * Lexical state is set to <tt>ZZ_INITIAL</tt>.
- *
- * @param reader the new input stream
- */
- public final void yyreset(java.io.Reader reader) {
- zzReader = reader;
- zzAtBOL = true;
- zzAtEOF = false;
- zzEndRead = zzStartRead = 0;
- zzCurrentPos = zzMarkedPos = 0;
- yyline = yychar = yycolumn = 0;
- zzLexicalState = YYINITIAL;
- }
-
-
- /**
- * Returns the current lexical state.
- */
- public final int yystate() {
- return zzLexicalState;
- }
-
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- public final void yybegin(int newState) {
- zzLexicalState = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- public final String yytext() {
- return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
- }
-
-
- /**
- * Returns the character at position <tt>pos</tt> from the
- * matched text.
- *
- * It is equivalent to yytext().charAt(pos), but faster
- *
- * @param pos the position of the character to fetch.
- * A value from 0 to yylength()-1.
- *
- * @return the character at position pos
- */
- public final char yycharat(int pos) {
- return zzBuffer[zzStartRead+pos];
- }
-
-
- /**
- * Returns the length of the matched text region.
- */
- public final int yylength() {
- return zzMarkedPos-zzStartRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * In a wellformed scanner (no or only correct usage of
- * yypushback(int) and a match-all fallback rule) this method
- * will only be called with things that "Can't Possibly Happen".
- * If this method is called, something is seriously wrong
- * (e.g. a JFlex bug producing a faulty scanner etc.).
- *
- * Usual syntax/scanner level error handling should be done
- * in error fallback rules.
- *
- * @param errorCode the code of the errormessage to display
- */
- private void zzScanError(int errorCode) {
- String message;
- try {
- message = ZZ_ERROR_MSG[errorCode];
- }
- catch (ArrayIndexOutOfBoundsException e) {
- message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
- }
-
- throw new Error(message);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- public void yypushback(int number) {
- if ( number > yylength() )
- zzScanError(ZZ_PUSHBACK_2BIG);
-
- zzMarkedPos -= number;
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception java.io.IOException if any I/O-Error occurs
- */
- public String primGetNextToken() throws java.io.IOException {
- int zzInput;
- int zzAction;
-
- // cached fields:
- int zzCurrentPosL;
- int zzMarkedPosL;
- int zzEndReadL = zzEndRead;
- char [] zzBufferL = zzBuffer;
- char [] zzCMapL = ZZ_CMAP;
-
- int [] zzTransL = ZZ_TRANS;
- int [] zzRowMapL = ZZ_ROWMAP;
- int [] zzAttrL = ZZ_ATTRIBUTE;
-
- while (true) {
- zzMarkedPosL = zzMarkedPos;
-
- yychar+= zzMarkedPosL-zzStartRead;
-
- zzAction = -1;
-
- zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-
- zzState = ZZ_LEXSTATE[zzLexicalState];
-
-
- zzForAction: {
- while (true) {
-
- if (zzCurrentPosL < zzEndReadL)
- zzInput = zzBufferL[zzCurrentPosL++];
- else if (zzAtEOF) {
- zzInput = YYEOF;
- break zzForAction;
- }
- else {
- // store back cached positions
- zzCurrentPos = zzCurrentPosL;
- zzMarkedPos = zzMarkedPosL;
- boolean eof = zzRefill();
- // get translated positions and possibly new buffer
- zzCurrentPosL = zzCurrentPos;
- zzMarkedPosL = zzMarkedPos;
- zzBufferL = zzBuffer;
- zzEndReadL = zzEndRead;
- if (eof) {
- zzInput = YYEOF;
- break zzForAction;
- }
- else {
- zzInput = zzBufferL[zzCurrentPosL++];
- }
- }
- int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
- if (zzNext == -1) break zzForAction;
- zzState = zzNext;
-
- int zzAttributes = zzAttrL[zzState];
- if ( (zzAttributes & 1) == 1 ) {
- zzAction = zzState;
- zzMarkedPosL = zzCurrentPosL;
- if ( (zzAttributes & 8) == 8 ) break zzForAction;
- }
-
- }
- }
-
- // store back cached position
- zzMarkedPos = zzMarkedPosL;
-
- switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
- case 32:
- { yybegin(ST_IMPORT_MEDIUM); return CSS_STRING;
- }
- case 52: break;
- case 34:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_DIMENSION;
- }
- case 53: break;
- case 39:
- // lookahead expression with fixed lookahead length
- yypushback(1);
- { return CSS_DECLARATION_VALUE_S;
- }
- case 54: break;
- case 36:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_FUNCTION;
- }
- case 55: break;
- case 20:
- { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ATTRIBUTE_END;
- }
- case 56: break;
- case 1:
- { return UNDEFINED;
- }
- case 57: break;
- case 9:
- { yybegin(ST_IMPORT_DELIMITER); return CSS_MEDIUM;
- }
- case 58: break;
- case 37:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_STRING;
- }
- case 59: break;
- case 29:
- { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_CLASS;
- }
- case 60: break;
- case 13:
- { yybegin(YYINITIAL); return CSS_LBRACE;
- }
- case 61: break;
- case 4:
- { yybegin(YYINITIAL); return CSS_RBRACE;
- }
- case 62: break;
- case 11:
- { yybegin(ST_MEDIA_DELIMITER); return CSS_MEDIUM;
- }
- case 63: break;
- case 10:
- { yybegin(ST_IMPORT_MEDIUM); return CSS_MEDIA_SEPARATOR;
- }
- case 64: break;
- case 24:
- { yybegin(ST_DECLARATION_PRE_VALUE); return CSS_DECLARATION_SEPARATOR;
- }
- case 65: break;
- case 50:
- { yybegin(ST_FONT_FACE_DELIMITER); return CSS_FONT_FACE;
- }
- case 66: break;
- case 49:
- { yybegin(ST_CHARSET_NAME); return CSS_CHARSET;
- }
- case 67: break;
- case 45:
- { yybegin(ST_IMPORT_MEDIUM); return CSS_URI;
- }
- case 68: break;
- case 19:
- { yybegin(ST_SELECTOR_ATTRIBUTE_VALUE); return CSS_SELECTOR_ATTRIBUTE_OPERATOR;
- }
- case 69: break;
- case 40:
- { return CSS_CDC;
- }
- case 70: break;
- case 15:
- { yybegin(ST_DECLARATION); return CSS_LBRACE;
- }
- case 71: break;
- case 5:
- { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_UNIVERSAL;
- }
- case 72: break;
- case 7:
- { yybegin(ST_SELECTOR_ATTRIBUTE_NAME); return CSS_SELECTOR_ATTRIBUTE_START;
- }
- case 73: break;
- case 42:
- { return CSS_CDO;
- }
- case 74: break;
- case 8:
- { yybegin(YYINITIAL); return CSS_DELIMITER;
- }
- case 75: break;
- case 18:
- { yybegin(ST_SELECTOR_ATTRIBUTE_OPERATOR); return CSS_SELECTOR_ATTRIBUTE_NAME;
- }
- case 76: break;
- case 38:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_HASH;
- }
- case 77: break;
- case 44:
- { yybegin(ST_PAGE_PSEUDO_PAGE); return CSS_PAGE;
- }
- case 78: break;
- case 2:
- { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ELEMENT_NAME;
- }
- case 79: break;
- case 31:
- { yybegin(ST_CHARSET_DELIMITER); return CSS_STRING;
- }
- case 80: break;
- case 25:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_NUMBER;
- }
- case 81: break;
- case 16:
- { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR;
- }
- case 82: break;
- case 33:
- // lookahead expression with fixed lookahead length
- yypushback(1);
- { yybegin(ST_SELECTOR); return CSS_SELECTOR_COMBINATOR;
- }
- case 83: break;
- case 41:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_UNICODE_RANGE;
- }
- case 84: break;
- case 35:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PERCENTAGE;
- }
- case 85: break;
- case 12:
- { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA_SEPARATOR;
- }
- case 86: break;
- case 26:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IDENT;
- }
- case 87: break;
- case 14:
- { yybegin(ST_PAGE_DELIMITER); return CSS_PAGE_SELECTOR;
- }
- case 88: break;
- case 28:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_OPERATOR;
- }
- case 89: break;
- case 43:
- { return CSS_COMMENT;
- }
- case 90: break;
- case 51:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_IMPORTANT;
- }
- case 91: break;
- case 21:
- { yybegin(ST_SELECTOR_ATTRIBUTE_END); return CSS_SELECTOR_ATTRIBUTE_VALUE;
- }
- case 92: break;
- case 17:
- { yybegin(ST_SELECTOR); return CSS_SELECTOR_SEPARATOR;
- }
- case 93: break;
- case 3:
- { return CSS_S;
- }
- case 94: break;
- case 30:
- { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_ID;
- }
- case 95: break;
- case 48:
- { yybegin(ST_IMPORT_URI); return CSS_IMPORT;
- }
- case 96: break;
- case 27:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE;
- }
- case 97: break;
- case 47:
- { yybegin(ST_MEDIA_MEDIUM); return CSS_MEDIA;
- }
- case 98: break;
- case 23:
- { yybegin(ST_DECLARATION); return CSS_DECLARATION_DELIMITER;
- }
- case 99: break;
- case 22:
- { yybegin(ST_DECLARATION_SEPARATOR); return CSS_DECLARATION_PROPERTY;
- }
- case 100: break;
- case 6:
- { yybegin(ST_SELECTOR_MODIFIER); return CSS_SELECTOR_PSEUDO;
- }
- case 101: break;
- case 46:
- { yybegin(ST_DECLARATION_VALUE); return CSS_DECLARATION_VALUE_URI;
- }
- case 102: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- return null;
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/ICSSTokenizer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/ICSSTokenizer.java
deleted file mode 100644
index 9715ecb0b9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/ICSSTokenizer.java
+++ /dev/null
@@ -1,37 +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.css.core.internal.parser;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-/**
- * currently provide this interface but may be removed in future.
- */
-public interface ICSSTokenizer {
-
- void setInitialState(int initialState);
-
- void setInitialBufferSize(int bufsize);
-
- boolean isEOF();
-
- void reset(Reader reader, int i);
-
- ITextRegion getNextToken() throws IOException;
-
- void reset(char[] cs);
-
- int getOffset();
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java
deleted file mode 100644
index 927ff40312..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parser/regions/CSSTextRegionFactory.java
+++ /dev/null
@@ -1,35 +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.css.core.internal.parser.regions;
-
-import org.eclipse.wst.sse.core.internal.parser.ContextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-
-public class CSSTextRegionFactory {
- public synchronized static CSSTextRegionFactory getInstance() {
- if (fInstance == null) {
- fInstance = new CSSTextRegionFactory();
- }
- return fInstance;
- }
-
- public ITextRegion createRegion(String context, int start, int textLength, int length) {
- ITextRegion region = null;
- region = new ContextRegion(context, start, textLength, length);
- return region;
- }
-
- private CSSTextRegionFactory() {
- super();
- }
-
- private static CSSTextRegionFactory fInstance = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java
deleted file mode 100644
index 0027359cb5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSRegionContexts.java
+++ /dev/null
@@ -1,80 +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.css.core.internal.parserz;
-
-/**
- */
-public interface CSSRegionContexts {
- public static final String CSS_COMMENT = "COMMENT"; //$NON-NLS-1$
- public static final String CSS_CDO = "CDO"; //$NON-NLS-1$
- public static final String CSS_CDC = "CDC"; //$NON-NLS-1$
- public static final String CSS_S = "S"; //$NON-NLS-1$
-
- public static final String CSS_DELIMITER = "DELIMITER"; //$NON-NLS-1$
- public static final String CSS_LBRACE = "LBRACE"; //$NON-NLS-1$
- public static final String CSS_RBRACE = "RBRACE"; //$NON-NLS-1$
-
- public static final String CSS_IMPORT = "IMPORT"; //$NON-NLS-1$
- public static final String CSS_PAGE = "PAGE"; //$NON-NLS-1$
- public static final String CSS_MEDIA = "MEDIA"; //$NON-NLS-1$
- public static final String CSS_FONT_FACE = "FONT_FACE"; //$NON-NLS-1$
- public static final String CSS_CHARSET = "CHARSET"; //$NON-NLS-1$
- public static final String CSS_ATKEYWORD = "ATKEYWORD"; //$NON-NLS-1$
-
- public static final String CSS_STRING = "STRING"; //$NON-NLS-1$
- public static final String CSS_URI = "URI"; //$NON-NLS-1$
- public static final String CSS_MEDIUM = "MEDIUM"; //$NON-NLS-1$
- public static final String CSS_MEDIA_SEPARATOR = "MEDIA_SEPARATOR"; //$NON-NLS-1$
-
- public static final String CSS_CHARSET_NAME = "CHARSET_NAME"; //$NON-NLS-1$
-
- public static final String CSS_PAGE_SELECTOR = "CSS_PAGE_SELECTOR"; //$NON-NLS-1$
-
- public static final String CSS_SELECTOR_ELEMENT_NAME = "SELECTOR_ELEMENT_NAME"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_UNIVERSAL = "SELECTOR_UNIVERSAL"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_PSEUDO = "SELECTOR_PSEUDO"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_CLASS = "SELECTOR_CLASS"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_ID = "SELECTOR_ID"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_COMBINATOR = "SELECTOR_COMBINATOR"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_SEPARATOR = "SELECTOR_SEPARATOR"; //$NON-NLS-1$
-
- public static final String CSS_SELECTOR_ATTRIBUTE_START = "SELECTOR_ATTRIBUTE_START"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_ATTRIBUTE_END = "SELECTOR_ATTRIBUTE_END"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_ATTRIBUTE_NAME = "SELECTOR_ATTRIBUTE_NAME"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_ATTRIBUTE_VALUE = "SELECTOR_ATTRIBUTE_VALUE"; //$NON-NLS-1$
- public static final String CSS_SELECTOR_ATTRIBUTE_OPERATOR = "SELECTOR_ATTRIBUTE_OPERATOR"; //$NON-NLS-1$
-
- public static final String CSS_DECLARATION_PROPERTY = "DECLARATION_PROPERTY"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_SEPARATOR = "DECLARATION_SEPARATOR"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_DELIMITER = "DECLARATION_DELIMITER"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_IDENT = "DECLARATION_VALUE_IDENT"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_DIMENSION = "DECLARATION_VALUE_DIMENSION"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_PERCENTAGE = "DECLARATION_VALUE_PERCENTAGE"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_NUMBER = "DECLARATION_VALUE_NUMBER"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_FUNCTION = "DECLARATION_VALUE_FUNCTION"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE = "DECLARATION_VALUE_PARENTHESIS_CLOSE"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_STRING = "DECLARATION_VALUE_STRING"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_URI = "DECLARATION_VALUE_URI"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_HASH = "DECLARATION_VALUE_HASH"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_UNICODE_RANGE = "DECLARATION_VALUE_UNICODE_RANGE"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_IMPORTANT = "CSS_DECLARATION_VALUE_IMPORTANT"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_OPERATOR = "DECLARATION_VALUE_OPERATOR"; //$NON-NLS-1$
- public static final String CSS_DECLARATION_VALUE_S = "DECLARATION_VALUE_S"; //$NON-NLS-1$
-
- public static final String CSS_UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
-
- // For null object : CSSTokenizer never set this value
- public static final String CSS_UNDEFINED = "UNDEFINED"; //$NON-NLS-1$
- /**
- * currently provided this field but may be removed in future.
- */
- public static final String CSS_FOREIGN_ELEMENT = "FOREIGN_ELEMENT"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java
deleted file mode 100644
index 1253614ec5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextParser.java
+++ /dev/null
@@ -1,101 +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.css.core.internal.parserz;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.parser.CSSTokenizer;
-
-
-
-public class CSSTextParser {
- public static final int MODE_STYLESHEET = 0;
- public static final int MODE_DECLARATION = 1;
- public static final int MODE_DECLARATION_VALUE = 2;
-
- public CSSTextParser(int parserMode) {
- initializeParserMode(parserMode);
- }
-
- public CSSTextParser(int parserMode, Reader reader) {
- initializeParserMode(parserMode);
- reset(reader);
- }
-
- public CSSTextParser(int parserMode, String input) {
- initializeParserMode(parserMode);
- reset(input);
- }
-
- public void reset(Reader reader) {
- getTokenizer().reset(reader, 0);
- }
-
- public void reset(String input) {
- getTokenizer().reset(new StringReader(input), 0);
- }
-
- public CSSTextToken[] getTokens() {
- List tokenList = getTokenList();
- CSSTextToken[] tokens = new CSSTextToken[tokenList.size()];
- return (CSSTextToken[]) tokenList.toArray(tokens);
- }
-
- public List getTokenList() {
- List tokens;
- try {
- tokens = getTokenizer().parseText();
- }
- catch (IOException e) {
- tokens = Collections.EMPTY_LIST;
- }
- return tokens;
- }
-
- private void initializeParserMode(int parserMode) {
- int initialState;
- int bufsize;
- switch (parserMode) {
- case MODE_STYLESHEET :
- initialState = CSSTokenizer.YYINITIAL;
- bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
- break;
- case MODE_DECLARATION :
- initialState = CSSTokenizer.ST_DECLARATION;
- bufsize = CSSTokenizer.BUFFER_SIZE_NORMAL;
- break;
- case MODE_DECLARATION_VALUE :
- initialState = CSSTokenizer.ST_DECLARATION_PRE_VALUE;
- bufsize = CSSTokenizer.BUFFER_SIZE_SMALL;
- break;
- default :
- return;
- }
- if (0 < initialState) {
- CSSTokenizer tokenizer = getTokenizer();
- tokenizer.setInitialState(initialState);
- tokenizer.setInitialBufferSize(bufsize);
- }
- }
-
- private CSSTokenizer getTokenizer() {
- if (fTokenizer == null) {
- fTokenizer = new CSSTokenizer();
- }
- return fTokenizer;
- }
-
- private CSSTokenizer fTokenizer = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java
deleted file mode 100644
index fcc9078c1a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/parserz/CSSTextToken.java
+++ /dev/null
@@ -1,23 +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.css.core.internal.parserz;
-
-
-public class CSSTextToken {
- public String kind;
- public String image;
- public int start;
- public int length;
-
- public String toString() {
- return (image != null) ? image : ""; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
deleted file mode 100644
index 20562881cb..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceInitializer.java
+++ /dev/null
@@ -1,72 +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.css.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.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-/**
- * Sets default values for CSS Core preferences
- */
-public class CSSCorePreferenceInitializer extends AbstractPreferenceInitializer {
-
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(CSSCorePlugin.getDefault().getBundle().getSymbolicName());
-
- // formatting preferences
- node.putInt(CSSCorePreferenceNames.LINE_WIDTH, 72);
- node.putBoolean(CSSCorePreferenceNames.CLEAR_ALL_BLANK_LINES, false);
- node.put(CSSCorePreferenceNames.INDENTATION_CHAR, CSSCorePreferenceNames.TAB);
- node.putInt(CSSCorePreferenceNames.INDENTATION_SIZE, 1);
-
- // cleanup preferences
- node.putBoolean(CSSCorePreferenceNames.QUOTE_ATTR_VALUES, true);
- node.putBoolean(CSSCorePreferenceNames.FORMAT_SOURCE, true);
-
- // 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$
-
- // this could be made smarter by actually looking up the content
- // type's valid extensions
- node.put(CSSCorePreferenceNames.DEFAULT_EXTENSION, "css"); //$NON-NLS-1$
-
- // additional css core preferences
- node.putInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM, 0);
- node.putInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM, 1);
- node.put(CSSCorePreferenceNames.FORMAT_QUOTE, "\"");//$NON-NLS-1$
- node.put(CSSCorePreferenceNames.FORMAT_BETWEEN_VALUE, " ");//$NON-NLS-1$
- node.putBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI, true);
- node.putBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, true);
- node.putBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, true);
- node.putBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE, false);
- node.putInt(CSSCorePreferenceNames.CASE_IDENTIFIER, CSSCorePreferenceNames.UPPER);
- node.putInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME, CSSCorePreferenceNames.LOWER);
- node.putInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, CSSCorePreferenceNames.LOWER);
-
- // CSS cleanup preferences
- node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_IDENTIFIER, CSSCorePreferenceNames.ASIS);
- node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_NAME, CSSCorePreferenceNames.ASIS);
- node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_PROPERTY_VALUE, CSSCorePreferenceNames.ASIS);
- node.putInt(CSSCorePreferenceNames.CLEANUP_CASE_SELECTOR, CSSCorePreferenceNames.ASIS);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
deleted file mode 100644
index d3fa08deea..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/preferences/CSSCorePreferenceNames.java
+++ /dev/null
@@ -1,143 +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.css.core.internal.preferences;
-
-/**
- * CSS core preference keys.
- *
- * @plannedfor 1.0
- */
-public class CSSCorePreferenceNames {
- private CSSCorePreferenceNames() {
- // empty private constructor so users cannot instantiate class
- }
-
- public static final String CASE_IDENTIFIER = "identifierCase"; //$NON-NLS-1$
- public static final String CASE_PROPERTY_NAME = "propNameCase"; //$NON-NLS-1$
- public static final String CASE_PROPERTY_VALUE = "propValueCase"; //$NON-NLS-1$
- public static final String FORMAT_BETWEEN_VALUE = "betweenValue"; //$NON-NLS-1$
- public static final String FORMAT_PROP_POST_DELIM = "postDelim"; //$NON-NLS-1$
- public static final String FORMAT_PROP_PRE_DELIM = "preDelim"; //$NON-NLS-1$
- public static final String FORMAT_QUOTE = "quote"; //$NON-NLS-1$
- public static final String FORMAT_QUOTE_IN_URI = "quoteInURI"; //$NON-NLS-1$
- public static final String WRAPPING_NEWLINE_ON_OPEN_BRACE = "newLineOnOpenBrace"; //$NON-NLS-1$
- public static final String WRAPPING_ONE_PER_LINE = "onePropertyPerLine"; //$NON-NLS-1$
- public static final String WRAPPING_PROHIBIT_WRAP_ON_ATTR = "prohibitWrapOnAttr"; //$NON-NLS-1$
-
- // CSS cleanup preference names
- public static final String CLEANUP_CASE_IDENTIFIER = "cleanupIdentifierCase"; //$NON-NLS-1$
- public static final String CLEANUP_CASE_PROPERTY_NAME = "cleanupPropNameCase"; //$NON-NLS-1$
- public static final String CLEANUP_CASE_PROPERTY_VALUE = "cleanupPropValueCase"; //$NON-NLS-1$
- public static final String CLEANUP_CASE_SELECTOR = "cleanupSelectorCase"; //$NON-NLS-1$
-
- /**
- * The default extension to use when none is specified in the New CSS 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 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 cleanup processor should format source.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String FORMAT_SOURCE = "formatSource";//$NON-NLS-1$
-
- /**
- * Possible value for the case preferences Indicates to leave case as is.
- *
- * @see #LOWER
- * @see #UPPER
- */
- public static final int ASIS = 0;
-
- /**
- * Possible value for the case preferences Indicates to make name
- * lowercase.
- *
- * @see #ASIS
- * @see #UPPER
- */
- public static final int LOWER = 1;
-
- /**
- * Possible value for the case preferences Indicates to make name
- * uppercase.
- *
- * @see #LOWER
- * @see #ASIS
- */
- public static final int UPPER = 2;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java
deleted file mode 100644
index f018816052..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/ICSSModelAdapter.java
+++ /dev/null
@@ -1,24 +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.css.core.internal.provisional.adapters;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-
-
-/**
- */
-public interface ICSSModelAdapter extends INodeAdapter {
-
- ICSSModel getModel();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java
deleted file mode 100644
index d1f94d2882..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IModelProvideAdapter.java
+++ /dev/null
@@ -1,35 +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.css.core.internal.provisional.adapters;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-
-/**
- *
- */
-public interface IModelProvideAdapter extends INodeAdapter {
-
- /**
- *
- */
- void modelProvided(IStructuredModel newModel);
-
- /**
- */
- void modelReleased(IStructuredModel newModel);
-
- /**
- */
- void modelRemoved(IStructuredModel newModel);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java
deleted file mode 100644
index 436a937f76..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleDeclarationAdapter.java
+++ /dev/null
@@ -1,25 +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.css.core.internal.provisional.adapters;
-
-
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-
-/**
- */
-public interface IStyleDeclarationAdapter extends ICSSModelAdapter {
-
- /**
- */
- public CSSStyleDeclaration getStyle();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java
deleted file mode 100644
index d0e29778bf..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSelectorAdapter.java
+++ /dev/null
@@ -1,33 +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.css.core.internal.provisional.adapters;
-
-
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.Element;
-
-
-/**
- *
- */
-public interface IStyleSelectorAdapter extends INodeAdapter {
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- * @param pseudoName
- * java.lang.String
- */
- boolean match(ICSSSimpleSelector selector, Element element, String pseudoName);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java
deleted file mode 100644
index 814752d427..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetAdapter.java
+++ /dev/null
@@ -1,41 +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.css.core.internal.provisional.adapters;
-
-
-
-import org.w3c.dom.Element;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- */
-public interface IStyleSheetAdapter extends ICSSModelAdapter {
-
- /**
- * Returns HTML/XML element that is the owner of this adapter
- */
- Element getElement();
-
- /**
- * Returns CSS document that is related to this element
- */
- public StyleSheet getSheet();
-
- /**
- * This is called at the time of releasing HTML/XML model
- */
- public void released();
-
- /**
- * This is called at the time of removing this Element from the document
- */
- public void removed();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java
deleted file mode 100644
index 8e63889c1d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/adapters/IStyleSheetListAdapter.java
+++ /dev/null
@@ -1,41 +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.css.core.internal.provisional.adapters;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- */
-public interface IStyleSheetListAdapter extends INodeAdapter {
-
- /**
- */
- Enumeration getClasses();
-
- /**
- */
- public CSSStyleDeclaration getOverrideStyle(Element element, String pseudoName);
-
- /**
- */
- public StyleSheetList getStyleSheets();
-
- /**
- */
- public void releaseStyleSheets();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java
deleted file mode 100644
index 79622cf86c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/contenttype/ContentTypeIdForCSS.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.wst.css.core.internal.provisional.contenttype;
-
-
-/**
- * This class, with its one field, is a convience to provide compile-time
- * safety when refering to a contentType ID. The value of the contenttype id
- * field must match what is specified in plugin.xml file.
- */
-
-public class ContentTypeIdForCSS {
- /**
- * 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 final static String ContentTypeID_CSS = getConstantString();
-
- /**
- * Don't allow instantiation.
- */
- private ContentTypeIdForCSS() {
- super();
- }
-
- static String getConstantString() {
- return "org.eclipse.wst.css.core.csssource"; //$NON-NLS-1$
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java
deleted file mode 100644
index 9d2afa2899..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAccess.java
+++ /dev/null
@@ -1,26 +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.css.core.internal.provisional.document;
-
-
-
-import java.util.Vector;
-
-/**
- *
- */
-public interface ICSSAccess {
-
- /**
- * @return java.util.Vector
- */
- Vector getClassNames();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java
deleted file mode 100644
index cd80a8c059..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSAttr.java
+++ /dev/null
@@ -1,40 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSAttr extends ICSSNode {
-
- /**
- * @return java.lang.String
- */
- String getName();
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- */
- ICSSNode getOwnerCSSNode();
-
- /**
- * @return java.lang.String
- */
- String getValue();
-
- /**
- * @param newValue
- * java.lang.String
- */
- void setValue(String newValue);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java
deleted file mode 100644
index 1a34ed19c5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSCharsetRule.java
+++ /dev/null
@@ -1,23 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSCharsetRule;
-
-/**
- *
- */
-public interface ICSSCharsetRule extends ICSSNode, CSSCharsetRule {
-
- java.lang.String ENCODING = "encoding"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java
deleted file mode 100644
index a56c0d927b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSDocument.java
+++ /dev/null
@@ -1,94 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSFontFaceRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSUnknownRule;
-import org.w3c.dom.stylesheets.MediaList;
-
-/**
- *
- */
-public interface ICSSDocument extends ICSSNode {
-
- /**
- * @return org.w3c.dom.css.CSSCharsetRule
- */
- ICSSCharsetRule createCSSCharsetRule();
-
- /**
- * @return org.w3c.dom.css.CSSFontFaceRule
- */
- CSSFontFaceRule createCSSFontFaceRule();
-
- /**
- * @return org.w3c.dom.css.CSSImportRule
- */
- ICSSImportRule createCSSImportRule();
-
- /**
- * @return org.w3c.dom.css.ICSSMediaRule
- */
- ICSSMediaRule createCSSMediaRule();
-
- /**
- * @return org.w3c.dom.css.CSSPageRule
- */
- ICSSPageRule createCSSPageRule();
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue createCSSPrimitiveValue(short primitiveType);
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * java.lang.String
- */
- CSSRule createCSSRule(String rule);
-
- /**
- * @return org.w3c.dom.css.CSSStyleDeclaration
- */
- ICSSStyleDeclaration createCSSStyleDeclaration();
-
- /**
- * @param propertyName
- * java.lang.String
- */
- ICSSStyleDeclItem createCSSStyleDeclItem(String propertyName);
-
- /**
- * @return org.w3c.dom.css.CSSStyleRule
- */
- ICSSStyleRule createCSSStyleRule();
-
- /**
- * @return org.w3c.dom.css.CSSUnknownRule
- */
- CSSUnknownRule createCSSUnknownRule();
-
- /**
- * @return org.w3c.dom.stylesheets.MediaList
- */
- MediaList createMediaList();
-
- ICSSModel getModel();
-
- /**
- * @return boolean
- */
- boolean isDocument();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java
deleted file mode 100644
index 21d90d110b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSImportRule.java
+++ /dev/null
@@ -1,34 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSImportRule;
-
-/**
- *
- */
-public interface ICSSImportRule extends ICSSNode, CSSImportRule {
-
- java.lang.String HREF = "href"; //$NON-NLS-1$
-
- /**
- *
- */
- void refreshStyleSheet();
-
- /**
- * @param href
- * java.lang.String
- */
- void setHref(String href);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java
deleted file mode 100644
index c840336b41..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSMediaRule.java
+++ /dev/null
@@ -1,22 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSMediaRule;
-
-/**
- *
- */
-public interface ICSSMediaRule extends ICSSNode, ICSSRuleContainer, CSSMediaRule {
-
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java
deleted file mode 100644
index 596e571f2a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSModel.java
+++ /dev/null
@@ -1,46 +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.css.core.internal.provisional.document;
-
-
-
-import org.eclipse.wst.css.core.internal.event.ICSSStyleNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Node;
-
-
-/**
- *
- */
-public interface ICSSModel extends ICSSStyleNotifier, IStructuredModel {
-
- public static final String EXTERNAL = "externalCSS"; //$NON-NLS-1$
- public static final String EMBEDDED = "embeddedCSS"; //$NON-NLS-1$
- public static final String INLINE = "inlineCSS"; //$NON-NLS-1$
-
- ICSSDocument getDocument();
-
- /**
- * @return org.w3c.dom.Node
- */
- Node getOwnerDOMNode();
-
- /**
- *
- * @return java.lang.Object
- */
- Object getStyleSheetType();
-
- /**
- * cleanup -> rebuild CSS Nodes This is pre-beta fix for 178176.
- */
- void refreshNodes();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java
deleted file mode 100644
index 82869c24c8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNamedNodeMap.java
+++ /dev/null
@@ -1,26 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSNamedNodeMap extends ICSSNodeList {
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNode
- * @param name
- * java.lang.String
- */
- ICSSNode getNamedItem(String name);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java
deleted file mode 100644
index eb17e537b5..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNode.java
+++ /dev/null
@@ -1,68 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSNode {
-
- short ATTR_NODE = -1;
- short UNKNOWNRULE_NODE = 0;
- short STYLERULE_NODE = 1;
- short CHARSETRULE_NODE = 2;
- short IMPORTRULE_NODE = 3;
- short MEDIARULE_NODE = 4;
- short FONTFACERULE_NODE = 5;
- short PAGERULE_NODE = 6;
- short STYLESHEET_NODE = 7;
- short STYLEDECLARATION_NODE = 8;
- short STYLEDECLITEM_NODE = 9;
- short VALUELIST_NODE = 10;
- short PRIMITIVEVALUE_NODE = 11;
- short MEDIALIST_NODE = 12;
- short DOCUMENTCSSSTYLE_NODE = 13;
- short LINKSTYLE_NODE = 14;
- short ELEMENTCSSINLINESTYLE_NODE = 15;
-
- ICSSNode cloneNode(boolean deep);
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSNamedNodeMap
- */
- ICSSNamedNodeMap getAttributes();
-
- ICSSNodeList getChildNodes();
-
- ICSSNode getFirstChild();
-
- ICSSNode getLastChild();
-
- ICSSNode getNextSibling();
-
- /**
- * @return short
- */
- short getNodeType();
-
- ICSSDocument getOwnerDocument();
-
- ICSSNode getParentNode();
-
- ICSSNode getPreviousSibling();
-
- /**
- * @return boolean
- */
- boolean hasChildNodes();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java
deleted file mode 100644
index 310dfbb627..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSNodeList.java
+++ /dev/null
@@ -1,26 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSNodeList {
-
- /**
- * @return int
- */
- int getLength();
-
- ICSSNode item(int index);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java
deleted file mode 100644
index 96a24a01e3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPageRule.java
+++ /dev/null
@@ -1,22 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSPageRule;
-
-public interface ICSSPageRule extends ICSSNode, CSSPageRule {
-
- java.lang.String SELECTOR = "selector"; //$NON-NLS-1$
-
- ICSSSelectorList getSelectors();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java
deleted file mode 100644
index ebeacb809e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSPrimitiveValue.java
+++ /dev/null
@@ -1,46 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSPrimitiveValue;
-
-/**
- *
- */
-public interface ICSSPrimitiveValue extends ICSSNode, ICSSValue, CSSPrimitiveValue {
-
- short CSS_INTEGER = 26;
- short CSS_HASH = 27;
- short CSS_URANGE = 28;
- short CSS_FORMAT = 29;
- short CSS_LOCAL = 30;
- short CSS_SLASH = 31;
- short CSS_COMMA = 32;
- short CSS_INHERIT_PRIMITIVE = 33;
-
- /**
- * @param floatValue
- * float
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setValue(float floatValue) throws org.w3c.dom.DOMException;
-
- /**
- * @param stringValue
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setValue(String stringValue) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java
deleted file mode 100644
index 29ae5966c8..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSRuleContainer.java
+++ /dev/null
@@ -1,60 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.css.CSSRule;
-
-/**
- *
- */
-public interface ICSSRuleContainer {
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- CSSRule appendRule(CSSRule rule) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newRule
- * org.w3c.dom.css.CSSRule
- * @param refRule
- * org.w3c.dom.css.CSSRule
- */
- CSSRule insertRuleBefore(CSSRule newRule, CSSRule refRule) throws DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param rule
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- CSSRule removeRule(CSSRule rule) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSRule
- * @param newChild
- * org.w3c.dom.css.CSSRule
- * @param oldChild
- * org.w3c.dom.css.CSSRule
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- CSSRule replaceRule(CSSRule newRule, CSSRule oldRule) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java
deleted file mode 100644
index 3e9541cdf6..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelector.java
+++ /dev/null
@@ -1,62 +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.css.core.internal.provisional.document;
-
-
-
-import java.util.Iterator;
-
-import org.w3c.dom.Element;
-
-/**
- *
- */
-public interface ICSSSelector {
-
- ICSSSelectorItem getItem(int index);
-
- /**
- * @return java.util.Iterator
- */
- Iterator getIterator();
-
- /**
- * @return int
- */
- int getLength();
-
- /**
- * @return int
- */
- int getSpecificity();
-
- /**
- * @return java.lang.String
- */
- String getString();
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- boolean match(Element element, String pseudoName);
-
- /**
- *
- */
- Iterator getErrors();
-
- /**
- *
- */
- int getErrorCount();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java
deleted file mode 100644
index fe443c0d36..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorCombinator.java
+++ /dev/null
@@ -1,29 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSSelectorCombinator extends ICSSSelectorItem {
-
- public static final char DESCENDANT = ' ';
- public static final char CHILD = '>';
- public static final char ADJACENT = '+';
- public static final char UNKNOWN = '?'; // error case
-
- /**
- * @return int
- */
- char getCombinatorType();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java
deleted file mode 100644
index 34fe8f8871..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorItem.java
+++ /dev/null
@@ -1,32 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSSelectorItem {
-
- public static final int SIMPLE = 1;
- public static final int COMBINATOR = 2;
-
- /**
- * @return int
- */
- int getItemType();
-
- /**
- * @return java.lang.String
- */
- String getString();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java
deleted file mode 100644
index 077fd0c420..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSelectorList.java
+++ /dev/null
@@ -1,62 +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.css.core.internal.provisional.document;
-
-
-
-import java.util.Iterator;
-
-import org.w3c.dom.Element;
-
-/**
- *
- */
-public interface ICSSSelectorList {
-
- /**
- * @return java.util.Iterator
- */
- Iterator getIterator();
-
- /**
- * @return int
- */
- int getLength();
-
- /**
- * @return java.util.Vector
- * @param index
- * int
- */
- ICSSSelector getSelector(int index);
-
- /**
- * @return java.lang.String
- */
- String getString();
-
- /**
- *
- */
- int getErrorCount();
-
- /**
- *
- */
- Iterator getErrors();
-
- /**
- * @return boolean
- * @param element
- * org.w3c.dom.Element
- */
- boolean match(Element element, String pseudoName);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java
deleted file mode 100644
index 5d9fb82ae3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSSimpleSelector.java
+++ /dev/null
@@ -1,77 +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.css.core.internal.provisional.document;
-
-
-
-/**
- *
- */
-public interface ICSSSimpleSelector extends ICSSSelectorItem {
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getAttribute(int index);
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getClass(int index);
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getID(int index);
-
- /**
- * @return java.lang.String
- */
- String getName();
-
- /**
- * @return boolean
- */
- int getNumOfAttributes();
-
- /**
- * @return boolean
- */
- int getNumOfClasses();
-
- /**
- * @return boolean
- */
- int getNumOfIDs();
-
- /**
- * @return boolean
- */
- int getNumOfPseudoNames();
-
- /**
- * @return java.lang.String
- * @param index
- * int
- */
- String getPseudoName(int index);
-
- /**
- * @return boolean
- */
- boolean isUniversal();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java
deleted file mode 100644
index 029cd6bec7..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclItem.java
+++ /dev/null
@@ -1,73 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public interface ICSSStyleDeclItem extends ICSSNode, ICSSValueList {
-
- java.lang.String IMPORTANT = "important"; //$NON-NLS-1$
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSValue
- */
- CSSValue getCSSValue();
-
- /**
- * @return java.lang.String
- */
- String getPriority();
-
- /**
- * @return java.lang.String
- */
- String getPropertyName();
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param newValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @param oldValue
- * org.w3c.dom.css.CSSPrimitiveValue
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- ICSSPrimitiveValue replaceValue(ICSSPrimitiveValue newValue, ICSSPrimitiveValue oldValue) throws org.w3c.dom.DOMException;
-
- /**
- * @param priority
- * java.lang.String
- */
- void setPriority(String priority);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java
deleted file mode 100644
index 7e8736675a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleDeclaration.java
+++ /dev/null
@@ -1,24 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSStyleDeclaration;
-
-public interface ICSSStyleDeclaration extends ICSSDocument, CSSStyleDeclaration {
-
- ICSSStyleDeclItem getDeclItemNode(String propertyName);
-
- ICSSStyleDeclItem removeDeclItemNode(ICSSStyleDeclItem oldDecl) throws org.w3c.dom.DOMException;
-
- ICSSStyleDeclItem setDeclItemNode(ICSSStyleDeclItem newDecl) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java
deleted file mode 100644
index ac4e1a6964..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleRule.java
+++ /dev/null
@@ -1,22 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSStyleRule;
-
-public interface ICSSStyleRule extends ICSSNode, CSSStyleRule {
-
- java.lang.String SELECTOR = "selector"; //$NON-NLS-1$
-
- ICSSSelectorList getSelectors();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
deleted file mode 100644
index 0240eb2c7f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSStyleSheet.java
+++ /dev/null
@@ -1,47 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-/**
- *
- */
-public interface ICSSStyleSheet extends ICSSDocument, ICSSRuleContainer, CSSStyleSheet {
-
- /**
- * @return org.w3c.dom.NodeList
- */
- NodeList getOwnerNodes();
-
- /**
- * @return org.w3c.dom.NodeList
- * @param doc
- * org.w3c.dom.Document
- */
- NodeList getOwnerNodes(Document doc);
-
- /**
- * @return org.w3c.dom.css.CSSRuleList
- */
- CSSRuleList getOwnerRules();
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheetList
- */
- StyleSheetList getParentStyleSheets();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java
deleted file mode 100644
index 1769140fb3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValue.java
+++ /dev/null
@@ -1,26 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSValue;
-
-/**
- *
- */
-public interface ICSSValue extends CSSValue {
-
- /**
- * @return java.lang.String
- */
- String getCSSValueText();
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java
deleted file mode 100644
index b49c575f02..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICSSValueList.java
+++ /dev/null
@@ -1,35 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.CSSValueList;
-
-/**
- *
- */
-public interface ICSSValueList extends ICSSValue, CSSValueList {
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue appendValue(ICSSPrimitiveValue value);
-
- /**
- * @return org.w3c.dom.css.CSSPrimitiveValue
- * @param value
- * org.w3c.dom.css.CSSPrimitiveValue
- */
- ICSSPrimitiveValue removeValue(ICSSPrimitiveValue value);
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java
deleted file mode 100644
index ff824b8284..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/ICounter.java
+++ /dev/null
@@ -1,49 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.Counter;
-
-/**
- *
- */
-public interface ICounter extends ICSSNode, Counter {
-
- java.lang.String IDENTIFIER = "identifier"; //$NON-NLS-1$
- java.lang.String LISTSTYLE = "liststyle"; //$NON-NLS-1$
- java.lang.String SEPARATOR = "separator"; //$NON-NLS-1$
-
- /**
- * @param identifier
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setIdentifier(String identifier) throws org.w3c.dom.DOMException;
-
- /**
- * @param listStyle
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setListStyle(String listStyle) throws org.w3c.dom.DOMException;
-
- /**
- * @param Separator
- * java.lang.String
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- void setSeparator(String separator) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java
deleted file mode 100644
index dc44e98e2f..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDOMImplementationCSS.java
+++ /dev/null
@@ -1,23 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.css.DOMImplementationCSS;
-
-/**
- *
- */
-public interface IDOMImplementationCSS extends DOMImplementationCSS {
-
- ICSSStyleDeclaration createCSSStyleDeclaration() throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java
deleted file mode 100644
index 6a4606666b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/document/IDocumentStyle.java
+++ /dev/null
@@ -1,62 +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.css.core.internal.provisional.document;
-
-
-
-import org.w3c.dom.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.StyleSheet;
-
-/**
- *
- */
-public interface IDocumentStyle extends DocumentStyle {
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param newSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet appendSheet(StyleSheet newSheet) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param newSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @param refSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet insertSheetBefore(StyleSheet newSheet, StyleSheet refSheet) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param oldSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet removeSheet(StyleSheet oldSheet) throws org.w3c.dom.DOMException;
-
- /**
- * @return org.w3c.dom.stylesheets.StyleSheet
- * @param newSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @param oldSheet
- * org.w3c.dom.stylesheets.StyleSheet
- * @exception org.w3c.dom.DOMException
- * The exception description.
- */
- StyleSheet replaceSheet(StyleSheet newSheet, StyleSheet oldSheet) throws org.w3c.dom.DOMException;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java
deleted file mode 100644
index e1fafe6f0e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/preferences/CSSPreferenceHelper.java
+++ /dev/null
@@ -1,229 +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.css.core.internal.provisional.preferences;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
-
-/**
- * @deprecated just access preferences directly
- */
-public class CSSPreferenceHelper {
-
- /**
- *
- */
- public synchronized static CSSPreferenceHelper getInstance() {
- if (fInstance == null) {
- fInstance = new CSSPreferenceHelper();
- }
- return fInstance;
- }
-
- /**
- *
- */
- public String getBetweenValueString() {
- return getPreferences().getString(CSSCorePreferenceNames.FORMAT_BETWEEN_VALUE);
- }
-
- /**
- *
- */
- public String getIndentString() {
- StringBuffer indent = new StringBuffer();
-
- Preferences preferences = getPreferences();
- if (preferences != null) {
- char indentChar = ' ';
- String indentCharPref = preferences.getString(CSSCorePreferenceNames.INDENTATION_CHAR);
- if (CSSCorePreferenceNames.TAB.equals(indentCharPref)) {
- indentChar = '\t';
- }
- int indentationWidth = preferences.getInt(CSSCorePreferenceNames.INDENTATION_SIZE);
-
- for (int i = 0; i < indentationWidth; i++) {
- indent.append(indentChar);
- }
- }
- return indent.toString();
- }
-
- /**
- *
- */
- public int getMaxLineWidth() {
- Preferences prefs = getPreferences();
- return prefs.getInt(CSSCorePreferenceNames.LINE_WIDTH);
- }
-
- /**
- *
- */
- public String getQuoteString(ICSSModel model) {
- // nakamori_TODO css pref transition
- return getPreferences().getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- }
-
- /**
- *
- */
- public int getSpacesPostDelimiter() {
- return getPreferences().getInt(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM);
- }
-
- /**
- *
- */
- public int getSpacesPreDelimiter() {
- return getPreferences().getInt(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM);
- }
-
- /**
- *
- */
- public boolean isIdentUpperCase() {
- if (getPreferences().getInt(CSSCorePreferenceNames.CASE_IDENTIFIER) == CSSCorePreferenceNames.UPPER)
- return true;
- return false;
- }
-
- /**
- *
- */
- public boolean isNewLineOnOpenBrace() {
- return getPreferences().getBoolean(CSSCorePreferenceNames.WRAPPING_NEWLINE_ON_OPEN_BRACE);
- }
-
- /**
- *
- */
- public boolean isOnePropertyPerLine() {
- return getPreferences().getBoolean(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE);
- }
-
- /**
- *
- */
- public boolean isProhibitWrapOnAttr() {
- return getPreferences().getBoolean(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR);
- }
-
- /**
- *
- */
- public boolean isPropNameUpperCase() {
- if (getPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_NAME) == CSSCorePreferenceNames.UPPER)
- return true;
- return false;
- }
-
- /**
- *
- */
- public boolean isPropValueUpperCase() {
- if (getPreferences().getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- return true;
- return false;
- }
-
- /**
- *
- */
- public boolean isQuoteInURI() {
- return getPreferences().getBoolean(CSSCorePreferenceNames.FORMAT_QUOTE_IN_URI);
- }
-
- /**
- *
- */
- protected void setBetweenValueString(String newBetweenValueString) {
- getPreferences().setValue(CSSCorePreferenceNames.FORMAT_BETWEEN_VALUE, newBetweenValueString);
- }
-
- /**
- *
- */
- protected void setIdentUpperCase(boolean newIdentUpperCase) {
- int theCase = CSSCorePreferenceNames.LOWER;
- if (newIdentUpperCase)
- theCase = CSSCorePreferenceNames.UPPER;
- getPreferences().setValue(CSSCorePreferenceNames.CASE_IDENTIFIER, theCase);
- }
-
- /**
- *
- */
- protected void setOnePropertyPerLine(boolean newOnePropertyPerLine) {
- getPreferences().setValue(CSSCorePreferenceNames.WRAPPING_ONE_PER_LINE, newOnePropertyPerLine);
- }
-
- /**
- *
- */
- protected void setProhibitWrapOnAttr(boolean newProhibitWrapOnAttr) {
- getPreferences().setValue(CSSCorePreferenceNames.WRAPPING_PROHIBIT_WRAP_ON_ATTR, newProhibitWrapOnAttr);
- }
-
- /**
- *
- */
- protected void setPropNameUpperCase(boolean newPropNameUpperCase) {
- int theCase = CSSCorePreferenceNames.LOWER;
- if (newPropNameUpperCase)
- theCase = CSSCorePreferenceNames.UPPER;
- getPreferences().setValue(CSSCorePreferenceNames.CASE_PROPERTY_NAME, theCase);
- }
-
- /**
- *
- */
- protected void setPropValueUpperCase(boolean newPropValueUpperCase) {
- int theCase = CSSCorePreferenceNames.LOWER;
- if (newPropValueUpperCase)
- theCase = CSSCorePreferenceNames.UPPER;
- getPreferences().setValue(CSSCorePreferenceNames.CASE_PROPERTY_VALUE, theCase);
- }
-
- /**
- *
- */
- public void setQuoteString(String quote) {
- getPreferences().setValue(CSSCorePreferenceNames.FORMAT_QUOTE, quote);
- }
-
- /**
- *
- */
- public void setSpacesPostDelimiter(int num) {
- getPreferences().setValue(CSSCorePreferenceNames.FORMAT_PROP_POST_DELIM, num);
- }
-
- /**
- *
- */
- public void setSpacesPreDelimiter(int num) {
- getPreferences().setValue(CSSCorePreferenceNames.FORMAT_PROP_PRE_DELIM, num);
- }
-
- private Preferences getPreferences() {
- CSSCorePlugin cssModelPlugin = CSSCorePlugin.getDefault();
- return cssModelPlugin.getPluginPreferences();
- }
-
- private CSSPreferenceHelper() {
- super();
- }
-
- private static CSSPreferenceHelper fInstance = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
deleted file mode 100644
index 54fcf463fd..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/provisional/text/ICSSPartitionTypes.java
+++ /dev/null
@@ -1,25 +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.css.core.internal.provisional.text;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitionTypes;
-
-/**
- * This interface is not intended to be implemented. It defines the
- * partitioning for CSS and all its partitions. Clients should reference the
- * partition type Strings defined here directly.
- *
- * @deprecated org.eclipse.wst.css.core.text.ICSSPartitions
- */
-public interface ICSSPartitionTypes extends IStructuredPartitionTypes {
-
- String STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java
deleted file mode 100644
index db9bfc601d..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/tasks/CSSFileTaskScanner.java
+++ /dev/null
@@ -1,36 +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.css.core.internal.tasks;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-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.tasks.StructuredFileTaskScanner;
-
-public class CSSFileTaskScanner extends StructuredFileTaskScanner {
- public CSSFileTaskScanner() {
- super();
- }
-
- protected String getCommentedText(IDocument document, int begin, int length) throws BadLocationException {
- String text = super.getCommentedText(document, begin, length);
- if (text != null && text.endsWith("*/")) { //$NON-NLS-1$
- text = text.substring(0, text.length() - 2);
- }
- return text;
- }
-
- protected boolean isCommentRegion(IStructuredDocumentRegion region, ITextRegion textRegion) {
- return textRegion.getType().equals(CSSRegionContexts.CSS_COMMENT);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java
deleted file mode 100644
index d4a42371d0..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentReParser.java
+++ /dev/null
@@ -1,360 +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.css.core.internal.text;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.util.CSSUtil;
-import org.eclipse.wst.css.core.internal.util.RegionIterator;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextReParser;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser;
-
-
-/**
- * This class provides a centralized place to put "reparsing" logic. This is
- * the logic that reparses the text incrementally, as a user types in new
- * characters, or DOM nodes are inserted or deleted. Note: it is not a thread
- * safe class.
- */
-public class CSSStructuredDocumentReParser extends StructuredDocumentReParser {
-
- class ReparseRange {
- ReparseRange() {
- reset();
- }
-
- ReparseRange(int start, int end) {
- fRangeStart = start;
- fRangeEnd = end;
- }
-
- void setStart(int start) {
- fRangeStart = start;
- }
-
- void setEnd(int end) {
- fRangeEnd = end;
- }
-
- int getStart() {
- return fRangeStart;
- }
-
- int getEnd() {
- return fRangeEnd;
- }
-
- boolean isValid() {
- return (0 < fRangeEnd - fRangeStart) ? true : false;
- }
-
- void reset() {
- fRangeStart = Integer.MAX_VALUE;
- fRangeEnd = 0;
- }
-
- void expand(ReparseRange range) {
- if (range == null || !range.isValid()) {
- return;
- }
- int start = range.getStart();
- if (start < fRangeStart) {
- fRangeStart = start;
- }
- int end = range.getEnd();
- if (fRangeEnd < end) {
- fRangeEnd = end;
- }
- }
-
- private int fRangeStart;
- private int fRangeEnd;
- }
-
- /**
- *
- */
- public CSSStructuredDocumentReParser() {
- super();
- }
-
- /**
- *
- */
- // public StructuredDocumentEvent
- // checkForCrossStructuredDocumentRegionBoundryCases2() {
- // StructuredDocumentEvent result = specialPositionUpdate(fStart, fStart +
- // fLengthToReplace - 1);
- // if (result == null) {
- // result = checkInsideBrace();
- // }
- // return result;
- // }
- protected StructuredDocumentEvent checkForCrossStructuredDocumentRegionSyntax() {
- int checkStart = fStart;
- int checkEnd = fStart + fLengthToReplace - 1;
- IStructuredDocumentRegion endRegion = fStructuredDocument.getRegionAtCharacterOffset(checkEnd);
- if (endRegion != null) {
- checkEnd = endRegion.getEndOffset();
- }
-
- ReparseRange range = new ReparseRange(checkStart, checkEnd);
-
- range.expand(getUpdateRangeForDelimiter(range.getStart(), range.getEnd()));
- range.expand(getUpdateRangeForUnknownRegion(range.getStart(), range.getEnd()));
-
- range.expand(getUpdateRangeForQuotes(range.getStart(), range.getEnd()));
- range.expand(getUpdateRangeForComments(range.getStart(), range.getEnd()));
- range.expand(getUpdateRangeForBraces(range.getStart(), range.getEnd()));
-
- StructuredDocumentEvent result;
-
- result = checkInsideBrace(range.getStart(), range.getEnd());
-
- if (result == null) {
- result = reparse(range.getStart(), range.getEnd());
- }
-
- return result;
- }
-
- private ReparseRange getUpdateRangeForUnknownRegion(int start, int end) {
- int newStart = start;
- RegionIterator iterator = new RegionIterator(fStructuredDocument, start - 1);
- if (iterator.hasPrev()) {
- iterator.prev(); // skip myself
- }
- while (iterator.hasPrev()) {
- ITextRegion region = iterator.prev();
- if (region != null && region.getType() == CSSRegionContexts.CSS_UNKNOWN) {
- newStart = iterator.getStructuredDocumentRegion().getStartOffset(region);
- }
- else {
- break;
- }
- }
-
- if (start != newStart) {
- return new ReparseRange(newStart, end);
- }
-
- return null;
- }
-
- private ReparseRange getUpdateRangeForDelimiter(int start, int end) {
- if (dirtyStart != null && dirtyStart.getStart() < start) {
- start = dirtyStart.getStart();
- }
- IStructuredDocumentRegion docRegion = fStructuredDocument.getRegionAtCharacterOffset(start);
- if (docRegion == null) {
- return null;
- }
- if (docRegion.getType() == CSSRegionContexts.CSS_DELIMITER) {
- IStructuredDocumentRegion prevRegion = docRegion.getPrevious();
- if (prevRegion != null) {
- return new ReparseRange(prevRegion.getStart(), end);
- }
- }
-
- return null;
- }
-
- private ReparseRange getUpdateRangeForQuotes(int start, int end) {
- ReparseRange range = new ReparseRange();
-
- range.expand(getUpdateRangeForPair(start, end, "\"", "\"")); //$NON-NLS-2$//$NON-NLS-1$
- range.expand(getUpdateRangeForPair(start, end, "\'", "\'")); //$NON-NLS-2$//$NON-NLS-1$
-
- return (range.isValid()) ? range : null;
- }
-
- private ReparseRange getUpdateRangeForComments(int start, int end) {
- ReparseRange range = new ReparseRange();
-
- range.expand(getUpdateRangeForPair(start, end, "/*", "*/")); //$NON-NLS-2$//$NON-NLS-1$
- range.expand(getUpdateRangeForPair(start, end, "<%", "%>")); //$NON-NLS-2$//$NON-NLS-1$
-
- return (range.isValid()) ? range : null;
- }
-
- private ReparseRange getUpdateRangeForBraces(int start, int end) {
- ReparseRange range = new ReparseRange();
-
- range.expand(getUpdateRangeForPair(start, end, "[", "]")); //$NON-NLS-2$//$NON-NLS-1$
- range.expand(getUpdateRangeForPair(start, end, "(", ")")); //$NON-NLS-2$//$NON-NLS-1$
- range.expand(getUpdateRangeForPair(start, end, "{", "}")); //$NON-NLS-2$//$NON-NLS-1$
-
- return (range.isValid()) ? range : null;
- }
-
- private StructuredDocumentEvent checkInsideBrace(int start, int end) {
- StructuredDocumentEvent result = null;
- IStructuredDocumentRegion region = fStructuredDocument.getRegionAtCharacterOffset(start);
- if (region == null) {
- return null;
- }
- boolean bDeclaration = false;
- String type = region.getType();
- if (CSSRegionUtil.isDeclarationType(type) || type == CSSRegionContexts.CSS_LBRACE || type == CSSRegionContexts.CSS_RBRACE) {
- bDeclaration = true;
- }
- if (!bDeclaration) {
- IStructuredDocumentRegion prevRegion = CSSUtil.findPreviousSignificantNode(region);
- if (prevRegion != null) {
- type = prevRegion.getType();
- if (CSSRegionUtil.isDeclarationType(type) || type == CSSRegionContexts.CSS_LBRACE) {
- bDeclaration = true;
- }
- }
- }
- if (!bDeclaration) {
- IStructuredDocumentRegion nextRegion = CSSUtil.findNextSignificantNode(region);
- if (nextRegion != null) {
- type = nextRegion.getType();
- if (CSSRegionUtil.isDeclarationType(type) || type == CSSRegionContexts.CSS_RBRACE) {
- bDeclaration = true;
- }
- }
- }
-
- if (bDeclaration) {
- IStructuredDocumentRegion startRegion = findRuleStart(region);
- if (startRegion != null) {
- IStructuredDocumentRegion endRegion = fStructuredDocument.getRegionAtCharacterOffset(end);
- if (endRegion != null) {
- result = reparse(startRegion, endRegion);
- }
- }
- }
- return result;
- }
-
- private IStructuredDocumentRegion findRuleStart(IStructuredDocumentRegion startRegion) {
- IStructuredDocumentRegion region = startRegion;
- // find '{'
- while (region != null && region.getType() != CSSRegionContexts.CSS_LBRACE) {
- region = region.getPrevious();
- }
- // if (region == startRegion) {
- // return null;
- // }
- // else
- if (region != null) { // '{' is found
- region = region.getPrevious();
- if (isLeadingDeclarationType(region.getType())) {
- return region;
- }
- }
- return null;
- }
-
- private boolean isLeadingDeclarationType(String type) {
- return (type == CSSRegionContexts.CSS_PAGE || type == CSSRegionContexts.CSS_FONT_FACE || CSSRegionUtil.isSelectorType(type));
- }
-
- // public StructuredDocumentEvent
- // checkForCrossStructuredDocumentRegionBoundryCases() {
- // return specialPositionUpdate(fStart, fStart + fLengthToReplace - 1);
- // }
- /**
- *
- */
- private ReparseRange getUpdateRangeForPair(int start, int end, String opener, String closer) {
- StringBuffer deletionBuf = new StringBuffer();
- StringBuffer insertionBuf = new StringBuffer();
- int quoteLen = Math.max(opener.length(), closer.length());
- if (1 < quoteLen) {
- /**
- * ex) opener = "ABC", closer = "XYZ" model: ABCDEF.......UVWXYZ
- * deletion: CDEF.......UVWX pre/post: AB / YZ
- */
- int addStart = start - (quoteLen - 1);
- if (0 <= addStart) {
- String addStr = fStructuredDocument.get(addStart, quoteLen - 1);
- deletionBuf.append(addStr);
- insertionBuf.append(addStr);
- }
- deletionBuf.append(fDeletedText);
- insertionBuf.append(fChanges);
- if (end + (quoteLen - 1) < fStructuredDocument.getLength()) {
- String addStr = fStructuredDocument.get(end + 1, quoteLen - 1);
- deletionBuf.append(addStr);
- insertionBuf.append(addStr);
- }
- }
- else {
- deletionBuf.append(fDeletedText);
- insertionBuf.append(fChanges);
- }
- String deletion = deletionBuf.toString();
- String insertion = insertionBuf.toString();
-
- int rangeStart = start;
- int rangeEnd = end;
-
- if (0 <= deletion.indexOf(opener) || 0 <= deletion.indexOf(closer) || 0 <= insertion.indexOf(opener) || 0 <= insertion.indexOf(closer)) {
- int s, e;
- try {
- if (start <= fStructuredDocument.getLength()) {
- IRegion startRegion = getFindReplaceDocumentAdapter().find(start - 1, opener, false, false, false, false);
- if (startRegion != null) {
- s = startRegion.getOffset();
- }
- else {
- s = -1;
- }
- }
- else {
- s = -1;
- }
- if (end < fStructuredDocument.getLength() - 1) {
- IRegion endRegion = getFindReplaceDocumentAdapter().find(end + 1, closer, true, false, false, false);
- if (endRegion != null) {
- e = endRegion.getOffset();
- }
- else {
- e = -1;
- }
- }
- else {
- e = -1;
- }
- }
- catch (BadLocationException ex) {
- Logger.logException(ex);
- return null;
- }
- if (0 <= s) {
- rangeStart = Math.min(rangeStart, s);
- }
- if (0 <= e) {
- rangeEnd = Math.max(rangeEnd, e);
- }
- }
-
- if (rangeStart < start || end < rangeEnd) {
- return new ReparseRange(rangeStart, rangeEnd);
- }
- else {
- return null;
- }
- }
-
- public IStructuredTextReParser newInstance() {
- return new CSSStructuredDocumentReParser();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java
deleted file mode 100644
index 6dc83a1d5c..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/CSSStructuredDocumentRegionFactory.java
+++ /dev/null
@@ -1,39 +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.css.core.internal.text;
-
-
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocumentRegion;
-
-/**
- *
- */
-public class CSSStructuredDocumentRegionFactory {
-
- public static final int CSS_GENERIC = 101109;
-
- /**
- *
- */
- public static IStructuredDocumentRegion createStructuredDocumentRegion(int type) {
- IStructuredDocumentRegion instance = null;
- switch (type) {
- case CSS_GENERIC :
- instance = new BasicStructuredDocumentRegion();
- break;
- default :
- break;
- }
- return instance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
deleted file mode 100644
index 10d8142443..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredDocumentWalker.java
+++ /dev/null
@@ -1,169 +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.css.core.internal.text;
-
-
-
-import java.util.Enumeration;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-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.sse.core.internal.util.Utilities;
-
-public class StructuredDocumentWalker {
-
- IStructuredDocumentRegionList fOldStructuredDocumentRegionList = null;
- IStructuredDocument fStructuredDocument = null;
- String fOriginalChanges = null;
- int fOriginalOffset = 0;
- int fOriginalLengthToReplace = 0;
- int fLengthDifference = 0;
-
- /**
- *
- */
- public StructuredDocumentWalker() {
- }
-
- /**
- *
- */
- public StructuredDocumentWalker(StructuredDocumentEvent event) {
- initialize(event);
- }
-
- /**
- *
- */
- public IStructuredDocument getStructuredDocument() {
- return fStructuredDocument;
- }
-
- /**
- * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
- * ---[C1]-----[C2]-----[C3]-----[C4]---
- *
- * Input: O1 -> Output: O2 Input: O2 -> Output: O3 Input: O3 -> Output: C4
- * Input: Cn -> Output: Cn+1
- */
- public IStructuredDocumentRegion getNextNode(IStructuredDocumentRegion node) {
- IStructuredDocumentRegion nextNode = null;
- if (node != null) {
- nextNode = node.getNext();
- if (nextNode == null) {
- if (isOldNode(node)) {
- // this may be the end of old flatnodes
- int newStart = node.getEnd() - fLengthDifference;
- nextNode = fStructuredDocument.getRegionAtCharacterOffset(newStart);
- }
- }
- }
- return nextNode;
- }
-
- /**
- * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
- * ---[C1]-----[C2]-----[C3]-----[C4]---
- *
- * Input: O* -> Output: C4 Input: Cn -> Output: Cn+1
- */
- public IStructuredDocumentRegion getNextNodeInCurrent(IStructuredDocumentRegion node) {
- IStructuredDocumentRegion nextNode = null;
- if (isOldNode(node)) {
- IStructuredDocumentRegion oldEndNode = fOldStructuredDocumentRegionList.item(fOldStructuredDocumentRegionList.getLength() - 1);
- int newStart = oldEndNode.getEnd() - fLengthDifference;
- nextNode = fStructuredDocument.getRegionAtCharacterOffset(newStart);
- }
- else if (node != null) {
- nextNode = node.getNext();
- }
- return nextNode;
- }
-
- /**
- * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
- * ---[C1]-----[C2]-----[C3]-----[C4]---
- *
- * Input: O1 -> Output: C1 Input: O2 -> Output: O1 Input: O3 -> Output: O2
- * Input: Cn -> Output: Cn-1
- */
- public IStructuredDocumentRegion getPrevNode(IStructuredDocumentRegion node) {
- IStructuredDocumentRegion prevNode = null;
- if (node != null) {
- prevNode = node.getPrevious();
- if (prevNode == null) {
- if (isOldNode(node)) {
- // this may be the start of old flatnodes
- int newEnd = node.getStart() - 1;
- prevNode = fStructuredDocument.getRegionAtCharacterOffset(newEnd);
- }
- }
- }
- return prevNode;
- }
-
- /**
- * Old Nodes: --[O1]--[O2]--[O3]--- : / \ Current Nodes:
- * ---[C1]-----[C2]-----[C3]-----[C4]---
- *
- * Input: O* -> Output: C1 Input: Cn -> Output: Cn-1
- */
- public IStructuredDocumentRegion getPrevNodeInCurrent(IStructuredDocumentRegion node) {
- IStructuredDocumentRegion prevNode = null;
- if (isOldNode(node)) {
- IStructuredDocumentRegion oldStartNode = fOldStructuredDocumentRegionList.item(0);
- int newEnd = oldStartNode.getStart() - 1;
- prevNode = fStructuredDocument.getRegionAtCharacterOffset(newEnd);
- }
- else if (node != null) {
- prevNode = node.getPrevious();
- }
- return prevNode;
- }
-
- /**
- *
- */
- public void initialize(StructuredDocumentEvent event) {
- fStructuredDocument = event.getStructuredDocument();
- fOriginalChanges = event.getText();
- fOriginalOffset = event.getOffset();
- fOriginalLengthToReplace = event.getLength();
- fLengthDifference = Utilities.calculateLengthDifference(fOriginalChanges, fOriginalLengthToReplace);
-
- if (event instanceof StructuredDocumentRegionsReplacedEvent) {
- fOldStructuredDocumentRegionList = ((StructuredDocumentRegionsReplacedEvent) event).getOldStructuredDocumentRegions();
- }
- else {
- fOldStructuredDocumentRegionList = null;
- }
- }
-
- /**
- *
- */
- public boolean isOldNode(IStructuredDocumentRegion node) {
- boolean bOld = false;
- if (fOldStructuredDocumentRegionList != null) {
- Enumeration e = fOldStructuredDocumentRegionList.elements();
- while (e.hasMoreElements()) {
- if (e.nextElement() == node) {
- bOld = true;
- break;
- }
- }
- }
- return bOld;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
deleted file mode 100644
index 98d53c15d4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
+++ /dev/null
@@ -1,37 +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.css.core.internal.text;
-
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.wst.css.core.text.ICSSPartitions;
-import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
-
-public class StructuredTextPartitionerForCSS extends StructuredTextPartitioner {
-
- public final static String[] legalTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION};
-
- public StructuredTextPartitionerForCSS() {
- super();
- }
-
- public String getDefaultPartitionType() {
- return ICSSPartitions.STYLE;
- }
-
- public String[] getLegalContentTypes() {
- return legalTypes;
- }
-
- public IDocumentPartitioner newInstance() {
- return new StructuredTextPartitionerForCSS();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java
deleted file mode 100644
index c611b586a2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/AbstractCssTraverser.java
+++ /dev/null
@@ -1,181 +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.css.core.internal.util;
-
-import java.util.ArrayList;
-import java.util.Stack;
-import java.util.Vector;
-
-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.provisional.document.ICSSStyleSheet;
-
-
-
-/**
- *
- */
-public abstract class AbstractCssTraverser {
-
- public static short TRAV_CONT = 0;
- public static short TRAV_PRUNE = 1;
- public static short TRAV_STOP = 2;
- protected java.util.Stack travStack;
- private boolean fTraverseImported = false;
- private boolean fTraverseImportFirst = false;
- private java.util.Vector traversedSheets;
-
- /**
- * CssPropCMNode constructor comment.
- */
- public AbstractCssTraverser() {
- super();
- }
-
- /**
- * @param model
- * org.eclipse.wst.css.core.model.interfaces.ICSSModel
- */
- public final void apply(ICSSModel model) {
- apply(model.getDocument());
- }
-
- public final void apply(ICSSNode root) {
- travStack = new Stack();
- if (fTraverseImported) {
- traversedSheets = new Vector();
- if (root != null && root.getOwnerDocument() != null && root.getOwnerDocument().getNodeType() == ICSSNode.STYLESHEET_NODE) {
- traversedSheets.add(root.getOwnerDocument());
- }
- }
-
- // first call begin()
- begin(root);
-
- // traverse
- traverse(root);
-
- // last call end()
- end(root);
- }
-
-
- protected void begin(ICSSNode node) {
- }
-
-
- protected void end(ICSSNode node) {
- }
-
- /**
- * @return boolean
- */
- public final boolean isTraverseImported() {
- return fTraverseImported;
- }
-
-
- protected short postNode(ICSSNode node) {
- return (short) 0;
- }
-
-
- protected short preNode(ICSSNode node) {
- return (short) 0;
- }
-
- /**
- * @param newTraverseImported
- * boolean
- */
- public final void setTraverseImported(boolean newTraverseImported) {
- fTraverseImported = newTraverseImported;
- }
-
- /**
- * @param newTraverseImportFirst
- * boolean
- */
- public final void setTraverseImportFirst(boolean newTraverseImportFirst) {
- fTraverseImportFirst = newTraverseImportFirst;
- }
-
-
- private final short traverse(ICSSNode node) {
- if (node == null)
- return TRAV_CONT;
-
- travStack.push(node);
-
- // pre-action
- short ret = preNode(node);
-
- if (ret == TRAV_CONT) {
- if (fTraverseImported && (node.getNodeType() == ICSSNode.IMPORTRULE_NODE)) {
- ICSSImportRule rule = (ICSSImportRule) node;
- // traverse external style-sheet
- ICSSStyleSheet sheet = (ICSSStyleSheet) rule.getStyleSheet();
- if (sheet != null && !traversedSheets.contains(sheet)) { // prevent
- // loop
- traversedSheets.add(sheet);
- short retExt = traverse(sheet);
- if (retExt == TRAV_STOP) {
- travStack.pop();
- return retExt;
- }
- }
- }
-
- // collect children
- ArrayList children = new ArrayList();
- ICSSNode child = node.getFirstChild();
- if (fTraverseImportFirst) {
- ArrayList others = new ArrayList();
-
- while (child != null) {
- if (child.getNodeType() == ICSSNode.IMPORTRULE_NODE)
- children.add(child);
- else
- others.add(child);
- child = child.getNextSibling();
- }
- children.addAll(others);
- }
- else {
- while (child != null) {
- children.add(child);
- child = child.getNextSibling();
- }
- }
-
- // traverse children
- for (int i = 0; i < children.size(); i++) {
- child = (ICSSNode) children.get(i);
- short retChild = traverse(child);
- if (retChild == TRAV_STOP) {
- travStack.pop();
- return retChild;
- }
- }
- }
- else if (ret == TRAV_STOP) {
- travStack.pop();
- return ret;
- }
-
- // post-action
- ret = postNode(node);
-
- travStack.pop();
- return (ret == TRAV_PRUNE) ? TRAV_CONT : ret;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java
deleted file mode 100644
index 87a353d8b3..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSClassTraverser.java
+++ /dev/null
@@ -1,114 +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.css.core.internal.util;
-
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSMediaRule;
-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.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-
-
-/**
- *
- */
-public class CSSClassTraverser extends AbstractCssTraverser {
-
- ArrayList fClassNames;
-
- /**
- *
- */
- public CSSClassTraverser() {
- super();
- }
-
- /**
- *
- */
- private void addClassNames(ICSSStyleRule rule) {
- ICSSSelectorList selectorList = rule.getSelectors();
- Iterator iSelector = selectorList.getIterator();
- while (iSelector.hasNext()) {
- ICSSSelector selector = (ICSSSelector) iSelector.next();
- Iterator iItem = selector.getIterator();
- while (iItem.hasNext()) {
- ICSSSelectorItem item = (ICSSSelectorItem) iItem.next();
- if (item.getItemType() == ICSSSelectorItem.SIMPLE) {
- ICSSSimpleSelector sel = (ICSSSimpleSelector) item;
- int nClasses = sel.getNumOfClasses();
- for (int iClass = 0; iClass < nClasses; iClass++) {
- String className = sel.getClass(iClass);
- if (!fClassNames.contains(className))
- fClassNames.add(className);
- }
- }
- }
- }
- }
-
- /**
- *
- */
- protected void begin(ICSSNode node) {
- if (fClassNames == null)
- fClassNames = new ArrayList();
- }
-
- /**
- *
- */
- protected void end(ICSSNode node) {
- }
-
- /**
- *
- */
- public Collection getClassNames() {
- return (fClassNames != null) ? fClassNames : Collections.EMPTY_LIST;
- }
-
- /**
- *
- */
- protected short postNode(ICSSNode node) {
- return TRAV_CONT;
- }
-
- /**
- *
- */
- protected short preNode(ICSSNode node) {
- short ret;
- if (node instanceof ICSSStyleRule) {
- addClassNames((ICSSStyleRule) node);
- ret = TRAV_PRUNE;
- }
- else if (node instanceof ICSSStyleSheet || node instanceof ICSSMediaRule || node instanceof ICSSImportRule) {
- ret = TRAV_CONT;
- }
- else {
- ret = TRAV_PRUNE;
- }
- return ret;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java
deleted file mode 100644
index 377dcd38cc..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSLinkConverter.java
+++ /dev/null
@@ -1,188 +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.css.core.internal.util;
-
-
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.css.core.internal.CSSCorePlugin;
-import org.eclipse.wst.css.core.internal.preferences.CSSCorePreferenceNames;
-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.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- *
- */
-public class CSSLinkConverter extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
- private static final String URL_BEGIN = "url("; //$NON-NLS-1$
- private static final String URL_END = ")"; //$NON-NLS-1$
- private static final String EMPTY = ""; //$NON-NLS-1$
- private static final String D_QUOTE = "\""; //$NON-NLS-1$
- private static final String S_QUOTE = "\'"; //$NON-NLS-1$
-
- IStructuredModel baseModel;
-
- /**
- *
- */
- public CSSLinkConverter(IStructuredModel model) {
- super();
- baseModel = model;
- if (model instanceof ICSSModel && ((ICSSModel) model).getStyleSheetType() != ICSSModel.EXTERNAL) {
- IDOMNode node = (IDOMNode) ((ICSSModel) model).getOwnerDOMNode();
- baseModel = node.getModel();
- }
- }
-
- /**
- *
- */
- public static String addFunc(String value) {
- if (!value.trim().toLowerCase().startsWith(URL_BEGIN)) {
- // pa_TODO css pref
- Preferences preferences = CSSCorePlugin.getDefault().getPluginPreferences();
-
- String quote = preferences.getString(CSSCorePreferenceNames.FORMAT_QUOTE);
- value = CSSUtil.stripQuotes(value);
- quote = CSSUtil.detectQuote(value, quote);
- String str = URL_BEGIN;
- if (preferences.getInt(CSSCorePreferenceNames.CASE_PROPERTY_VALUE) == CSSCorePreferenceNames.UPPER)
- str = str.toUpperCase();
- StringBuffer buf = new StringBuffer(str);
- buf.append(quote);
- buf.append(value);
- buf.append(quote);
- buf.append(URL_END);
- return buf.toString();
- }
- return value;
- }
-
-
-
- /**
- *
- */
- protected void begin(ICSSNode node) {
- if (baseModel == null) {
- baseModel = node.getOwnerDocument().getModel();
- if (baseModel instanceof ICSSModel && ((ICSSModel) baseModel).getStyleSheetType() != ICSSModel.EXTERNAL) {
- IDOMNode xmlNode = (IDOMNode) ((ICSSModel) baseModel).getOwnerDOMNode();
- baseModel = xmlNode.getModel();
- }
- }
- }
-
- /**
- *
- */
- private static boolean isUrl(String source) {
- if (source == null)
- return false;
- source = source.trim().toLowerCase();
- return source.startsWith(URL_BEGIN);
- }
-
- /**
- *
- */
- protected short preNode(ICSSNode node) {
- if (node.getNodeType() == ICSSNode.PRIMITIVEVALUE_NODE) {
- toAbsolute((CSSValue) node);
- } else if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE) {
- ICSSImportRule iRule = (ICSSImportRule) node;
- iRule.setHref(toAbsolute(addFunc(iRule.getHref())));
- }
- return TRAV_CONT;
- }
-
- /**
- *
- * @return java.lang.String
- * @param value
- * java.lang.String
- */
- public static String removeFunc(String value) {
- if (value == null)
- return EMPTY;
- String field = value.trim();
- // first : tear "url(....)"
- if (field.toLowerCase().startsWith(URL_BEGIN)) {
- int url = field.toLowerCase().indexOf(URL_BEGIN);
- int endParenthesis = field.lastIndexOf(URL_END);
- if (endParenthesis > url) {
- field = field.substring(url + 4, endParenthesis);
- } else
- field = field.substring(url + 4);
- }
- return field.trim();
- }
-
- /**
- *
- */
- public static String stripFunc(String value) {
- if (value == null)
- return EMPTY;
- // first : tear "url(....)"
- String field = removeFunc(value);
- // second : tear quotations
- if (field.toLowerCase().startsWith(D_QUOTE)) {
- int quote = field.indexOf(D_QUOTE);
- int end = field.lastIndexOf(D_QUOTE);
- if (end > quote) {
- field = field.substring(quote + 1, end);
- } else
- field = field.substring(quote + 1);
- } else if (field.toLowerCase().startsWith(S_QUOTE)) {
- int quote = field.indexOf(S_QUOTE);
- int end = field.lastIndexOf(S_QUOTE);
- if (end > quote) {
- field = field.substring(quote + 1, end);
- } else
- field = field.substring(quote + 1);
- }
-
- return field.trim();
- }
-
- /**
- *
- */
- public String toAbsolute(String source) {
- if (isUrl(source)) {
- String url = CSSPathService.getAbsoluteURL(baseModel, stripFunc(source));
- return (url != null) ? addFunc(url) : (URL_BEGIN + URL_END);
- }
- return source;
- }
-
- /**
- *
- */
- public boolean toAbsolute(CSSValue node) {
- if (node instanceof ICSSPrimitiveValue) {
- ICSSPrimitiveValue value = (ICSSPrimitiveValue) node;
- if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) {
- value.setValue(stripFunc(toAbsolute(URL_BEGIN + value.getStringValue() + URL_END)));
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java
deleted file mode 100644
index 8532819e04..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSPathService.java
+++ /dev/null
@@ -1,77 +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.css.core.internal.util;
-
-
-
-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.sse.core.internal.provisional.IStructuredModel;
-
-/**
- *
- */
-public class CSSPathService {
-
- // Constants
- private static final String FILEURLSCHEME = "file";//$NON-NLS-1$
- private static final String URLCOLON = ":"; //$NON-NLS-1$
- private static final String FILEURLPREFIX = FILEURLSCHEME + URLCOLON + "//";//$NON-NLS-1$
- private static final String URLSEPARATOR = "/"; //$NON-NLS-1$
-
- /**
- * @return java.lang.String
- */
- public static String getAbsoluteURL(IStructuredModel baseModel, String ref) {
- String absLink = URLModelProviderCSS.resolveURI(baseModel, ref, true);
- String url = absLink;
- if (absLink != null) { // if it has not scheme, we must add "file"
- // scheme
- try {
- new java.net.URL(absLink);
- }
- catch (java.net.MalformedURLException e) {
- IPath path = new Path(absLink);
- if (path != null)
- url = toURL(path);
- }
- }
- return url;
- }
-
- /**
- *
- * @return org.eclipse.core.resources.IFile
- * @param location
- * java.lang.String
- */
- public static IFile location2File(String location) {
- Path path = new Path(location);
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- if (file == null && path.segmentCount() > 1)
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- return file;
- }
-
- /**
- * Gets a file URL for the path.
- */
- private static String toURL(IPath path) {
- path = new Path(path.toFile().getAbsolutePath());
- if (path.isUNC() == true) {
- // it's UNC. return file://host/foo/bar/baz.html
- return FILEURLSCHEME + URLCOLON + path.toString();
- }
- return FILEURLPREFIX + URLSEPARATOR + path.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java
deleted file mode 100644
index 82c7b81431..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSSelectorListFactory.java
+++ /dev/null
@@ -1,35 +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.css.core.internal.util;
-
-import org.eclipse.wst.css.core.internal.document.CSSSelectorListImpl;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-
-
-public class CSSSelectorListFactory {
- static synchronized public CSSSelectorListFactory getInstance() {
- if (fInstance == null) {
- fInstance = new CSSSelectorListFactory();
- }
- return fInstance;
- }
-
- public ICSSSelectorList createSelectorList(String selectorString) {
- return new CSSSelectorListImpl(selectorString);
- }
-
-
- private CSSSelectorListFactory() {
- super();
- }
-
- private static CSSSelectorListFactory fInstance;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java
deleted file mode 100644
index ab98a09c37..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSStyleDeclarationFactory.java
+++ /dev/null
@@ -1,61 +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.css.core.internal.util;
-
-
-
-import org.eclipse.wst.css.core.internal.document.CSSStyleDeclarationFactoryContext;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-
-
-/**
- *
- */
-public class CSSStyleDeclarationFactory extends CSSStyleDeclarationFactoryContext {
-
- private static CSSStyleDeclarationFactory fInstance = null;
-
- /**
- * CSSStyleDeclarationFactory constructor comment.
- */
- private CSSStyleDeclarationFactory() {
- super();
- }
-
- /**
- * @return org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
- * @param decl
- * org.eclipse.wst.css.core.model.interfaces.ICSSStyleDeclaration
- */
- public ICSSStyleDeclaration createStyleDeclaration(ICSSStyleDeclaration decl) {
- if (decl == null) {
- return null;
- }
- ICSSStyleDeclaration newNode = createStyleDeclaration();
-
- if (newNode == null) {
- return null;
- }
- fOwnerDocument = newNode;
- cloneChildNodes(decl, newNode);
- return newNode;
- }
-
- /**
- *
- */
- public synchronized static CSSStyleDeclarationFactory getInstance() {
- if (fInstance == null) {
- fInstance = new CSSStyleDeclarationFactory();
- }
- return fInstance;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java
deleted file mode 100644
index 237c1b9c74..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/CSSUtil.java
+++ /dev/null
@@ -1,335 +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.css.core.internal.util;
-
-
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.Logger;
-import org.eclipse.wst.css.core.internal.parser.CSSRegionUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-
-
-public class CSSUtil {
-
- /**
- *
- */
- public static void debugOut(String str) {
- Logger.log(Logger.WARNING, "css warning: " + str); //$NON-NLS-1$
- }
-
- /**
- *
- */
- // public static Vector extractMediaContents(Vector regions) {
- // Vector media = new Vector();
- // if (regions == null) { return media; }
- //
- // boolean bReady = true;
- // for (Iterator i = regions.iterator(); i.hasNext(); ) {
- // ITextRegion region = (ITextRegion)i.next();
- // if (region == null) { continue; }
- // String type = region.getType();
- // if (bReady) {
- // if (type == IDENT) {
- // media.addElement(region.getText());
- // bReady = false;
- // }
- // } else {
- // if (type == COMMA) {
- // bReady = true;
- // }
- // }
- // }
- //
- // return media;
- // }
- /**
- *
- */
- public static String extractStringContents(String text) {
- return stripQuotes(text);
- }
-
- /**
- *
- */
- public static String extractUriContents(String text) {
- String contents = text.trim();
- if (contents.toLowerCase().startsWith("url(") && //$NON-NLS-1$
- contents.toLowerCase().endsWith(")")) {//$NON-NLS-1$
- // strip "url(", ")"
- contents = contents.substring(4, contents.length() - 1);
- }
- contents = stripQuotes(contents);
-
- return contents;
- }
-
- /**
- *
- */
- public static IStructuredDocumentRegion findNextSignificantNode(IStructuredDocumentRegion startNode) {
- if (startNode == null) {
- return null;
- }
- IStructuredDocumentRegion node = startNode.getNext();
- while (node != null) {
- String type = getStructuredDocumentRegionType(node);
- if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
- return node;
- }
- node = node.getNext();
- }
- return null;
- }
-
- /**
- *
- */
- public static IStructuredDocumentRegion findNodeBackward(IStructuredDocumentRegion startNode, IStructuredDocumentRegion endNode, String type) {
- IStructuredDocumentRegion node;
- for (node = startNode; node != null; node = node.getPrevious()) {
- if (node.getStartOffset() < endNode.getStartOffset()) {
- node = null;
- break;
- }
- else if (getStructuredDocumentRegionType(node) == type) {
- break;
- }
- }
- return node;
- }
-
- /**
- *
- */
- public static IStructuredDocumentRegion findNodeForward(IStructuredDocumentRegion startNode, IStructuredDocumentRegion endNode, String type) {
- IStructuredDocumentRegion node;
- for (node = startNode; node != null; node = node.getNext()) {
- if (endNode.getStartOffset() < node.getStartOffset()) {
- node = null;
- break;
- }
- else if (getStructuredDocumentRegionType(node) == type) {
- break;
- }
- }
- return node;
- }
-
- /**
- *
- */
- public static IStructuredDocumentRegion findPreviousSignificantNode(IStructuredDocumentRegion startNode) {
- if (startNode == null) {
- return null;
- }
- IStructuredDocumentRegion node = startNode.getPrevious();
- while (node != null) {
- String type = getStructuredDocumentRegionType(node);
- if (type != CSSRegionContexts.CSS_S && type != CSSRegionContexts.CSS_COMMENT && type != CSSRegionContexts.CSS_CDO && type != CSSRegionContexts.CSS_CDC) {
- return node;
- }
- node = node.getPrevious();
- }
- return null;
- }
-
- /**
- *
- */
- public static String getClassString(Object object) {
- if (object == null) {
- return "null"; //$NON-NLS-1$
- }
- else {
- String name = object.getClass().toString();
- int lastPeriod = name.lastIndexOf('.');
- return name.substring(lastPeriod + 1);
- }
- }
-
- /**
- *
- */
- public static String getStructuredDocumentRegionType(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return CSSRegionContexts.CSS_UNDEFINED;
- }
- ITextRegionList regions = flatNode.getRegions();
- if (regions == null || regions.size() == 0) {
- return CSSRegionContexts.CSS_UNDEFINED;
- }
- ITextRegion region = regions.get(0);
- return region.getType();
- }
-
- /**
- *
- */
- public static int getLengthDifference(IStructuredDocumentRegionList newNodes, IStructuredDocumentRegionList oldNodes) {
- int newLen = getTextLength(newNodes);
- int oldLen = getTextLength(oldNodes);
- return newLen - oldLen;
- }
-
- /**
- *
- */
- public static String getRegionText(IStructuredDocumentRegion flatNode, ITextRegionList regions) {
- StringBuffer buf = new StringBuffer();
- if (regions != null) {
- for (Iterator i = regions.iterator(); i.hasNext();) {
- ITextRegion region = (ITextRegion) i.next();
- if (region == null) {
- continue;
- }
- buf.append(flatNode.getText(region));
- }
- }
-
- return buf.toString();
- }
-
- /**
- *
- */
- public static int getTextLength(IStructuredDocumentRegionList nodes) {
- int length = 0;
-
- if (nodes != null) {
- for (Enumeration e = nodes.elements(); e.hasMoreElements();) {
- IStructuredDocumentRegion flatNode = (IStructuredDocumentRegion) e.nextElement();
- if (flatNode != null) {
- length += flatNode.getText().length();
- }
- }
- }
-
- return length;
- }
-
- /**
- *
- * @param token
- * @return
- */
- public static boolean isLength(CSSTextToken token) {
- if (token == null)
- return false;
- if (token.kind == CSSRegionContexts.CSS_DECLARATION_VALUE_DIMENSION)
- return true;
- if (token.kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- double number = Double.parseDouble(token.image);
- if (number == 0.0)
- return true;
- }
- return false;
- }
-
- /**
- *
- */
- public static boolean isSelectorText(IStructuredDocumentRegion region) {
- String type = getStructuredDocumentRegionType(region);
- if (CSSRegionUtil.isSelectorBegginingType(type)) {
- return true;
- }
- else if (type == CSSRegionContexts.CSS_UNKNOWN) {
- // String text = flatNode.getText();
- // if (text != null && text.indexOf('.') == 0) {
- return true;
- // }
- }
-
- return false;
- }
-
- /**
- *
- */
- public static String stripQuotes(String text) {
- if (text == null)
- return null;
- String contents = text.trim();
- if (2 <= contents.length()) {
- char first = contents.charAt(0);
- char last = contents.charAt(contents.length() - 1);
- if ((first == '\"' && last == '\"') || (first == '\'' && last == '\'')) {
- contents = contents.substring(1, contents.length() - 1);
- }
- }
- return contents;
- }
-
- public static String detectQuote(String source, String defaultQuote) {
- if (source == null)
- return defaultQuote;
- final String D_QUOTE = "\""; //$NON-NLS-1$
- final String S_QUOTE = "\'"; //$NON-NLS-1$
-
- int dIndex = source.indexOf(D_QUOTE);
- int sIndex = source.indexOf(S_QUOTE);
- if (dIndex < 0 && sIndex < 0) {
- return defaultQuote;
- }
- else if (dIndex < 0) {
- return D_QUOTE;
- }
- else if (sIndex < 0) {
- return S_QUOTE;
- }
- else if (dIndex < sIndex) {
- return S_QUOTE;
- }
- else {
- return D_QUOTE;
- }
- }
-
- /**
- *
- */
- public static void stripSurroundingSpace(ITextRegionList regions) {
- if (regions == null) {
- return;
- }
- while (!regions.isEmpty()) {
- ITextRegion region = regions.get(0);
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- regions.remove(0);
- }
- else {
- break;
- }
- }
- while (!regions.isEmpty()) {
- ITextRegion region = regions.get(regions.size() - 1);
- String type = region.getType();
- if (type == CSSRegionContexts.CSS_S || type == CSSRegionContexts.CSS_COMMENT) {
- regions.remove(region);
- }
- else {
- break;
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java
deleted file mode 100644
index a2c915c515..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportRuleCollector.java
+++ /dev/null
@@ -1,71 +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.css.core.internal.util;
-
-
-
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-
-
-/**
- *
- */
-public class ImportRuleCollector extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-
- protected java.util.Vector rules = new Vector();
- protected ICSSStyleSheet target = null;
-
- /**
- *
- */
- public ImportRuleCollector() {
- super();
- setTraverseImported(false);
- }
-
- /**
- *
- */
- public ImportRuleCollector(ICSSStyleSheet sheet) {
- super();
- target = sheet;
- }
-
- /**
- *
- */
- public java.util.Vector getRules() {
- return rules;
- }
-
- /**
- *
- */
- protected short preNode(ICSSNode node) {
- if (node.getNodeType() == ICSSNode.MEDIARULE_NODE || node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
- return TRAV_CONT;
- }
- if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE) {
- if (target != null) {
- ICSSImportRule imp = (ICSSImportRule) node;
- if (imp.getStyleSheet() != target)
- return TRAV_PRUNE;
- }
- if (!rules.contains(node))
- rules.add(node);
- }
- return TRAV_PRUNE;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java
deleted file mode 100644
index 1f2a7aa7da..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/ImportedCollector.java
+++ /dev/null
@@ -1,61 +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.css.core.internal.util;
-
-
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-
-
-/**
- *
- */
-public class ImportedCollector extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-
- protected java.util.Vector externals = new Vector();
-
- /**
- *
- */
- public ImportedCollector() {
- super();
- setTraverseImported(true);
- }
-
- /**
- *
- */
- public List getExternals() {
- return externals;
- }
-
- /**
- *
- */
- protected short preNode(ICSSNode node) {
- if (node.getNodeType() == ICSSNode.MEDIARULE_NODE) {
- return TRAV_CONT;
- }
- if (node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
- if (!externals.contains(node)) {
- externals.add(node);
- }
- return TRAV_CONT;
- }
- if (node.getNodeType() == ICSSNode.IMPORTRULE_NODE) {
- return TRAV_CONT;
- }
- return TRAV_PRUNE;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java
deleted file mode 100644
index 44d0022999..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/RegionIterator.java
+++ /dev/null
@@ -1,140 +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.css.core.internal.util;
-
-
-
-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;
-
-/**
- *
- */
-public class RegionIterator {
-
- private IStructuredDocumentRegion documentRegion = null;
- private IStructuredDocumentRegion curDocumentRegion = null;
- private int current = -1;
-
- /**
- *
- */
- public RegionIterator(IStructuredDocument structuredDocument, int index) {
- super();
-
- reset(structuredDocument, index);
- }
-
- /**
- *
- */
- public RegionIterator(IStructuredDocumentRegion flatNode, ITextRegion region) {
- super();
- reset(flatNode, region);
- }
-
- /**
- *
- */
- public IStructuredDocumentRegion getStructuredDocumentRegion() {
- return curDocumentRegion;
- }
-
- /**
- *
- */
- public boolean hasNext() {
- if (documentRegion == null)
- return false;
- if (current < 0)
- return false;
- if (current < documentRegion.getRegions().size())
- return true;
- return false;
- }
-
- /**
- *
- */
- public boolean hasPrev() {
- // the same as hasNext()
- return hasNext();
- }
-
- /**
- *
- */
- public ITextRegion next() {
- if (documentRegion == null)
- return null;
- if (current < 0 || documentRegion.getRegions() == null || documentRegion.getRegions().size() <= current)
- return null;
-
- ITextRegion region = documentRegion.getRegions().get(current);
- curDocumentRegion = documentRegion;
-
- if (current >= documentRegion.getRegions().size() - 1) {
- documentRegion = documentRegion.getNext();
- current = -1;
- }
- current++;
-
- return region;
- }
-
- /**
- *
- */
- public ITextRegion prev() {
- if (documentRegion == null)
- return null;
- if (current < 0 || documentRegion.getRegions() == null || documentRegion.getRegions().size() <= current)
- return null;
-
- ITextRegion region = documentRegion.getRegions().get(current);
- curDocumentRegion = documentRegion;
-
- if (current == 0) {
- documentRegion = documentRegion.getPrevious();
- if (documentRegion != null)
- current = documentRegion.getRegions().size();
- else
- current = 0;
- }
- current--;
-
- return region;
- }
-
- /**
- *
- */
- public void reset(IStructuredDocument structuredDocument, int index) {
- documentRegion = structuredDocument.getRegionAtCharacterOffset(index);
- curDocumentRegion = documentRegion;
- if (documentRegion != null) {
- ITextRegion region = documentRegion.getRegionAtCharacterOffset(index);
- current = documentRegion.getRegions().indexOf(region);
- }
- }
-
- /**
- *
- */
- public void reset(IStructuredDocumentRegion flatNode, ITextRegion region) {
- if (region != null && flatNode != null) {
- this.documentRegion = flatNode;
- curDocumentRegion = flatNode;
- current = flatNode.getRegions().indexOf(region);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java
deleted file mode 100644
index 2e44ca8863..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectionCollector.java
+++ /dev/null
@@ -1,76 +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.css.core.internal.util;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-
-
-/**
- */
-public class SelectionCollector extends org.eclipse.wst.css.core.internal.util.AbstractCssTraverser {
-
- int start, end;
- List selectedNodes;
-
- /**
- * SelectionCollector constructor comment.
- */
- public SelectionCollector() {
- super();
- }
-
- /**
- */
- protected void begin(ICSSNode node) {
- selectedNodes = new ArrayList();
- }
-
- /**
- */
- public List getSelectedNodes() {
- if (selectedNodes == null)
- return new ArrayList();
- else
- return new ArrayList(selectedNodes);
- }
-
- /**
- */
- protected short preNode(ICSSNode node) {
- IndexedRegion iNode = (IndexedRegion) node;
- if (iNode.getStartOffset() <= end && start < iNode.getEndOffset()) {
- if (node.getNodeType() != ICSSNode.STYLESHEET_NODE) {
- IndexedRegion iFirstChild = (IndexedRegion) node.getFirstChild();
- IndexedRegion iLastChild = (IndexedRegion) node.getLastChild();
- if (iFirstChild == null || start < iFirstChild.getStartOffset() || iLastChild.getEndOffset() <= end)
- selectedNodes.add(node);
- }
- return TRAV_CONT;
- }
- if (iNode.getStartOffset() > end)
- return TRAV_STOP;
- else
- return TRAV_PRUNE;
- }
-
- /**
- */
- public void setRegion(int newStart, int newEnd) {
- start = newStart;
- end = newEnd;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java
deleted file mode 100644
index 0d52e16dc9..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorValidator.java
+++ /dev/null
@@ -1,97 +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.css.core.internal.util;
-
-
-
-import org.eclipse.wst.css.core.internal.document.CSSSelectorListImpl;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector;
-
-
-public class SelectorValidator {
-
- /**
- * Constructor for SelectorValidator.
- */
- public SelectorValidator(String text) {
- super();
- fText = text;
- }
-
- /**
- * Returns true if the text consists of one CLASS selector. syntax check
- * is a little loose (.123 is passed)
- *
- * ".class" -> true ".123" -> true ".class , .class2" -> false
- * ".class.class2" -> false ".123{}" -> false
- */
- public boolean isClass() {
- ICSSSimpleSelector selector = getOnlyOneSimpleSelector();
- if (selector != null) {
- return (selector.getName().length() == 0 && selector.getNumOfAttributes() == 0 && selector.getNumOfClasses() == 1 && selector.getNumOfIDs() == 0 && selector.getNumOfPseudoNames() == 0);
- }
- return false;
- }
-
- /**
- * Returns true if the text consists of one ID selector.
- *
- * "#ID" -> true "H1#myID" -> false "#abc{}" -> false
- */
- public boolean isID() {
- ICSSSimpleSelector selector = getOnlyOneSimpleSelector();
- if (selector != null) {
- return (selector.getName().length() == 0 && selector.getNumOfAttributes() == 0 && selector.getNumOfClasses() == 0 && selector.getNumOfIDs() == 1 && selector.getNumOfPseudoNames() == 0);
- }
- return false;
- }
-
- /**
- * overall check
- *
- * "P#hoge98 + *:hover > A:link, A.external:visited" -> true "H1 H2 {}" ->
- * false
- */
- public boolean isValid() {
- parse();
- return (fSelectorList != null && fSelectorList.getErrorCount() == 0);
- }
-
- private ICSSSimpleSelector getOnlyOneSimpleSelector() {
- parse();
- if (fSelectorList != null && fSelectorList.getLength() == 1) {
- ICSSSelector selector = fSelectorList.getSelector(0);
- int nItem = selector.getLength();
- if (nItem == 1) {
- ICSSSelectorItem item = selector.getItem(0);
- if (item instanceof ICSSSimpleSelector) {
- return (ICSSSimpleSelector) item;
- }
- }
- }
- return null;
- }
-
- private void parse() {
- if (fSelectorList == null) {
- if (fText != null) {
- fSelectorList = new CSSSelectorListImpl(fText);
- }
- }
- }
-
-
- private String fText = null;
- private ICSSSelectorList fSelectorList = null;
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java
deleted file mode 100644
index 0593ff8d52..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/SelectorsCollector.java
+++ /dev/null
@@ -1,101 +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.css.core.internal.util;
-
-
-
-import java.util.Iterator;
-import java.util.Vector;
-
-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.ICSSStyleRule;
-
-
-/**
- *
- */
-public class SelectorsCollector extends AbstractCssTraverser {
-
- protected Vector selectors = new Vector();
- protected Vector selectorsToAvoid = null;
-
- /**
- *
- */
- public SelectorsCollector() {
- super();
- setTraverseImported(false);
- }
-
- /**
- *
- */
- public void addSelectorToAvoid(ICSSSelector selToAvoid) {
- if (selToAvoid == null)
- return;
- if (selectorsToAvoid == null)
- selectorsToAvoid = new Vector();
-
- if (!selectorsToAvoid.contains(selToAvoid))
- selectorsToAvoid.add(selToAvoid);
- }
-
- /**
- *
- */
- public void addSelectorToAvoid(ICSSStyleRule rule) {
- ICSSSelectorList list = rule.getSelectors();
- Iterator it = list.getIterator();
- while (it.hasNext()) {
- ICSSSelector sel = (ICSSSelector) it.next();
- addSelectorToAvoid(sel);
- }
- }
-
- /**
- *
- */
- public java.util.List getSelectors() {
- return selectors;
- }
-
- /**
- *
- */
- protected short preNode(ICSSNode node) {
- if (node.getNodeType() == ICSSNode.STYLERULE_NODE) {
- ICSSStyleRule rule = (ICSSStyleRule) node;
- ICSSSelectorList list = rule.getSelectors();
- Iterator it = list.getIterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (selectorsToAvoid != null && selectorsToAvoid.contains(obj))
- continue;
- if (!selectors.contains(obj))
- selectors.add(obj);
- }
- return TRAV_PRUNE;
- }
- else if (node.getNodeType() == ICSSNode.STYLESHEET_NODE) {
- return TRAV_CONT;
- }
- return TRAV_PRUNE;
- }
-
- /**
- *
- */
- public void setSelectorsToAvoid(java.util.Vector newSelectorsToAvoid) {
- selectorsToAvoid = newSelectorsToAvoid;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java
deleted file mode 100644
index 7d5e106da2..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLHelper.java
+++ /dev/null
@@ -1,210 +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.css.core.internal.util;
-
-
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.wst.sse.core.internal.util.PathHelper;
-
-/**
- * Hyperlink manager. Proved useful services like link conversion An utility
- * class to help other parsre modules to convert links
- */
-public class URLHelper {
-
- private static final String FILE_PROTOCOL_SEARCH_SIG = "file:/";//$NON-NLS-1$
- private static final String FILE_PROTOCOL_SIG = "file:///";//$NON-NLS-1$
- private static String RELATIVE_PATH_SIG = "..";//$NON-NLS-1$
- private static final String FORWARD_SLASH = "/";//$NON-NLS-1$
- private URL fBaseUrl = null; // base url. assumed to a absulute url
- private String fBaseUrlString = null;
- private URL fDocRoot = null;
- private String fDocRootString = null;
-
- public URLHelper(String baseUrl) {
- initialize(baseUrl, null);
- }
-
- public URLHelper(String baseUrl, String docRoot) {
- initialize(baseUrl, docRoot);
- }
-
- /**
- * Special adujust for file url
- */
- public String adjustFileProtocolUrl(String url) {
- if (url.startsWith(FILE_PROTOCOL_SEARCH_SIG)) {
- url = FILE_PROTOCOL_SIG + url.substring(FILE_PROTOCOL_SEARCH_SIG.length());
- }
- return url;
- }
-
- private String convert(String url, URL baseUrl, String urlString) {
- String absUrl = url;
- if (baseUrl != null) {
- try {
- // do special thing file protocol
- if (baseUrl.getProtocol().equalsIgnoreCase("file")) {//$NON-NLS-1$
- // remove the fist
- if (url.startsWith("/"))//$NON-NLS-1$
- url = url.substring(1);
- // empty string causes malformed exception
- String tempUrl = url;
- if ("".equals(url))//$NON-NLS-1$
- tempUrl = " ";//$NON-NLS-1$
- URL newUrl = new URL(baseUrl, tempUrl);
- // do extra math for file protocol to support ie based
- absUrl = adjustFileProtocolUrl(newUrl.toString());
- }
- else {
- URL newUrl = new URL(fBaseUrl, url);
- absUrl = newUrl.toString();
- }
- }
- catch (MalformedURLException me) {
- }
- // convert everything to forward slash
- absUrl = PathHelper.switchToForwardSlashes(absUrl);
- }
- else {
- // the given may be based on file
- if (urlString != null) {
- // swich the url to proper direction
- url = PathHelper.removeLeadingSeparator(url);
- File fle = new File(urlString, url);
- absUrl = fle.getPath();
-
- }
- // convert everything to forward slash
- absUrl = PathHelper.switchToForwardSlashes(absUrl);
-
- // if the path ends with ".." we need to add a terminating slash
- // or
- // else the link will not be resolved correctly. (it will look
- // like
- // /url/path/to/somewhere/.. instead of /url/path/to/
- if (absUrl.endsWith(FORWARD_SLASH + RELATIVE_PATH_SIG)) {
- absUrl += FORWARD_SLASH;
- }
- }
-
- // resolve relative path to absolute
- absUrl = PathHelper.adjustPath(absUrl);
- return absUrl;
- }
-
- private void initialize(String baseUrl, String docRoot) {
- //
- // Find out whether baes url is a url or file name
- //
- try {
- String temp = PathHelper.appendTrailingURLSlash(baseUrl);
- fBaseUrl = new URL(temp);
- }
- catch (MalformedURLException mue) {
- }
- if (fBaseUrl == null) {
- // it is a file based url
- fBaseUrlString = baseUrl;
- }
-
- // do the same for doc root
- if (docRoot != null) {
- try {
- String temp = PathHelper.appendTrailingURLSlash(docRoot);
- fDocRoot = new URL(temp);
-
- }
- catch (MalformedURLException mue) {
- }
- if (fDocRoot == null) {
- // it is a file based url
- fDocRootString = docRoot;
- }
- }
- }
-
- /**
- * Convert the given url to a abolute url using the base url Input url can
- * be of any othe following format Absolute urls -------------- .
- * http://www.foo.com/ . http://www.foo.com . http://www.foo.com/folder .
- * http://www.foo.com/folder/ . http://www.foo.com/index.html .
- * http://www.foo.com/folder/index.html .
- * http://www.foo.com/folder/../index.html Url relative on document root
- * ------------------------- . / . /folder . /index.html .
- * /folder/index.html . /folder/../index.html
- *
- * Self relative ------------------------- . index.html . ./index.html .
- * ../index.html . folder/index.html . folder/../index.html
- *
- * file based url adds another dimension since it doesn't have a document
- * root So uses fDocRoot if provided
- */
- public String toAbsolute(String url) {
- String absUrl = url;
-
- URL newUrl = null;
- // try to see it is a absolute url
- try {
- newUrl = new URL(url);
- }
- catch (MalformedURLException me) {
- }
- // if document root is provided
- // do special case
- if (newUrl == null) {
- if (fDocRoot == null && fDocRootString == null) {
- // try to check relative url
- absUrl = convert(url, fBaseUrl, fBaseUrlString);
- }
- else {
- // doc root is provided
- // if the url is a doc root based use doc root
-
- if (url.startsWith("/"))//$NON-NLS-1$
- absUrl = convert(url, fDocRoot, fDocRootString);
- else
- absUrl = convert(url, fBaseUrl, fBaseUrlString);
-
- }
- }
- return absUrl;
- }
-
- /**
- * Convert from an absolute url to relative url based on the given url
- * Both are assumed to be ablsute url
- */
- public String toRelative(String url, String documentUrl) {
- String output = url;
- // assuming both urls are absolute
- try {
- URL inputUrl = new URL(url);
- URL docUrl = new URL(documentUrl);
- // filter out if the urls are not fro the same domain
- if (!inputUrl.getProtocol().equals(docUrl.getProtocol()) || !inputUrl.getHost().equals(docUrl.getHost()) || inputUrl.getPort() != docUrl.getPort())
- return output;
- // both url are coming form the same place
- // strip off the domain parts
- String inputName = inputUrl.getFile();
- String docName = docUrl.getFile();
- output = PathHelper.convertToRelative(inputName, docName);
- }
- catch (MalformedURLException me) {
- output = null;
- }
- return output;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
deleted file mode 100644
index ef180d7237..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/URLModelProviderCSS.java
+++ /dev/null
@@ -1,387 +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.css.core.internal.util;
-
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-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.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;
-
-/**
- */
-public class URLModelProviderCSS {
-
- 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 URLModelProviderCSS() {
- 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 URL aURL = new 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 (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
- 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;
- }
-
- /**
- * <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;
-
- // get resolver in Model
- final URIResolver resolver = baseModel.getResolver();
-
- // resolve to absolute url
- final String absurl = (resolver != null) ? 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.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java
deleted file mode 100644
index 968013b517..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionXSubStyleAdapter.java
+++ /dev/null
@@ -1,142 +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.css.core.internal.util.declaration;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValueList;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * for horizontal value of 'background-position'
- */
-public class BackgroundPositionXSubStyleAdapter implements ISubPropertyAdapter {
-
- /**
- *
- */
- public BackgroundPositionXSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- protected CSSTextToken[] correctMeaningToken(CSSTextToken[] src) {
- java.util.ArrayList list = new java.util.ArrayList();
- for (int i = 0; i < src.length; i++) {
- if (src[i].kind != CSSRegionContexts.CSS_S && src[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S && src[i].kind != CSSRegionContexts.CSS_COMMENT)
- list.add(src[i]);
- }
- CSSTextToken[] ret = new CSSTextToken[list.size()];
- list.toArray(ret);
- return ret;
- }
-
- /**
- *
- */
- public String get(ICSS2Properties properties) {
- String str = null;
- Object obj = properties.get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
- if (obj != null) {
- PropCMProperty propX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
- PropCMProperty propY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
- if (obj instanceof ICSSValueList) {
- ICSSValueList list = (ICSSValueList) obj;
- ICSSValue value = (ICSSValue) list.item(0);
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- ICSSPrimitiveValue prim = (ICSSPrimitiveValue) value;
- if (prim.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
- // check not top or bottom
- if (!propX.canHave(prim.getStringValue()) && propY.canHave(prim.getStringValue())) {
- // case order is vertical -> horizontal
- value = (ICSSValue) list.item(1);
- }
- }
- }
- str = value.getCSSValueText();
- }
- else if (obj instanceof ICSSValue) {
- str = ((ICSSValue) obj).getCSSValueText();
- if (str.equalsIgnoreCase(IValID.V_BOTTOM) || str.equalsIgnoreCase(IValID.V_TOP))
- str = "";//$NON-NLS-1$
- }
- else {
- str = obj.toString();
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, str);
- CSSTextToken[] tokens = parser.getTokens();
-
- tokens = correctMeaningToken(tokens);
- if (tokens.length == 0)
- str = "";//$NON-NLS-1$
- else if (tokens.length == 1 && (tokens[0].image.equalsIgnoreCase(IValID.V_BOTTOM) || tokens[0].image.equalsIgnoreCase(IValID.V_TOP)))
- str = "";//$NON-NLS-1$
- else
- str = tokens[0].image;
- }
- }
- return (str != null) ? str : "";//$NON-NLS-1$
- }
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- String newValue = null;
- String valH = value;
- String valV = properties.getBackgroundPositionY();
- if (valV == null || valV.length() == 0)
- newValue = valH;
- else if (valH == null || valH.length() == 0) {
- Collection valX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X).getValues();
- Collection valY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y).getValues();
- PropCMUtil.minus(valY, valX);
- Iterator it = valY.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj.toString().equals(valV.toLowerCase())) {
- // need not compensate for ...
- newValue = valV;
- break;
- }
- }
- // compensate for Horizontal value
- if (newValue == null) {
- // check valV is length or not
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, valV.trim());
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens != null && tokens.length > 0 && tokens[0].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- newValue = IValID.V_LEFT + " " + valV;//$NON-NLS-1$
- }
- else
- newValue = "0% " + valV;//$NON-NLS-1$
- }
- }
- else
- newValue = valH + " " + valV;//$NON-NLS-1$
- properties.setBackgroundPosition(newValue);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java
deleted file mode 100644
index 948df9b194..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundPositionYSubStyleAdapter.java
+++ /dev/null
@@ -1,150 +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.css.core.internal.util.declaration;
-
-
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.contentmodel.IValID;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMSubProperty;
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMUtil;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSPrimitiveValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValue;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSValueList;
-import org.w3c.dom.css.CSSPrimitiveValue;
-import org.w3c.dom.css.CSSValue;
-
-
-/**
- * for vertical value of 'background-position'
- */
-public class BackgroundPositionYSubStyleAdapter implements ISubPropertyAdapter {
-
- /**
- *
- */
- public BackgroundPositionYSubStyleAdapter() {
- super();
- }
-
- /**
- *
- */
- protected CSSTextToken[] correctMeaningToken(CSSTextToken[] src) {
- java.util.ArrayList list = new java.util.ArrayList();
- for (int i = 0; i < src.length; i++) {
- if (src[i].kind != CSSRegionContexts.CSS_S && src[i].kind != CSSRegionContexts.CSS_DECLARATION_VALUE_S && src[i].kind != CSSRegionContexts.CSS_COMMENT)
- list.add(src[i]);
- }
- CSSTextToken[] ret = new CSSTextToken[list.size()];
- list.toArray(ret);
- return ret;
- }
-
- /**
- *
- */
- public String get(ICSS2Properties properties) {
- String str = null;
- Object obj = properties.get(PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION));
- if (obj != null) {
- PropCMProperty propX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X);
- PropCMProperty propY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y);
- if (obj instanceof ICSSValueList) {
- ICSSValueList list = (ICSSValueList) obj;
- int index = 1;
- ICSSValue value = (ICSSValue) list.item(0);
- if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
- ICSSPrimitiveValue prim = (ICSSPrimitiveValue) value;
- if (prim.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
- // check not top or bottom
- if (!propX.canHave(prim.getStringValue()) && propY.canHave(prim.getStringValue())) {
- // case order is vertical -> horizontal
- index = 0;
- }
- }
- }
- str = ((ICSSValue) list.item(index)).getCSSValueText();
- }
- else if (obj instanceof ICSSValue) {
- str = ((ICSSValue) obj).getCSSValueText();
- if (!str.equalsIgnoreCase(IValID.V_BOTTOM) && !str.equalsIgnoreCase(IValID.V_TOP))
- str = "";//$NON-NLS-1$
- }
- else {
- str = obj.toString();
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, str);
- CSSTextToken[] tokens = parser.getTokens();
-
- tokens = correctMeaningToken(tokens);
- if (tokens.length == 1 && (tokens[0].image.equalsIgnoreCase(IValID.V_BOTTOM) || tokens[0].image.equalsIgnoreCase(IValID.V_TOP)))
- str = tokens[0].image;
- else if (tokens.length > 1)
- str = tokens[1].image;
- else
- str = "";//$NON-NLS-1$
- }
- }
- return (str != null) ? str : "";//$NON-NLS-1$
- }
-
- /**
- *
- */
- public void set(ICSS2Properties properties, String value) throws org.w3c.dom.DOMException {
- String newValue = null;
- String valH = properties.getBackgroundPositionX();
- String valV = value;
- if (valH != null && (valH.trim().equals("0%") /* default value */|| //$NON-NLS-1$
- valH.trim().equalsIgnoreCase(IValID.V_LEFT) /*
- * another
- * default
- * value
- */))
- valH = null;
- if (valV == null || valV.length() == 0)
- newValue = valH;
- else if (valH == null || valH.length() == 0) {
- Collection valX = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_X).getValues();
- Collection valY = PropCMSubProperty.getInstanceOf(PropCMSubProperty.PSUB_BG_POSITION_Y).getValues();
- PropCMUtil.minus(valY, valX);
- Iterator it = valY.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- if (obj.toString().equals(valV.toLowerCase())) {
- // need not compensate for ...
- newValue = valV;
- break;
- }
- }
- // compensate for Horizontal value
- if (newValue == null) {
- // check valV is length or not
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, valV.trim());
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens != null && tokens.length > 0 && tokens[0].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- newValue = IValID.V_LEFT + " " + valV;//$NON-NLS-1$
- }
- else
- newValue = "0% " + valV;//$NON-NLS-1$
- }
- }
- else
- newValue = valH + " " + valV;//$NON-NLS-1$
- properties.setBackgroundPosition(newValue);
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java
deleted file mode 100644
index 9ead299f2a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BackgroundShorthandAdapter.java
+++ /dev/null
@@ -1,179 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'background' property 'background' will be expanded to
- * 'background-attachment', 'background-color', 'background-image',
- * 'background-position', 'background-repeat',
- */
-public class BackgroundShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BackgroundShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String color = "", image = "", repeat = "", attach = "", pos = "";//$NON-NLS-5$//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
- PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
- PropCMProperty propRepeat = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
- PropCMProperty propAttach = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
- PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- else if (propImage.canHave(tokens[i].image))
- image = tokens[i].image;
- else if (propRepeat.canHave(tokens[i].image))
- repeat = tokens[i].image;
- else if (propAttach.canHave(tokens[i].image))
- attach = tokens[i].image;
- else if (propPos.canHave(tokens[i].image)) {
- if (pos == null || pos.length() <= 0)
- pos = tokens[i].image;
- else
- pos = pos + " " + tokens[i].image;//$NON-NLS-1$
- }
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
- if (pos == null || pos.length() <= 0)
- pos = tokens[i].image;
- else
- pos = pos + " " + tokens[i].image;//$NON-NLS-1$
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- image = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- dest.set(propColor.getName(), color);
- dest.set(propImage.getName(), image);
- dest.set(propRepeat.getName(), repeat);
- dest.set(propAttach.getName(), attach);
- dest.set(propPos.getName(), pos);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String color = null, image = null, repeat = null, attach = null, pos = null;
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_COLOR);
- PropCMProperty propImage = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_IMAGE);
- PropCMProperty propRepeat = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_REPEAT);
- PropCMProperty propAttach = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_ATTACHMENT);
- PropCMProperty propPos = PropCMProperty.getInstanceOf(PropCMProperty.P_BG_POSITION);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- else if (propImage.canHave(tokens[i].image))
- image = tokens[i].image;
- else if (propRepeat.canHave(tokens[i].image))
- repeat = tokens[i].image;
- else if (propAttach.canHave(tokens[i].image))
- attach = tokens[i].image;
- else if (propPos.canHave(tokens[i].image)) {
- if (pos == null)
- pos = tokens[i].image;
- else
- pos = pos + " " + tokens[i].image;//$NON-NLS-1$
- }
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PERCENTAGE) {
- if (pos == null)
- pos = tokens[i].image;
- else
- pos = pos + " " + tokens[i].image;//$NON-NLS-1$
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_URI) {
- image = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- if (propColor == propDest)
- return color;
- else if (propImage == propDest)
- return image;
- else if (propRepeat == propDest)
- return repeat;
- else if (propAttach == propDest)
- return attach;
- else if (propPos == propDest)
- return pos;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java
deleted file mode 100644
index 1107e2744e..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderBottomShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-bottom' property 'border-bottom' will be expanded to
- * 'border-bottom-color', 'border-bottom-style', 'border-bottom-width',
- */
-public class BorderBottomShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderBottomShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- dest.set(propColor.getName(), color);
- dest.set(propStyle.getName(), style);
- dest.set(propWidth.getName(), width);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String color = null, style = null, width = null;
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_BOTTOM_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- if (propColor == propDest)
- return color;
- else if (propStyle == propDest)
- return style;
- else if (propWidth == propDest)
- return width;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java
deleted file mode 100644
index d8cc676e9a..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderColorShorthandAdapter.java
+++ /dev/null
@@ -1,158 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-color' property 'border-color' will be expanded to
- * 'border-top-color', 'border-right-color', 'border-bottom-color',
- * 'border-left-color',
- */
-public class BorderColorShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderColorShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String[] idents = new String[4];
- int j = 0;
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH)
- idents[j++] = tokens[i].image;
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- idents[j++] = buf.toString();
- }
- if (j == 4)
- break;
- }
-
- String[] dests = new String[4];
- if (j == 0)
- return true;
- else if (j == 1) {
- dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
- }
- else if (j == 2) {
- dests[0] = dests[2] = idents[0];
- dests[1] = dests[3] = idents[1];
- }
- else if (j == 3) {
- dests[0] = idents[0];
- dests[1] = dests[3] = idents[1];
- dests[2] = idents[2];
- }
- else {
- for (int k = 0; k < 4; k++)
- dests[k] = idents[k];
- }
- dest.set(PropCMProperty.P_BORDER_TOP_COLOR, dests[0]);
- dest.set(PropCMProperty.P_BORDER_RIGHT_COLOR, dests[1]);
- dest.set(PropCMProperty.P_BORDER_BOTTOM_COLOR, dests[2]);
- dest.set(PropCMProperty.P_BORDER_LEFT_COLOR, dests[3]);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String[] idents = new String[4];
- int j = 0;
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH)
- idents[j++] = tokens[i].image;
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- idents[j++] = buf.toString();
- }
- if (j == 4)
- break;
- }
-
- if (j == 0)
- return null;
- else if (j == 1)
- return idents[0];
- else if (j == 2) {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_COLOR || propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_COLOR)
- return idents[0];
- else
- return idents[1];
- }
- else if (j == 3) {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_COLOR)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_COLOR)
- return idents[2];
- else
- return idents[1];
- }
- else {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_COLOR)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_BORDER_RIGHT_COLOR)
- return idents[1];
- else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_COLOR)
- return idents[2];
- else if (propDest.getName() == PropCMProperty.P_BORDER_LEFT_COLOR)
- return idents[3];
- else
- return null;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java
deleted file mode 100644
index f8b72392a4..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderLeftShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-left' property 'border-left' will be expanded to
- * 'border-left-color', 'border-left-style', 'border-left-width',
- */
-public class BorderLeftShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderLeftShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- dest.set(propColor.getName(), color);
- dest.set(propStyle.getName(), style);
- dest.set(propWidth.getName(), width);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String color = null, style = null, width = null;
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_LEFT_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- if (propColor == propDest)
- return color;
- else if (propStyle == propDest)
- return style;
- else if (propWidth == propDest)
- return width;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java
deleted file mode 100644
index 50a5fc6127..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderRightShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-right' property 'border-right' will be expanded to
- * 'border-right-color', 'border-right-style', 'border-right-width',
- */
-public class BorderRightShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderRightShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- dest.set(propColor.getName(), color);
- dest.set(propStyle.getName(), style);
- dest.set(propWidth.getName(), width);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String color = null, style = null, width = null;
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_RIGHT_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- if (propColor == propDest)
- return color;
- else if (propStyle == propDest)
- return style;
- else if (propWidth == propDest)
- return width;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java
deleted file mode 100644
index 12718a1704..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border' property 'border' will be expanded to 'border-color',
- * 'border-style', 'border-width',
- */
-public class BorderShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- dest.set(propColor.getName(), color);
- dest.set(propStyle.getName(), style);
- dest.set(propWidth.getName(), width);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String color = null, style = null, width = null;
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- if (propColor == propDest)
- return color;
- else if (propStyle == propDest)
- return style;
- else if (propWidth == propDest)
- return width;
- else
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java
deleted file mode 100644
index 0e409c15dd..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderStyleShorthandAdapter.java
+++ /dev/null
@@ -1,130 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-style' property 'border-style' will be expanded to
- * 'border-top-style', 'border-right-style', 'border-bottom-style',
- * 'border-left-style',
- */
-public class BorderStyleShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderStyleShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String[] idents = new String[4];
- int j = 0;
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT)
- idents[j++] = tokens[i].image;
- if (j == 4)
- break;
- }
-
- String[] dests = new String[4];
- if (j == 0)
- return true;
- else if (j == 1) {
- dests[0] = dests[1] = dests[2] = dests[3] = idents[0];
- }
- else if (j == 2) {
- dests[0] = dests[2] = idents[0];
- dests[1] = dests[3] = idents[1];
- }
- else if (j == 3) {
- dests[0] = idents[0];
- dests[1] = dests[3] = idents[1];
- dests[2] = idents[2];
- }
- else {
- for (int k = 0; k < 4; k++)
- dests[k] = idents[k];
- }
- dest.set(PropCMProperty.P_BORDER_TOP_STYLE, dests[0]);
- dest.set(PropCMProperty.P_BORDER_RIGHT_STYLE, dests[1]);
- dest.set(PropCMProperty.P_BORDER_BOTTOM_STYLE, dests[2]);
- dest.set(PropCMProperty.P_BORDER_LEFT_STYLE, dests[3]);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String[] idents = new String[4];
- int j = 0;
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT)
- idents[j++] = tokens[i].image;
- if (j == 4)
- break;
- }
-
- if (j == 0)
- return null;
- else if (j == 1)
- return idents[0];
- else if (j == 2) {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_STYLE || propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_STYLE)
- return idents[0];
- else
- return idents[1];
- }
- else if (j == 3) {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_STYLE)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_STYLE)
- return idents[2];
- else
- return idents[1];
- }
- else {
- if (propDest.getName() == PropCMProperty.P_BORDER_TOP_STYLE)
- return idents[0];
- else if (propDest.getName() == PropCMProperty.P_BORDER_RIGHT_STYLE)
- return idents[1];
- else if (propDest.getName() == PropCMProperty.P_BORDER_BOTTOM_STYLE)
- return idents[2];
- else if (propDest.getName() == PropCMProperty.P_BORDER_LEFT_STYLE)
- return idents[3];
- else
- return null;
- }
-
- }
-}
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java
deleted file mode 100644
index e8738f759b..0000000000
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/util/declaration/BorderTopShorthandAdapter.java
+++ /dev/null
@@ -1,140 +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.css.core.internal.util.declaration;
-
-
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.parserz.CSSRegionContexts;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextParser;
-import org.eclipse.wst.css.core.internal.parserz.CSSTextToken;
-
-
-/**
- * For 'border-top' property 'border-top' will be expanded to
- * 'border-top-color', 'border-top-style', 'border-top-width',
- */
-public class BorderTopShorthandAdapter implements IShorthandAdapter {
-
- /**
- *
- */
- public BorderTopShorthandAdapter() {
- super();
- }
-
- /**
- *
- */
- public boolean expand(String source, CSSPropertyContext dest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return false;
- }
- String color = "", style = "", width = "";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- dest.set(propColor.getName(), color);
- dest.set(propStyle.getName(), style);
- dest.set(propWidth.getName(), width);
-
- return true;
- }
-
- /**
- *
- */
- public String extract(String source, PropCMProperty propDest) {
- CSSTextParser parser = new CSSTextParser(CSSTextParser.MODE_DECLARATION_VALUE, source);
- CSSTextToken[] tokens = parser.getTokens();
- if (tokens.length <= 0) {
- return null;
- }
- String color = null, style = null, width = null;
- PropCMProperty propColor = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_COLOR);
- PropCMProperty propStyle = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_STYLE);
- PropCMProperty propWidth = PropCMProperty.getInstanceOf(PropCMProperty.P_BORDER_TOP_WIDTH);
-
- for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_IDENT) {
- if (propStyle.canHave(tokens[i].image))
- style = tokens[i].image;
- else if (propWidth.canHave(tokens[i].image))
- width = tokens[i].image;
- else if (propColor.canHave(tokens[i].image))
- color = tokens[i].image;
- }
- else if (org.eclipse.wst.css.core.internal.util.CSSUtil.isLength(tokens[i]) || tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_NUMBER) {
- width = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_HASH) {
- color = tokens[i].image;
- }
- else if (tokens[i].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_FUNCTION) {
- StringBuffer buf = new StringBuffer();
- while (i < tokens.length) {
- if (tokens[i].kind == CSSRegionContexts.CSS_COMMENT) {
- i++;
- continue;
- }
- buf.append(tokens[i].image);
- if (tokens[i++].kind == CSSRegionContexts.CSS_DECLARATION_VALUE_PARENTHESIS_CLOSE)
- break;
- }
- i--;
- color = buf.toString();
- }
- }
-
- if (propColor == propDest)
- return color;
- else if (propStyle == propDest)
- return style;
- else if (propWidth == propDest)